Collections

Add resources to a collection

POST/collections/{ref}/resources

Adds up to 100 resources per call. Requires the write scope and modify access to the collection (owner, or the collection allows changes).

Each ref is validated for visibility to the api-key's linked user before adding; the response reports a per-ref status:

  • added — newly added to the collection.
  • already_present — was already in the collection (no-op).
  • not_found — the resource doesn't exist or isn't visible to the linked user (not distinguished).

Adding is naturally idempotent: retrying the same request reports the previously added refs as already_present.

X-Api-Key<token>

Issued to you when your integration is provisioned. Determines which catalogue resources are visible and which AI tools are available.

In: header

Path Parameters

ref*integer

Collection id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/collections/0/resources" \  -H "Content-Type: application/json" \  -d '{    "resourceRefs": [      101,      102,      103    ]  }'
{  "success": true,  "status": "success",  "message": "Resources processed",  "data": {    "collectionRef": 55,    "results": [      {        "ref": 101,        "status": "added"      },      {        "ref": 102,        "status": "added"      },      {        "ref": 103,        "status": "not_found"      }    ],    "addedCount": 2,    "alreadyPresentCount": 0,    "notFoundCount": 1  }}
{  "success": false,  "status": "fail",  "message": "string",  "error": {    "message": "API key is required",    "code": "NO_API_KEY"  }}

{  "success": false,  "status": "fail",  "message": "API key is required",  "error": {    "code": "NO_API_KEY",    "message": "API key is required"  }}

{  "success": false,  "status": "fail",  "message": "This API key does not have the 'write' scope",  "error": {    "code": "INSUFFICIENT_SCOPE",    "message": "This API key does not have the 'write' scope"  }}

{  "success": false,  "status": "fail",  "message": "string",  "error": {    "message": "API key is required",    "code": "NO_API_KEY"  }}