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
- application/json
Body
required
- AccessRole
- DatasetRole
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
]
An enumeration.
string
Possible values: [ADMIN
, EDITOR
, VIEWER
, NONE
]
Possible values: [ORGANIZATION
, DATASET
, USER
]
An enumeration.
The UUID representing a dataset id or an organization id
Responses
- 200
- 422
Successful Response
- application/json
- Schema
- Example (from schema)
Schema
The API key that was created
{
"key": "string"
}
Validation Error
- application/json
- Schema
- Example (from schema)
Schema
Array [
Array [
- MOD1
- MOD2
]
]
detail
object[]
loc
object[]
required
anyOf
string
integer
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}