{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-communication-services/json-schema/microsoft-azure-communication-services-communication-identity-access-token-request-schema.json",
  "title": "CommunicationIdentityAccessTokenRequest",
  "description": "Request to issue a new access token for an identity.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/microsoft-azure-communication-services-identity-api-openapi.yml#/components/schemas/CommunicationIdentityAccessTokenRequest",
  "type": "object",
  "properties": {
    "scopes": {
      "type": "array",
      "description": "List of scopes attached to the token.",
      "items": {
        "$ref": "#/$defs/CommunicationIdentityTokenScope"
      }
    },
    "expiresInMinutes": {
      "type": "integer",
      "format": "int32",
      "description": "Optional custom validity period of the token within [60,1440] minutes range. If not provided, the default value of 1440 minutes (24 hours) will be used.",
      "default": 1440,
      "minimum": 60,
      "maximum": 1440
    }
  },
  "required": [
    "scopes"
  ],
  "$defs": {
    "CommunicationIdentityTokenScope": {
      "type": "string",
      "description": "List of scopes for an access token.",
      "enum": [
        "chat",
        "voip",
        "chat.join",
        "chat.join.limited",
        "voip.join"
      ],
      "x-ms-enum": {
        "name": "CommunicationIdentityTokenScope",
        "modelAsString": true,
        "values": [
          {
            "name": "chat",
            "value": "chat",
            "description": "Use this for full access to Chat APIs."
          },
          {
            "name": "voip",
            "value": "voip",
            "description": "Use this for full access to Calling APIs."
          },
          {
            "name": "chatJoin",
            "value": "chat.join",
            "description": "Access to Chat APIs but without the authorization to create, delete or update chat threads."
          },
          {
            "name": "chatJoinLimited",
            "value": "chat.join.limited",
            "description": "A more limited version of chat.join that doesn't allow to add or remove participants. Use this scope when the token bearer is not fully trusted, for example in guest scenarios."
          },
          {
            "name": "voipJoin",
            "value": "voip.join",
            "description": "Access to Calling APIs but without the authorization to start new calls."
          }
        ]
      }
    }
  }
}