Project API keys
Create a project API key
POST
/
v1
/
organization
/
projects
/
{project_id}
/
api_keys
Create a project API key
curl --request POST \
--url https://api.abliteration.ai/v1/organization/projects/{project_id}/api_keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"permissions": [
"<string>"
]
}
'import requests
url = "https://api.abliteration.ai/v1/organization/projects/{project_id}/api_keys"
payload = {
"name": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"permissions": ["<string>"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
expires_at: '2023-11-07T05:31:56Z',
permissions: ['<string>']
})
};
fetch('https://api.abliteration.ai/v1/organization/projects/{project_id}/api_keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"redacted_value": "<string>",
"name": "<string>",
"created_at": 123,
"id": "<string>",
"owner": {
"id": "<string>",
"name": "<string>",
"type": "project"
},
"status": "active",
"permissions": [
"<string>"
],
"value": "<string>",
"object": "organization.project.api_key",
"last_used_at": 123,
"expires_at": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}Authorizations
Organization Admin API key or OAuth access token.
Headers
Client-generated key used to safely retry this mutation.
Required string length:
8 - 200Path Parameters
Public project ID.
Required string length:
1 - 200Body
application/json
Response
Successful Response
Safe masked key preview.
Show child attributes
Show child attributes
Available options:
active, revoked, expired, suspended Full API key value. Returned on creation or an exact idempotent replay within 24 hours.
Allowed value:
"organization.project.api_key"⌘I
Create a project API key
curl --request POST \
--url https://api.abliteration.ai/v1/organization/projects/{project_id}/api_keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"permissions": [
"<string>"
]
}
'import requests
url = "https://api.abliteration.ai/v1/organization/projects/{project_id}/api_keys"
payload = {
"name": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"permissions": ["<string>"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
expires_at: '2023-11-07T05:31:56Z',
permissions: ['<string>']
})
};
fetch('https://api.abliteration.ai/v1/organization/projects/{project_id}/api_keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"redacted_value": "<string>",
"name": "<string>",
"created_at": 123,
"id": "<string>",
"owner": {
"id": "<string>",
"name": "<string>",
"type": "project"
},
"status": "active",
"permissions": [
"<string>"
],
"value": "<string>",
"object": "organization.project.api_key",
"last_used_at": 123,
"expires_at": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}