b2_authorize_account
    • Dark
      Light

    b2_authorize_account

    • Dark
      Light

    Article Summary

    Get
    /b2api/v3/b2_authorize_account

    Used to log in to the Partner API. Returns an authorization token that can be used for Partner API operationn and a URL that should be used as the base URL for subsequent API calls.


    You'll find the Master Application Key on the App Keys page on the website. When using the Master Application Key, use your "master application keyID" and the "applicationKey" you created from the website.

    Header parameters
    Authorization
    stringRequired

    HTTP basic authentication with the Master Application Key ID as user ID and the corresponding Application Key as password.

    Most tools accept the user ID and password, but you can construct the value for the Authorization header as follows:

    • The Application Key ID and Application Key are combined into a string in the format "applicationKeyId:applicationKey".
    • The combined string is Base64 encoded.
    • "Basic " is put before the encoded string.
    Responses
    200

    The request succeeded.

    Array of object
    object
    accountId
    string

    The identifier for the account.

    ExampleYOUR_ACCOUNT_ID
    authorizationToken
    string

    An authorization token to use with all Partner API calls, other than b2_authorize_account, that need an Authorization header. This authorization token is valid for at most 24 hours.

    Example5_105afc3f833df1b0000000000_01af2678_53f72d_acct_Dfwv_qnmYuK-45MiX3DlA5Kuct9=
    applicationKeyExpirationTimestamp
    integer

    Expiration timestamp of application key.

    Examplenull
    apiInfo
    object

    An object containing the groupsApiUrl, which is the baseUrl for all Partner API calls.

    groupsApi
    capabilities
    Array of string

    A list of strings, each one naming a capability the new key should have.

    string
    Valid values["listKeys","writeKeys","deleteKeys","listAllBucketNames","listBuckets","readBuckets","writeBuckets","deleteBuckets","readBucketRetentions","writeBucketRetentions","readBucketEncryption","writeBucketEncryption","listFiles","readFiles","shareFiles","writeFiles","deleteFiles","readFileLegalHolds","writeFileLegalHolds","readFileRetentions","writeFileRetentions","bypassGovernance"]
    groupsApiUrl
    string
    Examplehttps://apiNNN.backblazeb2.com
    infoType
    string
    ExamplegroupsApi
    400
    statuscodedescription
    400bad_requestThe request had the wrong fields or illegal values. The message returned with the error will describe the problem.
    object
    status
    integer

    The numeric HTTP status code. Always matches the status in the HTTP response.

    Example400
    code
    string

    A single-identifier code that identifies the error.

    Exampleinvalid_bucket_name
    message
    string

    A human-readable message, in English, saying what went wrong.

    Examplebucket name is too long
    401
    statuscodedescription
    401unauthorizedThe applicationKeyId and/or the applicationKey are wrong.
    401unsupportedThe applicationKeyId is valid, but cannot be used with this version of the Partner API. The message contains information about what the problem is.