Skip to main content
POST
/
api
/
v2
/
tenants
/
{tenant}
/
databases
/
{database}
/
collections
/
{collection_id}
/
functions
/
attach
Attach a function to a collection
curl --request POST \
  --url https://api.trychroma.com/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/attach \
  --header 'Content-Type: application/json' \
  --header 'x-chroma-token: <api-key>' \
  --data '
{
  "function_id": "<string>",
  "name": "<string>",
  "output_collection": "<string>",
  "params": "<unknown>"
}
'
{
  "attached_function": {
    "function_name": "<string>",
    "id": "<string>",
    "name": "<string>"
  },
  "created": true
}

Authorizations

x-chroma-token
string
header
required

Path Parameters

tenant
string
required

Tenant ID

database
string
required

Database name

collection_id
string
required

Collection ID

Body

application/json
function_id
string
required
name
string
required
output_collection
string
required
params
any

Response

Function attached successfully

attached_function
object
required
created
boolean
required

True if newly created, false if already existed (idempotent request)