API Keys

List API Keys

List API keys for an application.

GEThttps://api.passage.id/v1/apps/{app_id}/api-keys
Authorization
Response

OK

Body
api_keys*array of ApiKey (object)
Request
const response = await fetch('https://api.passage.id/v1/apps/{app_id}/api-keys', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer JWT"
    },
});
const data = await response.json();
Response
{
  "api_keys": [
    {
      "created_at": "2024-05-20T01:36:05.775Z",
      "id": "text",
      "key_prefix": "text",
      "name": "text",
      "role": "admin"
    }
  ]
}

Create API Key

Create a new API key.

POSThttps://api.passage.id/v1/apps/{app_id}/api-keys
Authorization
Path parameters
app_id*string

App ID

Body

name

name*string
Response

Created

Body
api_key*CreatedApiKey (all of)
Request
const response = await fetch('https://api.passage.id/v1/apps/{app_id}/api-keys', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer JWT",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "name": "text"
    }),
});
const data = await response.json();
Response
{
  "api_key": {
    "created_at": "2024-05-20T01:36:05.775Z",
    "id": "text",
    "key_prefix": "text",
    "name": "text",
    "role": "admin",
    "plaintext_key": "text"
  }
}

Get API Key

Get information about an API key.

GEThttps://api.passage.id/v1/apps/{app_id}/api-keys/{api_key_id}
Authorization
Path parameters
app_id*string

App ID

api_key_id*string

API key ID

Response

OK

Body
api_key*ApiKey (object)
Request
const response = await fetch('https://api.passage.id/v1/apps/{app_id}/api-keys/{api_key_id}', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer JWT"
    },
});
const data = await response.json();
Response
{
  "api_key": {
    "created_at": "2024-05-20T01:36:05.775Z",
    "id": "text",
    "key_prefix": "text",
    "name": "text",
    "role": "admin"
  }
}

Delete API Key

Delete an API key.

DELETEhttps://api.passage.id/v1/apps/{app_id}/api-keys/{api_key_id}
Authorization
Path parameters
app_id*string

App ID

api_key_id*string

API key ID

Response

OK

Request
const response = await fetch('https://api.passage.id/v1/apps/{app_id}/api-keys/{api_key_id}', {
    method: 'DELETE',
    headers: {
      "Authorization": "Bearer JWT"
    },
});
const data = await response.json();

Update API Key

Update an API key.

PATCHhttps://api.passage.id/v1/apps/{app_id}/api-keys/{api_key_id}
Authorization
Path parameters
app_id*string

App ID

api_key_id*string

API key ID

Body

name

name*string
Response

OK

Body
api_key*ApiKey (object)
Request
const response = await fetch('https://api.passage.id/v1/apps/{app_id}/api-keys/{api_key_id}', {
    method: 'PATCH',
    headers: {
      "Authorization": "Bearer JWT",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "name": "text"
    }),
});
const data = await response.json();
Response
{
  "api_key": {
    "created_at": "2024-05-20T01:36:05.775Z",
    "id": "text",
    "key_prefix": "text",
    "name": "text",
    "role": "admin"
  }
}

Last updated

Change request #337: react native