Add an integration key
const url = 'https://example.com/v1/integrations';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"provider":"huggingface","name":"example","secret":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Add an integration key. The secret is sent here once and never read back.
object
Huggingface (a token new runs use)
The token’s name
The token itself; it starts with “hf_”
Responses
Section titled “ Responses ”Successful Response
One integration key, without its value.
object
The integration key’s ID
The service the key is for
The key’s name
The key’s last four characters; null for a key shorter than 12
The Hugging Face token new runs use
The person who added it
When it was added
When it expires
Example
{ "provider": "huggingface"}Invalid or missing API key
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}Missing integrations:write or Admin
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}Not found or access denied
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}The body names a bad field
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}