Sign up for free

Count API keys

This endpoint enables you to count the overall number of API keys for a specific project.

get /projects/{project_id}/api-keys/count
name string

Filter for API key names that contain this value. The API can return partial matches.

value string

Filter for the value of a specific API key.

Responses

ExamplesSchema

Successful response

{
  "count": 16
}

List API keys

This endpoint enables you to list all API keys in a project.

Note that the API response only contains one page of results. To navigate to another page, use the previous or next path queries provided in the respone's links object.

get /projects/{project_id}/api-keys
page_size int

Number of records per page.

Default
20
Min
1
Max
100
page int

Page number to retrieve.

Default
1
name string

Filter for API key names that contain this value. The API can return partial matches.

value string

Filter for the value of a specific API key.

sort_by string

Select a property to sort by. Allowed values: created_at, name, value.

Enum
  • created_at
  • name
  • value
sort_order string

Select the order to sort by. Allowed values: asc, desc.

Enum
  • asc
  • desc

Responses

ExamplesSchema

Successful response

{
  "items": [
    {
      "project_id": "project_1CCq9NurjJBRehCVCe8XQY",
      "api_key_id": "api_key_1CCq9NwWhBxwjAgHzpuZx4",
      "created_at": "2023-06-07T17:32:28Z",
      "name": "Development key",
      "value": "19Kc5nhC7...ADWwAbTuUer"
    }
  ],
  "pagination": {
    "page": 123,
    "page_size": 123,
    "item_count": 123
  },
  "links": [
    {
      "rel": "previous",
      "href": "/projects?page_size=20&name=aaa&sort_by=name&sort_order=desc&page=2"
    }
  ]
}

Create API key

This endpoint enables you to create a new API key in a specific project.

post /projects/{project_id}/api-keys
name string

required

The name of the Admin API key. Also visible in the dashboard. You may set any value that fits your organization purposes.

Requests

{
  "name": "string"
}

Responses

ExamplesSchema

API key created successfully

{
  "project_id": "project_1CCq9NurjJBRehCVCe8XQY",
  "api_key_id": "api_key_1CCq9NwWhBxwjAgHzpuZx4",
  "created_at": "2023-06-07T17:32:28Z",
  "name": "Development key",
  "value": "19Kc5nhC7...ADWwAbTuUer"
}

Get API key

This endpoint enables you to retrieve a specific API key from a project.

get /projects/{project_id}/api-keys/{api_key_id}
project_id string

required

The ID of the project that the API key belongs to.

api_key_id string

required

The ID of the API key to retrieve.

Responses

ExamplesSchema

Successful response

{
  "project_id": "project_1CCq9NurjJBRehCVCe8XQY",
  "api_key_id": "api_key_1CCq9NwWhBxwjAgHzpuZx4",
  "created_at": "2023-06-07T17:32:28Z",
  "name": "Development key",
  "value": "19Kc5nhC7...ADWwAbTuUer"
}

Delete API key

This endpoint enables you to delete an API key from a specific project.

Note that deleting an API key is permanent - there is no way to retrieve an API key after you delete it.

delete /projects/{project_id}/api-keys/{api_key_id}
project_id string

required

The ID of the project that the API key belongs to.

api_key_id string

required

The ID of the API key you want to delete.

Responses

ExamplesSchema

API key deleted successfully

Empty response

Update API key

This endpoint enables you to update the name of a project that is tied to an API key.

patch /projects/{project_id}/api-keys/{api_key_id}
name string

The name of the project you want to update.

Example
"My project 2"

Requests

{
  "name": "My project 2"
}

Responses

ExamplesSchema

API key updated successfully

{
  "project_id": "project_1CCq9NurjJBRehCVCe8XQY",
  "api_key_id": "api_key_1CCq9NwWhBxwjAgHzpuZx4",
  "created_at": "2023-06-07T17:32:28Z",
  "name": "Development key",
  "value": "19Kc5nhC7...ADWwAbTuUer"
}

Was this page helpful?