{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/yelp/json-schema/yelp-token-authorization-code-response-schema.json",
  "title": "Response when calling this endpoint using an authorization code.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/yelp-oauth-authorization-v2-api-openapi.yml#/components/schemas/TokenAuthorizationCodeResponse",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/TokenRefreshTokenResponse"
    },
    {
      "type": "object",
      "properties": {
        "refresh_token": {
          "$ref": "#/$defs/token",
          "description": "Refresh token that can be used to refresh the access token. Refresh tokens expire after 365 days."
        },
        "refresh_token_expires_in": {
          "description": "Seconds until refresh token expires.",
          "type": "integer"
        },
        "refresh_token_expires_on": {
          "description": "The expiration time of the refresh token in ISO8601 format.",
          "type": "string",
          "format": "date-time"
        },
        "scopes": {
          "description": "Space separated scope values for the scope the business owner authorized the partner's application for.",
          "type": "string"
        }
      },
      "required": [
        "refresh_token",
        "refresh_token_expires_in",
        "refresh_token_expires_on",
        "scopes"
      ]
    }
  ],
  "$defs": {
    "TokenRefreshTokenResponse": {
      "title": "Response when calling this endpoint using a refresh token.",
      "type": "object",
      "properties": {
        "access_token": {
          "$ref": "#/$defs/token",
          "description": "Token issued by the authorization server. Tokens will be valid for 7 days."
        },
        "expires_in": {
          "description": "Seconds until token expires.",
          "type": "integer"
        },
        "expires_on": {
          "description": "The expiration time of the access token in ISO8601 format.",
          "type": "string",
          "format": "date-time"
        },
        "token_type": {
          "description": "The type of token issued. Default to ‘Bearer’",
          "type": "string"
        }
      },
      "required": [
        "access_token",
        "expires_in",
        "expires_on",
        "token_type"
      ]
    },
    "token": {
      "type": "string",
      "maxLength": 128,
      "minLength": 128,
      "pattern": "[A-Za-z0-9+/=]+"
    }
  }
}