Skip to main content
POST
http://localhost:3000
/
resource-collections
curl -X POST 'https://api.example.com/resource-collections' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "scopeId": "scope_org",
    "resourceTypeId": "rtype_document",
    "name": "Finance Documents",
    "description": "All documents tagged with finance department",
    "matchDefinition": {
      "tags": {
        "department": "finance"
      }
    }
  }'
{
  "id": "collection_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
  "scopeId": "scope_org",
  "resourceTypeId": "rtype_document",
  "name": "Finance Documents",
  "description": "All documents tagged with finance department",
  "matchDefinition": {
    "tags": {
      "department": "finance"
    }
  },
  "createdAt": "2024-01-15T10:30:00Z"
}

Request Body

id
string
Optional client-provided ID. Format: collection_{uuidv7}
scopeId
string
required
ID of the scope where collection is defined
resourceTypeId
string
required
ID of the resource type for this collection
name
string
required
Display name for the collection
description
string
Description of what this collection represents
matchDefinition
object
required
Rules for matching resources to this collection

Match Definition

The matchDefinition object supports the following properties:
PropertyTypeDescription
fieldsobjectMatch by field values
tagsobjectMatch by tag assignments
patternsobjectMatch by glob patterns
timeobjectMatch by time-based rules
conditionobjectMatch by JSON Logic condition
anyarrayMatch if any definition matches (OR)
allarrayMatch if all definitions match (AND)
nonearrayExclude matching definitions (NOT)

Response

Returns the created resource collection object.
curl -X POST 'https://api.example.com/resource-collections' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "scopeId": "scope_org",
    "resourceTypeId": "rtype_document",
    "name": "Finance Documents",
    "description": "All documents tagged with finance department",
    "matchDefinition": {
      "tags": {
        "department": "finance"
      }
    }
  }'
{
  "id": "collection_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
  "scopeId": "scope_org",
  "resourceTypeId": "rtype_document",
  "name": "Finance Documents",
  "description": "All documents tagged with finance department",
  "matchDefinition": {
    "tags": {
      "department": "finance"
    }
  },
  "createdAt": "2024-01-15T10:30:00Z"
}