Create an API key
POST
/v1/api-keysAuthorization
bearerAuthbearerAuthrequiredor
apiKeyAuthapiKeyAuthrequiredRequest body
requiredapplication/jsonexpires_atstring<date-time>Expiration time
namestringrequiredKey name
min length 1
scopesanyArray of scope strings
Responses
201Created
created_atstringrequiredcreated_bystringrequiredexpires_atstring | nullrequiredidstringrequiredis_activebooleanrequiredkey_prefixstringrequirednamestringrequiredraw_keystringrequiredscopesanyrequired400Bad Request
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstring401Unauthorized
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstring403Forbidden
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstring422Unprocessable Entity
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstring500Internal Server Error
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstringRequest
curl -X POST "/v1/api-keys" \
-H "Content-Type: application/json" \
-d '{
"expires_at": "2024-01-01T00:00:00Z",
"name": "string",
"scopes": "string"
}'const response = await fetch("/v1/api-keys", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"expires_at": "2024-01-01T00:00:00Z",
"name": "string",
"scopes": "string"
})
});import requests
response = requests.post(
"/v1/api-keys",
headers={
"Content-Type": "application/json"
},
json={
"expires_at": "2024-01-01T00:00:00Z",
"name": "string",
"scopes": "string"
},
)Response
{
"created_at": "string",
"created_by": "string",
"expires_at": "string",
"id": "string",
"is_active": true,
"key_prefix": "string",
"name": "string",
"raw_key": "string",
"scopes": "string"
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}