Skip to content

Add an integration key

POST
/v1/integrations
curl --request POST \
--url https://example.com/v1/integrations \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "provider": "huggingface", "name": "example", "secret": "example" }'

Add a Hugging Face token. The organization’s first one becomes the default. The answer never holds the token.

Needs integrations:write and Admin on the organization.

Media type application/json
IntegrationCreateRequest

Add an integration key. The secret is sent here once and never read back.

object
provider
required

Huggingface (a token new runs use)

string
Allowed value: huggingface
name
required

The token’s name

string
>= 1 characters <= 15 characters
secret
required

The token itself; it starts with “hf_”

string format: password

Successful Response

Media type application/json
Integration

One integration key, without its value.

object
id
required

The integration key’s ID

string format: uuid
provider
required

The service the key is for

string
Allowed value: huggingface
name
required

The key’s name

string
last4

The key’s last four characters; null for a key shorter than 12

string | null
is_default
required

The Hugging Face token new runs use

boolean
created_by
required

The person who added it

string format: uuid
created_at
required

When it was added

string format: date-time
expires_at
required

When it expires

string format: date-time
Example
{
"provider": "huggingface"
}

Invalid or missing API key

Media type application/json
ErrorResponse

Standard error response.

object
detail
required

Error message describing what went wrong

string
Example generated
{
"detail": "example"
}

Missing integrations:write or Admin

Media type application/json
ErrorResponse

Standard error response.

object
detail
required

Error message describing what went wrong

string
Example generated
{
"detail": "example"
}

Not found or access denied

Media type application/json
ErrorResponse

Standard error response.

object
detail
required

Error message describing what went wrong

string
Example generated
{
"detail": "example"
}

The body names a bad field

Media type application/json
ErrorResponse

Standard error response.

object
detail
required

Error message describing what went wrong

string
Example generated
{
"detail": "example"
}