WorkOS · Schema

CreateUserApiKeyDto

AuthenticationIdentity ProviderSSOSAMLOIDCSCIMDirectory SyncAuthorizationFGAAudit LogsMFAB2B SaaSAgentsMCP

Properties

Name Type Description
name string A descriptive name for the API key.
organization_id string The ID of the organization the user API key is associated with. The user must have an active membership in this organization.
permissions array The permission slugs to assign to the API key. Each permission must be enabled for user API keys.
View JSON Schema on GitHub

JSON Schema

workos-createuserapikeydto-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/CreateUserApiKeyDto",
  "title": "CreateUserApiKeyDto",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "A descriptive name for the API key.",
      "example": "Production API Key"
    },
    "organization_id": {
      "type": "string",
      "description": "The ID of the organization the user API key is associated with. The user must have an active membership in this organization.",
      "example": "org_01EHZNVPK3SFK441A1RGBFSHRT"
    },
    "permissions": {
      "description": "The permission slugs to assign to the API key. Each permission must be enabled for user API keys.",
      "example": [
        "posts:read",
        "posts:write"
      ],
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "name",
    "organization_id"
  ]
}