Skip to main content

What is a Resource Type?

A resource type defines a category of resources. Before creating resources, you define their types—like “Document”, “Project”, or “User”. Resource types are referenced in permissions to specify what kind of entity a permission applies to.

Resource Type Properties

PropertyTypeDescription
idstringUnique identifier
namestringHuman-readable name
keystringMachine-readable key (used in permissions)
scopeIdstringScope where this type is defined
createdAtstringCreation timestamp
createdBystringSubject who created it

Creating Resource Types

curl -X POST 'https://api.example.com/resource-types' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Document",
    "key": "document",
    "scopeId": "scope_acme"
  }'

Batch Creation

curl -X POST 'https://api.example.com/resource-types/batch' \
  -d '[
    {"name": "Document", "key": "document", "scopeId": "scope_acme"},
    {"name": "Folder", "key": "folder", "scopeId": "scope_acme"},
    {"name": "Project", "key": "project", "scopeId": "scope_acme"},
    {"name": "Task", "key": "task", "scopeId": "scope_acme"}
  ]'

Resource Type Keys

The key field is used in permission definitions:
# Permission references the resource type key
curl -X POST 'https://api.example.com/permissions' \
  -d '{
    "scopeId": "scope_acme",
    "action": "read",
    "resourceType": "document",  # Matches the key
    "resourcePattern": "*",
    "key": "document:read:*"
  }'
Use lowercase, singular keys: document not Documents, project not projects.

Resource Type Hierarchies

Resource types can form hierarchies to model inheritance relationships:
# Define that Documents can be children of Folders
curl -X POST 'https://api.example.com/resource-type-hierarchy' \
  -d '{
    "parentTypeId": "rtype_folder",
    "childTypeId": "rtype_document"
  }'
This enables:
  • Modeling containment (folders contain documents)
  • Permission inheritance (access to folder grants access to contents)
  • Hierarchical queries
Folder (resource type)
├── Document (resource type)
└── Folder (resource type - nested folders)

Scope Inheritance

Resource types defined at a parent scope are available in child scopes:
Organization (defines: document, project, user)

    ├── Team A ─── can use document, project, user

    └── Team B ─── can use document, project, user

Common Resource Type Patterns

Content Management

curl -X POST 'https://api.example.com/resource-types/batch' \
  -d '[
    {"name": "Workspace", "key": "workspace", "scopeId": "scope_org"},
    {"name": "Folder", "key": "folder", "scopeId": "scope_org"},
    {"name": "Document", "key": "document", "scopeId": "scope_org"},
    {"name": "Page", "key": "page", "scopeId": "scope_org"},
    {"name": "Comment", "key": "comment", "scopeId": "scope_org"},
    {"name": "Attachment", "key": "attachment", "scopeId": "scope_org"}
  ]'

Issue Tracking

curl -X POST 'https://api.example.com/resource-types/batch' \
  -d '[
    {"name": "Project", "key": "project", "scopeId": "scope_org"},
    {"name": "Epic", "key": "epic", "scopeId": "scope_org"},
    {"name": "Issue", "key": "issue", "scopeId": "scope_org"},
    {"name": "Sprint", "key": "sprint", "scopeId": "scope_org"},
    {"name": "Label", "key": "label", "scopeId": "scope_org"}
  ]'

HR System

curl -X POST 'https://api.example.com/resource-types/batch' \
  -d '[
    {"name": "Employee", "key": "employee", "scopeId": "scope_org"},
    {"name": "Department", "key": "department", "scopeId": "scope_org"},
    {"name": "Timesheet", "key": "timesheet", "scopeId": "scope_org"},
    {"name": "Leave Request", "key": "leave-request", "scopeId": "scope_org"},
    {"name": "Performance Review", "key": "performance-review", "scopeId": "scope_org"}
  ]'

Construction / Field Service

curl -X POST 'https://api.example.com/resource-types/batch' \
  -d '[
    {"name": "Job Site", "key": "jobsite", "scopeId": "scope_org"},
    {"name": "Work Order", "key": "work-order", "scopeId": "scope_org"},
    {"name": "Equipment", "key": "equipment", "scopeId": "scope_org"},
    {"name": "Safety Report", "key": "safety-report", "scopeId": "scope_org"},
    {"name": "Daily Log", "key": "daily-log", "scopeId": "scope_org"}
  ]'

Permissions by Resource Type

Create permissions for each resource type:
# CRUD permissions for documents
curl -X POST 'https://api.example.com/permissions/batch' \
  -d '[
    {"scopeId": "scope_org", "action": "create", "resourceType": "document", "resourcePattern": "*", "key": "document:create:*"},
    {"scopeId": "scope_org", "action": "read", "resourceType": "document", "resourcePattern": "*", "key": "document:read:*"},
    {"scopeId": "scope_org", "action": "update", "resourceType": "document", "resourcePattern": "*", "key": "document:update:*"},
    {"scopeId": "scope_org", "action": "delete", "resourceType": "document", "resourcePattern": "*", "key": "document:delete:*"}
  ]'

# CRUD permissions for projects
curl -X POST 'https://api.example.com/permissions/batch' \
  -d '[
    {"scopeId": "scope_org", "action": "create", "resourceType": "project", "resourcePattern": "*", "key": "project:create:*"},
    {"scopeId": "scope_org", "action": "read", "resourceType": "project", "resourcePattern": "*", "key": "project:read:*"},
    {"scopeId": "scope_org", "action": "update", "resourceType": "project", "resourcePattern": "*", "key": "project:update:*"},
    {"scopeId": "scope_org", "action": "delete", "resourceType": "project", "resourcePattern": "*", "key": "project:delete:*"}
  ]'

API Reference

Next Steps

Resource Hierarchies

Learn how to model parent-child resource relationships