WorkOS · Schema

Role

AuthenticationIdentity ProviderSSOSAMLOIDCSCIMDirectory SyncAuthorizationFGAAudit LogsMFAB2B SaaSAgentsMCP

Properties

Name Type Description
slug string A unique slug for the role.
object string Distinguishes the role object.
id string Unique identifier of the role.
name string A descriptive name for the role.
description stringnull An optional description of the role.
type string Whether the role is scoped to the environment or an organization (custom role).
resource_type_slug string The slug of the resource type the role is scoped to.
permissions array The permission slugs assigned to the role.
created_at string An ISO 8601 timestamp.
updated_at string An ISO 8601 timestamp.
View JSON Schema on GitHub

JSON Schema

workos-role-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/Role",
  "title": "Role",
  "type": "object",
  "properties": {
    "slug": {
      "type": "string",
      "description": "A unique slug for the role.",
      "example": "admin"
    },
    "object": {
      "type": "string",
      "description": "Distinguishes the role object.",
      "example": "role",
      "const": "role"
    },
    "id": {
      "type": "string",
      "description": "Unique identifier of the role.",
      "example": "role_01EHQMYV6MBK39QC5PZXHY59C3"
    },
    "name": {
      "type": "string",
      "description": "A descriptive name for the role.",
      "example": "Admin"
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "An optional description of the role.",
      "example": "Can manage all resources"
    },
    "type": {
      "type": "string",
      "enum": [
        "EnvironmentRole",
        "OrganizationRole"
      ],
      "description": "Whether the role is scoped to the environment or an organization (custom role).",
      "example": "EnvironmentRole"
    },
    "resource_type_slug": {
      "type": "string",
      "description": "The slug of the resource type the role is scoped to.",
      "example": "organization"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The permission slugs assigned to the role.",
      "example": [
        "posts:read",
        "posts:write"
      ]
    },
    "created_at": {
      "format": "date-time",
      "type": "string",
      "description": "An ISO 8601 timestamp.",
      "example": "2026-01-15T12:00:00.000Z"
    },
    "updated_at": {
      "format": "date-time",
      "type": "string",
      "description": "An ISO 8601 timestamp.",
      "example": "2026-01-15T12:00:00.000Z"
    }
  },
  "required": [
    "slug",
    "object",
    "id",
    "name",
    "description",
    "type",
    "resource_type_slug",
    "permissions",
    "created_at",
    "updated_at"
  ]
}