API key create

Create a new API key for the given principal. The secret value may be returned only in this response.

POST
{{host}}/v1/apikey?principal={{principal}}
VERB:POST
BASE URL:{{host}}/v1/apikey
QUERY STRING:?principal={{principal}}

Query parameters#

  • principalstring
    Required

    Principal whose API keys are managed (e.g. owner or logical principal id).

    example: root

Headers#

Send these headers with the request. Names are case-insensitive per HTTP rules.
  • x-api-keyRequired

    Your BigState API key.

    *provide api key here*
  • Content-TypeRequired

    MIME type of the request body.

    application/json
  • AcceptRequired

    MIME types the client can understand in the response.

    application/json

See authentication headers here.

  • Create named key
    {
    "name": "name1"
    }
  • 200Response body · object

    API key was created. The response may include the secret value only in this response.

    {
    "apiKey": "{{new-api-key-secret}}"
    }
    • apiKeystring

      Secret API key string. May be returned only once when the key is created.

  • 401

    Unauthorized.

  • 403

    Access denied. The caller does not have sufficient rights to perform this operation.

  • 400Response body · object

    Bad request.

    {
    "error": 6,
    "desc": "Invalid request"
    }
    • errornumber

      Numeric error code. See the error codes reference for the full list.

    • descstring

      Human-readable description of the error.

Create API key

Create a new API key for the given principal.

curl https://api.bigstate.dev/v1/apikey?principal=root \
--request POST \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"name": "name1"
}'

© 2024 BigState