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.
Permissions
application:create
Request
- cURL
- Terraform
curl "https://api.basistheory.com/applications/{id}/keys" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-H "Content-Type: application/json" \
-X "POST"
resource "basistheory_application_key" "my_application_key" {
application_id = basistheory_application.my_application.id
}
output "application_key" {
value = basistheory_application_key.my_application_key.key
description = "My application key"
sensitive = true
}
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.
Permissions
application:read
Request
- cURL
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.
Permissions
application:read
Request
- cURL
curl "https://api.basistheory.com/applications/{id}/keys/{keyId}" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>"
URI Parameters
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
id | true | uuid | null | The ID of the Application |
keyId | true | uuid | null | The 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.
Permissions
application:delete
Request
- cURL
curl "https://api.basistheory.com/applications/{id}/keys/{keyId}" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-X "DELETE"
URI Parameters
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
id | true | uuid | null | The ID of the application |
keyId | true | uuid | null | The ID of the Application Key |
Response
Returns an error if the application failed to delete.
Application Key Object
Attribute | Type | Description |
---|---|---|
id | uuid | Unique identifier of the Application Key which can be used to get an Application |
key | string | The API key use for authenticating. Only returned on Create Application Key. |
created_by | uuid | (Optional) The ID of the user or Application that created the Application |
created_at | date | (Optional) Created date of the Application in ISO 8601 format |