Skip to main content
POST
http://localhost:3000
/
resource-types
curl -X POST 'https://api.example.com/resource-types' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Document",
    "key": "document",
    "scopeId": "scope_acme"
  }'
{
  "id": "resource_type_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
  "name": "Document",
  "key": "document",
  "scopeId": "scope_acme",
  "createdAt": "2024-01-15T10:30:00Z",
  "createdBy": "system"
}

Request Body

id
string
Optional client-provided ID. Format: resource_type_{uuidv7}
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 the created resource type object.
curl -X POST 'https://api.example.com/resource-types' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Document",
    "key": "document",
    "scopeId": "scope_acme"
  }'
{
  "id": "resource_type_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
  "name": "Document",
  "key": "document",
  "scopeId": "scope_acme",
  "createdAt": "2024-01-15T10:30:00Z",
  "createdBy": "system"
}