Authorize
  • 17 Sep 2026
  • Dark
    Light

Authorize

  • Dark
    Light

Article summary

Get
/orgs/v1/authorize

Availability

Early Access: July 1, 2026

Early Access is gated; contact the Backblaze Sales team for access.

Limited Availability: July 1, 2026

This API is available only to customers with access to the Backblaze Enterprise Web Console. For more information, contact the Backblaze Sales team.

Exchange Service Principal Key credentials for a short-lived bearer token

Callers invoke this endpoint with the credentialId and secret of a Service Principal Key using HTTP Basic authentication. The response includes an authToken for use with all subsequent Organizations API requests.

The actual session duration is the minimum of the remaining lifetime of the key and the supplied (or default) duration.

Security
HTTP
Type basic

HTTP Basic authentication using the credentialId and secret of a Service Principal Key. Used only by the /orgs/v1/authorize endpoint to obtain a bearer token.

Query parameters
sessionValidDurationSeconds
integer

Requested session duration in seconds. Default 3600 (1 hour), maximum 43200 (12 hours).

Minimum1
Maximum43200
Default3600
Responses
200

The request succeeded.

{
  "apiUrl": "https://api.backblazeb2.com",
  "asOf": "d20260602_m192621",
  "authToken": "5_910-efc6e9a0-5eb8-11f1-a520-b9cd4f26c19a_1780428381590_01c4c98a_Xu-nGx_x1iZ0NmBMYwU.4s0vWYYL5Xsx-I=",
  "challenge": null,
  "clientToken": "ct_1_944d0f9f99408d46aa9750a3d894c48c197452f6_igooMo3NzHnQkcr6RWrZi57uMtU=",
  "credentialProblem": null,
  "idleTimeout": "d20260603_m072621",
  "info": {},
  "isAuthenticated": true,
  "scope": [
    {
      "scopeType": "orgServicePrincipal",
      "servicePrincipalKeyName": "accounts/942733365851/servicePrincipals/2/keys/019e6a8a-678e-7298-9167-4bd65df2f272"
    }
  ],
  "sessionExpires": "d20260602_m202600"
}
Expand All
object
apiUrl
string

Base URL for subsequent Organizations API calls.

asOf
string

Opaque server-side timestamp.

authToken
string

Bearer token to use in the Authorization header on subsequent requests.

challenge
object | null
clientToken
string
credentialProblem
string | null
idleTimeout
string

Opaque server-side timestamp at which the session becomes idle.

info
object
isAuthenticated
boolean
scope
Array of object
object
scopeType
string
ExampleorgServicePrincipal
servicePrincipalKeyName
string
Exampleaccounts/942733365851/servicePrincipals/2/keys/019e6a8a-678e-7298-9167-4bd65df2f272
sessionExpires
string

Opaque server-side timestamp at which the session expires.

401

The request was not authenticated.

HTTP StatusCodeDescription
401UNAUTHORIZEDMissing, expired, or invalid bearer token.
Expand All
object
requestId
string

Opaque correlation identifier matching the Request-Id response header. Include in support requests.

Example4bf92f3577b34da6a3ce929d0e0e4736
error
object
code
integer

Numeric error code.

Example10
message
string

Human-readable description of the error.

Exampleetag mismatch
details
object

Reserved for structured, non-sensitive diagnostic information related to the error condition.

429

The request was rate-limited.

HTTP StatusCodeDescription
429TOO_MANY_REQUESTSRate limit exceeded. Use exponential backoff.
Expand All
object
requestId
string

Opaque correlation identifier matching the Request-Id response header. Include in support requests.

Example4bf92f3577b34da6a3ce929d0e0e4736
error
object
code
integer

Numeric error code.

Example10
message
string

Human-readable description of the error.

Exampleetag mismatch
details
object

Reserved for structured, non-sensitive diagnostic information related to the error condition.

500

The server encountered an unexpected condition.

HTTP StatusCodeDescription
500INTERNALUnexpected server error. Include the requestId when contacting support.
Expand All
object
requestId
string

Opaque correlation identifier matching the Request-Id response header. Include in support requests.

Example4bf92f3577b34da6a3ce929d0e0e4736
error
object
code
integer

Numeric error code.

Example10
message
string

Human-readable description of the error.

Exampleetag mismatch
details
object

Reserved for structured, non-sensitive diagnostic information related to the error condition.


Was this article helpful?