Skip to main content

Application Keys

Application Keys serve as the authentication mechanism for requests made to the Basis Theory API. Each Application Key is linked to a specific Application, deriving its access level from the corresponding Application. This access level determines the permissions granted to the key for interacting with the API. As such, it's crucial to configure the access level of each Application Key appropriately, aligning it with the desired level of access for the associated Application.

Create Application Key

Create a new Application Key for the Application.

POST
https://api.basistheory.com/applications/{id}/keys
Copy

Permissions

application:create

Request

curl "https://api.basistheory.com/applications/{id}/keys" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-H "Content-Type: application/json" \
-X "POST"

Response

Returns an Application Key if the application key was created. Returns an error if there were validation errors, or the application failed to create.

{
"id": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"key": "key_....",
"created_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"created_at": "2020-09-15T15:53:00+00:00"
}

List Application Keys

Get a list of Application Keys for the Application.

GET
https://api.basistheory.com/applications/{id}/keys
Copy

Permissions

application:read

Request

curl "https://api.basistheory.com/applications/:id/keys" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>"

Response

Returns a paginated object with the data property containing an array of application keys. Returns an error if applications could not be retrieved.

{
"pagination": {...}
"data": [
{
"id": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"created_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"created_at": "2020-09-15T15:53:00+00:00"
},
{...},
{...}
]
}

Get an Application Key

Get an Application Key by ID in the Tenant.

GET
https://api.basistheory.com/applications/{id}/keys/{keyId}
Copy

Permissions

application:read

Request

curl "https://api.basistheory.com/applications/{id}/keys/{keyId}" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>"

URI Parameters

ParameterRequiredTypeDefaultDescription
idtrueuuidnullThe ID of the Application
keyIdtrueuuidnullThe ID of the Application Key

Response

Returns an Application Key. Returns an error if the application could not be retrieved.

{
"id": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"created_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"created_at": "2020-09-15T15:53:00+00:00"
}

Delete Application Key

Delete an Application Key by ID for the Application.

DELETE
https://api.basistheory.com/applications/{id}/keys/{keyId}
Copy

Permissions

application:delete

Request

curl "https://api.basistheory.com/applications/{id}/keys/{keyId}" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-X "DELETE"

URI Parameters

ParameterRequiredTypeDefaultDescription
idtrueuuidnullThe ID of the application
keyIdtrueuuidnullThe ID of the Application Key

Response

Returns an error if the application failed to delete.

Application Key Object

AttributeTypeDescription
iduuidUnique identifier of the Application Key which can be used to get an Application
keystringThe API key use for authenticating. Only returned on Create Application Key.
created_byuuid(Optional) The ID of the user or Application that created the Application
created_atdate(Optional) Created date of the Application in ISO 8601 format