Provenance
Core Concepts

Resource Types

Define categories of resources being tracked.

Resource types define the categories of things you're tracking — users, orders, deployments, documents, or anything else in your system.

Creating a resource type

POST /api/resource-types
{
  "title": "User Account",
  "description": "User account resource",
  "mnemonic": "USER",
  "icon": "👤",
  "fontColorHex": "#ffffff",
  "bgColorHex": "#3b82f6"
}

Fields

FieldRequiredDescription
titleYesHuman-readable name
mnemonicYesShort uppercase code — used by CLI, SDK, and mnemonic-based API calls
descriptionNoWhat this resource type represents
iconNoEmoji or icon identifier for UI display
fontColorHexNoText color for UI badges
bgColorHexNoBackground color for UI badges

Response

{
  "resourceTypeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "title": "User Account",
  "description": "User account resource",
  "mnemonic": "USER",
  "icon": "👤",
  "fontColorHex": "#ffffff",
  "bgColorHex": "#3b82f6",
  "isSystem": false,
  "createdDate": "2024-01-15T10:00:00.000Z",
  "modifiedDate": "2024-01-15T10:00:00.000Z"
}

System resource types

Some resource types are marked isSystem: true. These are used internally by Provenance and cannot be updated or deleted.

Pagination

List endpoints support optional pagination:

# Without pagination — returns flat array
GET /api/resource-types

# With pagination — returns { data, pagination }
GET /api/resource-types?page=1&limit=20

Filtering

# Filter by mnemonic
GET /api/resource-types?mnemonic=USER

# Filter by title
GET /api/resource-types?title=User%20Account

API reference

MethodEndpointDescription
GET/api/resource-typesList all (supports page, limit, mnemonic, title params)
GET/api/resource-types/:idGet by ID
POST/api/resource-typesCreate
PUT/api/resource-types/:idUpdate
DELETE/api/resource-types/:idDelete (non-system only)

Design tips

  • Use nouns for resource types: USER, ORDER, DEPLOYMENT, DOCUMENT
  • Keep mnemonics short and uppercase — they're used in CLI commands and SDK calls
  • One resource type per domain entity — don't over-granularize
  • Use icon and color fields to make the UI dashboard visually scannable