Skip to content
Skip to Content
Full reference

API Keys

List personal API keys

GET
/v1/api-keys

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Response Body

The user's keys. Only the prefix of each key is shown.

application/json
  1. response
api_keys*array<>
Example Request
curl -X GET 'https://example.com/v1/api-keys'
Example Response
{  "api_keys": [    {      "id": "string",      "name": "string",      "prefix": "string",      "full_access": true,      "scopes": {        "property1": "read",        "property2": "read"      },      "expires_at": "2019-08-24T14:15:22Z",      "last_used_at": "2019-08-24T14:15:22Z",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
POST
/v1/api-keys

The full key is in the response and is never shown again. Save it now. The name must be unique among your keys, ignoring case.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Request Body

application/json
  1. body
name*string
Length1 <= length <= 100
full_access?boolean

write on every resource, including ones added later. Send exactly one of it, scopes or scope; a body with none of them gets a 422.

scopes?

A level per resource, used when full_access is off. Resources left out get none. At least one resource must be read or write.

scope?stringDeprecated

The old shorthand, kept for existing clients: that level on every resource except rules and webhooks.

Value in"read""write"
expires_at?|

When the key stops working. Must be in the future. Leave out for a key that lasts until it is revoked.

Formatdate-time

Response Body

The new key, with its full text

application/json
  1. response
id*string
name*string
prefix*string
full_access*boolean

write on every resource. scopes is empty then.

scopes*

The resources the key may use and how, when full_access is off. A resource that is not listed is none. The old scope field is gone.

expires_at?|
Formatdate-time
last_used_at?|
Formatdate-time
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
key*string
Example Request
curl -X POST 'https://example.com/v1/api-keys' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
Example Response
{  "id": "string",  "name": "string",  "prefix": "string",  "full_access": true,  "scopes": {    "property1": "read",    "property2": "read"  },  "expires_at": "2019-08-24T14:15:22Z",  "last_used_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "key": "ga_ABCDEF…"}

Get one personal API key

GET
/v1/api-keys/{id}

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

id*string

Response Body

The key. Only its prefix is shown.

application/json
  1. response
id*string
name*string
prefix*string
full_access*boolean

write on every resource. scopes is empty then.

scopes*

The resources the key may use and how, when full_access is off. A resource that is not listed is none. The old scope field is gone.

expires_at?|
Formatdate-time
last_used_at?|
Formatdate-time
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X GET 'https://example.com/v1/api-keys/string'
Example Response
{  "id": "string",  "name": "string",  "prefix": "string",  "full_access": true,  "scopes": {    "property1": "read",    "property2": "read"  },  "expires_at": "2019-08-24T14:15:22Z",  "last_used_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
PATCH
/v1/api-keys/{id}

Only the name can change. A key's access and expiry are fixed when it is created.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

id*string

Request Body

application/json
  1. body
name*string
Length1 <= length <= 100

Response Body

The renamed key

application/json
  1. response
id*string
name*string
prefix*string
full_access*boolean

write on every resource. scopes is empty then.

scopes*

The resources the key may use and how, when full_access is off. A resource that is not listed is none. The old scope field is gone.

expires_at?|
Formatdate-time
last_used_at?|
Formatdate-time
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X PATCH 'https://example.com/v1/api-keys/string' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
Example Response
{  "id": "string",  "name": "string",  "prefix": "string",  "full_access": true,  "scopes": {    "property1": "read",    "property2": "read"  },  "expires_at": "2019-08-24T14:15:22Z",  "last_used_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
DELETE
/v1/api-keys/{id}

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

id*string

Response Body

Revoked

Example Request
curl -X DELETE 'https://example.com/v1/api-keys/string'
Example Response
Empty