API Keys
Get all API keys registered to the user
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200
Successful Response
application/json
read_onlybooleanRequired
fidstringRequiredExample:
apikey_abc123456namestringRequired
created_atstring · datetimeRequiredExample:
2024-01-01T00:00:00Zexpires_atstring · datetimeRequiredExample:
2024-01-01T00:00:00Zdeactivated_atstring · datetime · nullableOptionalExample:
2024-01-01T00:00:00ZsnippetstringRequiredExample:
fkey_abc1...401
Invalid credentials
get/v2/api-keys
GET /v2/api-keys HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
{
"read_only": true,
"fid": "apikey_abc123456",
"name": "text",
"created_at": "2024-01-01T00:00:00Z",
"expires_at": "2024-01-01T00:00:00Z",
"deactivated_at": "2024-01-01T00:00:00Z",
"snippet": "fkey_abc1..."
}
]Create a new API key
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
namestringRequired
expires_atstring · datetimeRequiredExample:
2024-01-01T00:00:00Zread_onlybooleanOptionalDefault:
falseResponses
201
Successful Response
application/json
read_onlybooleanRequired
fidstringRequiredExample:
apikey_abc123456namestringRequired
created_atstring · datetimeRequiredExample:
2024-01-01T00:00:00Zexpires_atstring · datetimeRequiredExample:
2024-01-01T00:00:00Zdeactivated_atstring · datetime · nullableOptionalExample:
2024-01-01T00:00:00ZsnippetstringRequiredExample:
fkey_abc1...secretstringRequiredExample:
fkey_abc123456400
Invalid request parameters
401
Invalid credentials
422
Validation Error
application/json
post/v2/api-keys
POST /v2/api-keys HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 69
{
"name": "text",
"expires_at": "2024-01-01T00:00:00Z",
"read_only": false
}{
"read_only": true,
"fid": "apikey_abc123456",
"name": "text",
"created_at": "2024-01-01T00:00:00Z",
"expires_at": "2024-01-01T00:00:00Z",
"deactivated_at": "2024-01-01T00:00:00Z",
"snippet": "fkey_abc1...",
"secret": "fkey_abc123456"
}Revoke an API key
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
key_fidstringRequiredExample:
apikey_abc123456Responses
204
Successful Response
No content
400
Invalid request
401
Invalid credentials
404
API key not found
422
Validation Error
application/json
delete/v2/api-keys/{key_fid}
DELETE /v2/api-keys/{key_fid} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Last updated