Skip to main content
POST
http://localhost:3000
/
resource-types
/
batch
curl -X POST 'https://api.example.com/resource-types/batch' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '[
    {
      "id": "resource_type_document",
      "name": "Document",
      "key": "document",
      "scopeId": "scope_acme"
    },
    {
      "id": "resource_type_folder",
      "name": "Folder",
      "key": "folder",
      "scopeId": "scope_acme"
    }
  ]'
[
  {
    "id": "resource_type_document",
    "name": "Document",
    "key": "document",
    "scopeId": "scope_acme",
    "createdAt": "2024-01-15T10:30:00Z",
    "createdBy": "system"
  },
  {
    "id": "resource_type_folder",
    "name": "Folder",
    "key": "folder",
    "scopeId": "scope_acme",
    "createdAt": "2024-01-15T10:30:00Z",
    "createdBy": "system"
  }
]

Overview

Batch creation allows you to create multiple resource types in a single API call.
ID Format: All IDs use a namespaced UUIDv7 format: resource_type_{uuidv7}.

Request Body

Array of resource type objects:
[].id
string
Optional client-provided ID
[].name
string
required
Display name for the resource type
[].key
string
required
Unique key for the resource type within the scope
[].scopeId
string
required
ID of the scope where this resource type is defined

Response

Returns an array of created resource type objects.
curl -X POST 'https://api.example.com/resource-types/batch' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '[
    {
      "id": "resource_type_document",
      "name": "Document",
      "key": "document",
      "scopeId": "scope_acme"
    },
    {
      "id": "resource_type_folder",
      "name": "Folder",
      "key": "folder",
      "scopeId": "scope_acme"
    }
  ]'
[
  {
    "id": "resource_type_document",
    "name": "Document",
    "key": "document",
    "scopeId": "scope_acme",
    "createdAt": "2024-01-15T10:30:00Z",
    "createdBy": "system"
  },
  {
    "id": "resource_type_folder",
    "name": "Folder",
    "key": "folder",
    "scopeId": "scope_acme",
    "createdAt": "2024-01-15T10:30:00Z",
    "createdBy": "system"
  }
]