Skip to main content

Create API Key

POST 

/v1/user/authorization/keys/:organization_id/create

Creates a new API key with specified scope and permissions.

By default, API keys are scoped to an organization. Additionally, API keys can also be scoped to a specific dataset or a specific user.

If only key_name is provided in the request for creating an API key, the key will be scoped to the user's current organization.

To scope an API key to a specific organization by ID, set key_scope = "ORGANIZATION" and key_target_id with the UUID of the organization in the API key creation request.

To scope an API key to a specific dataset, set key_scope = "DATASET" and key_target_id with the UUID of the dataset in the API key creation request.

To scope an API key to a specific user, set key_scope = "USER" in the API key creation request.

Request

Path Parameters

    organization_id Organization Idrequired

Body

required

    key_name Key Name (string)required

    The name of the API key to create.

    key_role

    object

    The role associated to the API key scope

    anyOf

    An enumeration.

    string

    Possible values: [OWNER, ADMIN, MEMBER, VIEWER, EXTERNAL, GUEST, NONE]

    key_scope APIKeyScopeType (string)

    Possible values: [ORGANIZATION, DATASET, USER]

    An enumeration.

    key_target_id uuid

    The UUID representing a dataset id or an organization id

Responses

Successful Response

Schema

    key Key (string)required

    The API key that was created

Loading...