

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Player Authentication Client API",
    "version": "1.0.1",
    "contact": {
      "name": "Player auth",
      "url": "https://discussions.unity.com/tag/authentication"
    },
    "description": "# Introduction\nSign players in to Unity Authentication, refresh their sessions, and manage their sign-in methods. The ID token returned on sign-in is the player's credential for most other Unity Gaming Services APIs.\n\n## Rate Limits\nThe API has rate limiting in place. Most endpoints are limited to 15 requests per second and 600 requests per hour on a per-IP basis, shared across those endpoints. Exceptions are noted on the affected endpoints.\nThe API responds with a `429` HTTP status code if a rate limit is exceeded, and a `Retry-After` header with the number of seconds until requests are accepted again.\n"
  },
  "servers": [
    {
      "url": "https://player-auth.services.api.unity.com/v1"
    }
  ],
  "paths": {
    "/authentication/anonymous": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/UnityEnvironment"
        }
      ],
      "post": {
        "operationId": "SignUpAnonymously",
        "summary": "Anonymous Sign Up",
        "description": "Sign-up a new anonymous player.",
        "tags": [
          "Player Authentication"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignUpAnonymouslyRequest"
              }
            }
          },
          "description": "Anonymous Sign Up request body",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationResponse"
                }
              }
            },
            "description": "A successful response."
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/authentication/session-token": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/UnityEnvironment"
        }
      ],
      "post": {
        "operationId": "SignInWithSessionToken",
        "summary": "Session Token Sign In",
        "description": "Authenticate players using the session token. Store the session token in a persistent storage in the app or on device.\n\nSet `singleUse`, `audiences` or `ttlSeconds` to receive a new, restricted child session token instead, for handing to a less-trusted context such as a browser. The presented token stays valid unless it is single-use. Restrictions on the child session token are inherited by every later refresh and never loosened, except by an Origin policy (see `narrowOnly`).\n",
        "tags": [
          "Player Authentication"
        ],
        "requestBody": {
          "description": "Session Token Authentication request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignInWithSessionTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/authentication/external-token/{idProvider}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/idProvider"
        },
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/UnityEnvironment"
        }
      ],
      "post": {
        "operationId": "SignInWithExternalToken",
        "summary": "External Token Sign In",
        "description": "Authenticate players using external token. The external tokens are from login providers, such as Facebook.",
        "tags": [
          "Player Authentication"
        ],
        "requestBody": {
          "description": "External Token Authentication request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignInWithExternalTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationResponse"
                }
              }
            },
            "description": "A successful response."
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/authentication/link/{idProvider}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/idProvider"
        },
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/BearerAuth"
        }
      ],
      "post": {
        "operationId": "LinkExternalId",
        "summary": "Link External Id",
        "description": "Link an external ID to a Unity Authentication player.",
        "tags": [
          "Player Authentication"
        ],
        "security": [
          {
            "Client": []
          }
        ],
        "requestBody": {
          "description": "Link External Id request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkExternalIdRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkExternalIdResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/authentication/unlink/{idProvider}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/idProvider"
        },
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/BearerAuth"
        }
      ],
      "post": {
        "operationId": "UnlinkExternalId",
        "summary": "Unlink External Id",
        "description": "Unlink an external ID from a Unity Authentication player.",
        "tags": [
          "Player Authentication"
        ],
        "security": [
          {
            "Client": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnlinkExternalIdRequest"
              }
            }
          },
          "description": "Unlink external Id request body",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnlinkExternalIdResponse"
                }
              }
            },
            "description": "A successful response."
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/users/{PlayerId}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/PlayerId"
        },
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/BearerAuth"
        }
      ],
      "get": {
        "operationId": "GetPlayer",
        "summary": "Get Player",
        "description": "Get the information for a player.",
        "tags": [
          "Player Authentication"
        ],
        "security": [
          {
            "Client": []
          },
          {
            "ServiceAccount": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlayerResponse"
                }
              }
            },
            "description": "A successful response."
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "DeletePlayer",
        "summary": "Delete Player",
        "description": "Delete the player.",
        "tags": [
          "Player Authentication"
        ],
        "security": [
          {
            "Client": []
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response."
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/authentication/usernamepassword/sign-in": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/UnityEnvironment"
        }
      ],
      "post": {
        "operationId": "SignInWithUsernamePassword",
        "summary": "Username Password Sign In",
        "description": "Sign in using the Username Password IdProvider. Store the session token in a persistent storage in the app or on device.",
        "tags": [
          "Player Authentication"
        ],
        "security": [
          {
            "Client": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsernamePasswordRequest"
              }
            }
          },
          "description": "The Username and Password of the player.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationResponse"
                }
              }
            },
            "description": "A successful response."
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/authentication/usernamepassword/sign-up": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/UnityEnvironment"
        },
        {
          "name": "Authorization",
          "description": "This is the bearer token for the user authorized to call this API. When this is provided, a user associated with the bearer token is used instead of creating a new user.",
          "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
          "in": "header",
          "required": false,
          "allowEmptyValue": false,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "operationId": "SignUpWithUsernamePassword",
        "summary": "Username Password Sign Up",
        "description": "Create a new player for the Username Password IdProvider. Store the session token in a persistent storage in the app or on device.",
        "tags": [
          "Player Authentication"
        ],
        "security": [
          {
            "Client": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsernamePasswordRequest"
              }
            }
          },
          "description": "The Username and Password of the player.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationResponse"
                }
              }
            },
            "description": "A successful response."
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/authentication/usernamepassword/update-password": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/BearerAuth"
        }
      ],
      "post": {
        "operationId": "UsernamePasswordUpdatePassword",
        "summary": "Username Password Update Password",
        "description": "Update the password of a player using the Username Password IdProvider. Store the session token in a persistent storage in the app or on device. This endpoint is limited to 30 requests per minute per IP address instead of 15 per second. The shared 600 requests per hour limit still applies.",
        "tags": [
          "Player Authentication"
        ],
        "security": [
          {
            "Client": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsernamePasswordPasswordUpdateRequest"
              }
            }
          },
          "description": "The Username, current Password and new Password of the player.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationResponse"
                }
              }
            },
            "description": "A successful response."
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/authentication/code-link/generate": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/UnityEnvironment"
        }
      ],
      "post": {
        "operationId": "GenerateCode",
        "summary": "Generate Code",
        "description": "Generates a sign in code for an unauthenticated device. This endpoint is limited to 30 requests per minute per IP address instead of 15 per second. The shared 600 requests per hour limit still applies.",
        "tags": [
          "Player Authentication"
        ],
        "requestBody": {
          "description": "Generate Code Request Body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateCodeRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateCodeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/authentication/code-link/info": {
      "post": {
        "operationId": "GetCodeInfo",
        "summary": "Get Code Info",
        "description": "Get code information including the identifier and expiration. This endpoint is limited to 30 requests per minute per IP address instead of 15 per second. The shared 600 requests per hour limit still applies.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/UnityEnvironment"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CodeLinkInfoRequest"
              }
            }
          },
          "description": "Code Link Request for Sign In",
          "required": true
        },
        "tags": [
          "Player Authentication"
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodeLinkInfoResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/authentication/code-link/sign-in/{CodeLinkSessionId}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/UnityEnvironment"
        },
        {
          "$ref": "#/components/parameters/CodeLinkSessionId"
        }
      ],
      "post": {
        "operationId": "SignInWithCode",
        "summary": "Sign In With Code",
        "description": "Tries to sign in a user with code. In the case this returns 200 and an empty response, poll at regular intervals, 2-5s to avoid being rate limited, until you receive a different response. This endpoint is limited to 30 requests per minute per IP address instead of 15 per second. The shared 600 requests per hour limit still applies.",
        "tags": [
          "Player Authentication"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignInWithCodeRequest"
              }
            }
          },
          "description": "Code Link Request for Sign In",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationResponse"
                }
              }
            },
            "description": "A successful response."
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/authentication/code-link/confirm": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/UnityEnvironment"
        },
        {
          "$ref": "#/components/parameters/BearerAuth"
        }
      ],
      "post": {
        "operationId": "CodeConfirmation",
        "summary": "Code Confirmation",
        "description": "Confirm a sign-in code, so the device that generated it signs in as this player. This endpoint is limited to 30 requests per minute per IP address instead of 15 per second. The shared 600 requests per hour limit still applies.",
        "tags": [
          "Player Authentication"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CodeLinkConfirmationRequest"
              }
            }
          },
          "description": "Code confirmation request.",
          "required": false
        },
        "responses": {
          "200": {
            "description": "A successful response."
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/projects/{ProjectId}/authentication/server/custom-id": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectIdPath"
        },
        {
          "$ref": "#/components/parameters/UnityEnvironment"
        }
      ],
      "post": {
        "summary": "Custom ID Sign In",
        "description": "Sign In using a Custom ID.\n\nSet `sessionTokenRestrictions` to mint a restricted session token directly, rather than narrowing an unrestricted one with a session-token refresh.\n",
        "operationId": "SignInWithCustomID",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomIDRequest"
              }
            }
          },
          "description": "Custom ID Request for Sign In",
          "required": true
        },
        "security": [
          {
            "Admin": [
              "player_auth.server.custom_id_auth"
            ]
          }
        ],
        "tags": [
          "Player Authentication"
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationResponse"
                }
              }
            },
            "description": "A successful response."
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    },
    "/users/{PlayerId}/notifications": {
      "parameters": [
        {
          "$ref": "#/components/parameters/BearerAuth"
        },
        {
          "$ref": "#/components/parameters/PlayerId"
        },
        {
          "$ref": "#/components/parameters/ProjectId"
        }
      ],
      "get": {
        "operationId": "ReadNotifications",
        "summary": "Read Notification",
        "description": "Gets a player's notifications to be displayed by the client.",
        "tags": [
          "Player Authentication"
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadNotificationsResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "UnityEnvironment": {
        "name": "UnityEnvironment",
        "in": "header",
        "schema": {
          "type": "string",
          "nullable": true
        },
        "required": false,
        "allowEmptyValue": true,
        "description": "This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input.\n",
        "example": "production"
      },
      "ProjectId": {
        "name": "ProjectId",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "required": true,
        "allowEmptyValue": false,
        "description": "This is the Unity Project Id. It is a uuid format.\n",
        "example": "8bdacc33-6eef-4577-beb0-633c86259f5b"
      },
      "BearerAuth": {
        "name": "Authorization",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "required": false,
        "allowEmptyValue": false,
        "description": "This is the bearer token for the user authorized to call this API.\n",
        "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
      },
      "idProvider": {
        "name": "idProvider",
        "in": "path",
        "schema": {
          "type": "string"
        },
        "required": true,
        "allowEmptyValue": false,
        "description": "This is the id provider type.\n",
        "example": "identity-provider-name"
      },
      "PlayerId": {
        "name": "PlayerId",
        "in": "path",
        "schema": {
          "type": "string"
        },
        "required": true,
        "allowEmptyValue": false,
        "description": "This is the player id.\n",
        "example": "99i9ju8juh"
      },
      "CodeLinkSessionId": {
        "name": "CodeLinkSessionId",
        "in": "path",
        "schema": {
          "type": "string"
        },
        "required": true,
        "description": "An identifier for the device requesting the code sign in."
      },
      "ProjectIdPath": {
        "name": "ProjectId",
        "in": "path",
        "schema": {
          "type": "string"
        },
        "required": true,
        "description": "This is the Unity Project Id. It is a uuid format."
      }
    },
    "schemas": {
      "SignUpAnonymouslyRequest": {
        "title": "SignUpAnonymouslyRequest",
        "description": "the request body for anonymous signup",
        "type": "object",
        "properties": {
          "nonce": {
            "description": "String value used to associate a client session with an Id Token, and to mitigate replay attacks. If this field is provided, the nonce claim in response id token has a matching value.",
            "type": "string",
            "example": "9i09urd6ffg"
          }
        }
      },
      "AuthenticationResponse": {
        "title": "AuthenticationResponse",
        "description": "Response for an authentication request.",
        "type": "object",
        "required": [
          "expiresIn",
          "idToken",
          "userId",
          "user"
        ],
        "properties": {
          "expiresIn": {
            "description": "The number of seconds in which the Id token expires. By default it's 3600.",
            "format": "int32",
            "type": "integer",
            "example": 3600
          },
          "idToken": {
            "description": "The Id token of the authenticated player.",
            "type": "string",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
          },
          "sessionToken": {
            "description": "The session token of the authenticated player. This token can be used to sign-in the player again.",
            "type": "string",
            "example": "5eb26a338a232"
          },
          "lastNotificationDate": {
            "description": "When the player received last notification in unix timestamp.",
            "type": "string",
            "example": "123000000"
          },
          "user": {
            "$ref": "#/components/schemas/Player"
          },
          "userId": {
            "description": "The Id of the authenticated player. If a project is specified in the request, this field represents the Id of the project scoped player.",
            "type": "string",
            "example": "5eb26a338a232"
          }
        }
      },
      "LinkExternalIdResponse": {
        "title": "LinkExternalIdResponse",
        "description": "response for a link request",
        "type": "object",
        "required": [
          "user",
          "userId"
        ],
        "properties": {
          "user": {
            "$ref": "#/components/schemas/Player"
          },
          "userId": {
            "description": "The Id of the authenticated player. If a project is specified in the request, this field represents the Id of the project scoped player.",
            "type": "string",
            "example": "5eb26a338a232"
          }
        }
      },
      "UnlinkExternalIdResponse": {
        "title": "UnlinkExternalIdResponse",
        "description": "Response for an unlink request.",
        "type": "object",
        "required": [
          "user",
          "userId"
        ],
        "properties": {
          "user": {
            "$ref": "#/components/schemas/Player"
          },
          "userId": {
            "description": "The Id of the authenticated player. If a project is specified in the request, this field represents the Id of the project scoped player.",
            "type": "string",
            "example": "5eb26a338a232"
          }
        }
      },
      "ExternalId": {
        "title": "ExternalId",
        "description": "Represents a Player provided by an External Provider.",
        "type": "object",
        "required": [
          "externalId",
          "providerId"
        ],
        "properties": {
          "externalId": {
            "description": "The Id of the player from the external provider.",
            "type": "string",
            "example": "5eb26a338a232"
          },
          "providerId": {
            "description": "The provider Id within the Id domain that provided the link.",
            "type": "string",
            "example": "provider-id"
          }
        }
      },
      "SignInWithExternalTokenRequest": {
        "title": "SignInWithExternalTokenRequest",
        "description": "the request body for external token authentication",
        "type": "object",
        "required": [
          "token"
        ],
        "properties": {
          "nonce": {
            "description": "String value used to associate a client session with an Id token, and to mitigate replay attacks. If this field is provided, the nonce claim in response Id token has a matching value.",
            "type": "string",
            "example": "5eb26a338a232"
          },
          "signInOnly": {
            "description": "Whether the API should only attempt to sign-in and do not create a new player if the player does not exist.",
            "type": "boolean",
            "example": false
          },
          "token": {
            "description": "External token that can be verified to represent a player from the id provider. This may be an id token or an access token.",
            "type": "string",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX"
          },
          "oculusConfig": {
            "$ref": "#/components/schemas/OculusConfig"
          },
          "appleGameCenterConfig": {
            "$ref": "#/components/schemas/AppleGameCenterConfig"
          },
          "steamConfig": {
            "$ref": "#/components/schemas/SteamConfig"
          }
        }
      },
      "OculusConfig": {
        "title": "OculusConfig",
        "description": "The request body for Oculus authentication. This field is not applicable for any other Id provider.",
        "type": "object",
        "required": [
          "userId"
        ],
        "properties": {
          "userId": {
            "description": "String value of the oculus player's Id.",
            "type": "string",
            "example": "5eb26a338a232"
          }
        }
      },
      "AppleGameCenterConfig": {
        "title": "AppleGameCenterConfig",
        "description": "The request body for Apple Game Center authentication. This field is not applicable for any other Id provider.",
        "type": "object",
        "required": [
          "teamPlayerId",
          "timestamp",
          "publicKeyUrl",
          "salt"
        ],
        "properties": {
          "teamPlayerId": {
            "description": "String value of the Apple Game Center player's team player Id.",
            "type": "string",
            "example": "5eb26a338a232"
          },
          "timestamp": {
            "description": "Integer value of the timestamp.",
            "type": "integer",
            "example": 389743847
          },
          "publicKeyUrl": {
            "description": "String value of the Apple Game Center public key url.",
            "type": "string",
            "example": "something.com/path.cert"
          },
          "salt": {
            "description": "String value of the base64 encoded salt.",
            "type": "string",
            "example": "ascfr=="
          }
        }
      },
      "SteamConfig": {
        "title": "SteamConfig",
        "description": "Identifying string passed as a parameter to Steam's GetAuthTicketForWebApi when the ticket was created, used to identify the entity calling this webapi. This should not be sent if no identity was passed issue a ticket from steam.",
        "properties": {
          "appId": {
            "description": "The app Id of the game.",
            "type": "string",
            "example": "123456"
          },
          "identity": {
            "description": "If this identity string was passed to GetAuthTicketForWebApi then the same value must be provided as the identity property. This value should be the comprised of alphanumeric characters with a length between 5 and 30.",
            "type": "string",
            "maxLength": 30,
            "minLength": 5
          }
        }
      },
      "LinkExternalIdRequest": {
        "title": "LinkExternalIdRequest",
        "description": "the request body for link external id",
        "type": "object",
        "required": [
          "token"
        ],
        "properties": {
          "forceLink": {
            "description": "Force a link between the player specified in the player-auth access token and the external Id. If a different player-auth player is already linked to the external id, unlink that player from the external id before linking the request's player.",
            "type": "boolean",
            "example": false
          },
          "token": {
            "description": "External token that can be verified to represent a player from the Id provider. This may be an Id token or an access token.",
            "type": "string",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX"
          },
          "oculusConfig": {
            "$ref": "#/components/schemas/OculusConfig"
          },
          "appleGameCenterConfig": {
            "$ref": "#/components/schemas/AppleGameCenterConfig"
          },
          "steamConfig": {
            "$ref": "#/components/schemas/SteamConfig"
          }
        }
      },
      "SignInWithSessionTokenRequest": {
        "title": "SignInWithSessionTokenRequest",
        "description": "the request body for session token authentication",
        "type": "object",
        "required": [
          "sessionToken"
        ],
        "properties": {
          "nonce": {
            "description": "String value used to associate a Client session with an Id Token, and to mitigate replay attacks. If this field is provided, the nonce claim in response Id token has a matching value.",
            "type": "string",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX"
          },
          "sessionToken": {
            "description": "The session token of the player.",
            "type": "string",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX"
          },
          "singleUse": {
            "description": "Make the child session token single-use, so its first refresh consumes it. Inherited, and cannot be cleared by a later refresh.",
            "type": "boolean",
            "default": false,
            "example": true
          },
          "audiences": {
            "description": "Scope the child session token to these services. Each entry adds `svc:<name>` to the ID token's `aud`, and audience-checked routes outside the set reject it. A service's name is a segment of its production URL, e.g. `cloud-save` for `cloud-save.services.api.unity.com`.\nIgnored if the presented token is already scoped.\n`player-auth` gates this API's player-management routes (Get and Delete Player, link, unlink, username/password sign-up and password change, code-link confirm, notifications), not sign-in or refresh.\n",
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9-]{1,64}$"
            },
            "example": [
              "cloud-save",
              "leaderboards"
            ]
          },
          "ttlSeconds": {
            "description": "Expire the child session token after this many seconds, capped at the presented token's expiry.",
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 31536000,
            "example": 60
          },
          "narrowOnly": {
            "description": "Stop Origin policies from widening this token's restrictions. Some Unity web origins apply their own restrictions on the first refresh from them, by default replacing the session token's audiences and expiry, which can widen them. With `narrowOnly`, the policy's audiences are intersected with the token's and its expiry applies only if sooner. It still adds single-use and binds the session token to the origin.\nFields left unset take the policy's value. If the token's audiences share none with the policy's, that refresh is rejected. Inherited, and cannot be cleared by a later refresh.\n",
            "type": "boolean",
            "default": false,
            "example": true
          }
        }
      },
      "UnlinkExternalIdRequest": {
        "title": "UnlinkExternalIdRequest",
        "description": "The request body for unlink external id.",
        "type": "object",
        "required": [
          "externalId"
        ],
        "properties": {
          "externalId": {
            "description": "The external ID to unlink from the player.",
            "type": "string",
            "example": "eyJhbGciOiJIUzI1Ni"
          }
        }
      },
      "GenerateCodeRequest": {
        "title": "GenerateCodeRequest",
        "description": "Request for generating a sign in code.",
        "type": "object",
        "required": [
          "codeChallenge"
        ],
        "properties": {
          "identifier": {
            "description": "Human-readable string to identify the requester device.",
            "type": "string",
            "example": "myDevice",
            "maxLength": 128
          },
          "codeChallenge": {
            "description": "SHA-256 string challenge for PKCE validation",
            "type": "string",
            "maxLength": 64
          }
        }
      },
      "GenerateCodeResponse": {
        "title": "GenerateCodeResponse",
        "description": "Response for code linking with information on the code.",
        "type": "object",
        "required": [
          "codeLinkSessionId",
          "signInCode",
          "expiration"
        ],
        "properties": {
          "codeLinkSessionId": {
            "description": "UUID identifying the code linking session.",
            "type": "string"
          },
          "signInCode": {
            "description": "The code required to perform the code confirmation.",
            "type": "string",
            "example": "f4j98K"
          },
          "expiration": {
            "description": "The timestamp for when the code is no longer valid in unix time since epoch.",
            "type": "string"
          }
        }
      },
      "SignInWithCodeRequest": {
        "title": "SignInWithCodeRequest",
        "description": "Request for checking if the code was confirmed.",
        "type": "object",
        "required": [
          "codeVerifier"
        ],
        "properties": {
          "codeVerifier": {
            "description": "Verifier for PKCE validation.",
            "type": "string",
            "minimum": 43,
            "maxLength": 128
          }
        }
      },
      "CodeLinkInfoRequest": {
        "title": "CodeLinkInfoRequest",
        "description": "Request information for a sign in code.",
        "type": "object",
        "required": [
          "signInCode"
        ],
        "properties": {
          "signInCode": {
            "description": "The code from which to get the info.",
            "type": "string"
          }
        }
      },
      "CodeLinkInfoResponse": {
        "title": "CodeLinkCheckConfirmationResponse",
        "description": "Information on the requested code",
        "type": "object",
        "required": [
          "expiration"
        ],
        "properties": {
          "identifier": {
            "description": "Human-readable string to identify the requester device.",
            "type": "string",
            "example": "myDevice"
          },
          "expiration": {
            "description": "The timestamp for when the code is no longer valid in unix time since epoch.",
            "type": "string"
          }
        }
      },
      "CodeLinkConfirmationRequest": {
        "title": "CodeLinkConfirmationRequest",
        "description": "Request for confirming the code linking.",
        "type": "object",
        "required": [
          "signInCode"
        ],
        "properties": {
          "signInCode": {
            "description": "The code returned in the GenerateCodeResponse.",
            "type": "string",
            "example": "f4j98K"
          },
          "sessionToken": {
            "description": "The authenticated device session token, for added security.",
            "type": "string"
          },
          "idProvider": {
            "description": "This is the id provider type. Only for consoles.",
            "type": "string"
          },
          "externalToken": {
            "description": "External token to validate the user. Only for consoles.",
            "type": "string"
          }
        }
      },
      "Player": {
        "title": "Player",
        "type": "object",
        "description": "Represents the player data.",
        "required": [
          "id",
          "disabled",
          "externalIds"
        ],
        "properties": {
          "disabled": {
            "description": "Whether the player is disabled by admin.",
            "type": "boolean",
            "example": false
          },
          "externalIds": {
            "description": "The list of linked external providers info. The list itself doesn't limit the number of external IDs linked to this player. Currently, only one external ID of each type can be linked to a player. For example, you can't link two different Facebook Ids with the same player.",
            "items": {
              "$ref": "#/components/schemas/ExternalId"
            },
            "type": "array"
          },
          "id": {
            "description": "The player Id. The Id is unique within the Id domain.",
            "type": "string",
            "example": "eyJhbGciOiJIUzI1"
          },
          "username": {
            "description": "The username used to sign in using the Username Password IdProvider.",
            "type": "string",
            "example": "New_User_57"
          }
        }
      },
      "PlayerResponse": {
        "title": "PlayerResponse",
        "type": "object",
        "description": "Represents the player data.",
        "required": [
          "id",
          "createdAt",
          "lastLoginAt",
          "disabled",
          "externalIds"
        ],
        "properties": {
          "disabled": {
            "description": "Whether the player is disabled by admin.",
            "type": "boolean",
            "example": false
          },
          "externalIds": {
            "description": "This is the response returned when get player is called.",
            "items": {
              "$ref": "#/components/schemas/ExternalId"
            },
            "type": "array"
          },
          "id": {
            "description": "The player Id. The Id is unique within the Id domain.",
            "type": "string",
            "example": "eyJhbGciOiJIUzI1N"
          },
          "createdAt": {
            "description": "When the player was created. It is a unix timestamp.",
            "type": "string",
            "example": "123000000"
          },
          "lastLoginAt": {
            "description": "When the player last logged in. It is a unix timestamp.",
            "type": "string",
            "example": "123000000"
          },
          "usernamepassword": {
            "$ref": "#/components/schemas/usernamePasswordLoginMetadataResponse"
          }
        }
      },
      "usernamePasswordLoginMetadataResponse": {
        "type": "object",
        "description": "Information about the player's username and password sign-in.",
        "required": [
          "username"
        ],
        "properties": {
          "username": {
            "description": "The username. Case insensitive. Length must be between 3-20 with the allowed characters a-z, 0-9 and the symbols [.][-][@][_].",
            "type": "string",
            "example": "New_User_57"
          },
          "createdAt": {
            "description": "When the player's username and password were created. It is a unix timestamp.",
            "type": "string",
            "example": "123000000"
          },
          "lastLoginAt": {
            "description": "When the player last signed in with their username and password. It is a unix timestamp.",
            "type": "string",
            "example": "123000000"
          },
          "passwordUpdatedAt": {
            "description": "When the player's password was last updated. It is a unix timestamp.",
            "type": "string",
            "example": "123000000"
          }
        }
      },
      "AuthenticationError": {
        "type": "object",
        "required": [
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "title": {
            "type": "string",
            "example": "Bad Request"
          },
          "status": {
            "type": "integer",
            "example": 400
          },
          "detail": {
            "type": "string",
            "example": "Something is wrong"
          },
          "details": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ReadNotificationsResponse"
                },
                {
                  "type": "object"
                }
              ]
            },
            "example": [
              {
                "code": "ERROR_CODE_123",
                "path": "nested.value",
                "message": "Invalid value"
              }
            ]
          }
        }
      },
      "UsernamePasswordRequest": {
        "title": "UsernamePasswordRequest",
        "description": "Request for signing up or signing in with a username and password.",
        "type": "object",
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "username": {
            "description": "The username. Case insensitive. Length must be between 3-20 with the allowed characters a-z, 0-9 and the symbols [.][-][@][_].",
            "type": "string",
            "example": "New_User_57"
          },
          "password": {
            "description": "The password. Length must be between 8-30 and contain at least one uppercase letter, at least one lowercase letter, at least one number and at least one symbol.",
            "type": "string",
            "example": "ThePassword123!"
          }
        }
      },
      "UsernamePasswordPasswordUpdateRequest": {
        "title": "UsernamePasswordPasswordUpdateRequest",
        "description": "Request for updating a player's password.",
        "type": "object",
        "required": [
          "password",
          "newPassword"
        ],
        "properties": {
          "password": {
            "description": "The password. Length must be between 8-30 and contain at least one uppercase letter, at least one lowercase letter, at least one number and at least one symbol.",
            "type": "string",
            "example": "ThePassword123!"
          },
          "newPassword": {
            "description": "The password to be changed. Length must be between 8-30 and contain at least one uppercase letter, at least one lowercase letter, at least one number and at least one symbol.",
            "type": "string",
            "example": "TheNewPassword456@"
          }
        }
      },
      "CustomIDRequest": {
        "title": "CustomIDRequest",
        "description": "Request for signing up or signing in a player with Custom ID.",
        "type": "object",
        "required": [
          "externalId"
        ],
        "properties": {
          "externalId": {
            "description": "The external id used to identify the player. Length must be between 1-320.",
            "type": "string",
            "example": "externalId"
          },
          "signInOnly": {
            "description": "Whether the API should only attempt to sign-in and do not create a new player if the player does not exist.",
            "type": "boolean",
            "example": false
          },
          "accessToken": {
            "description": "The access token of the existing player to link this Custom ID to.",
            "type": "string",
            "example": "eyJhbGciOiJSUzI1NiIsImtpZCI6InB1YmxpYzo3MDdFQkJCNy05MEYzLTQ3NEYtOTA0NC02NDIzRUNDM0Q3NDkiLCJ0eXAiOiJKV1QifQ.eyJdWQiOlsiaWRkOmY1OWRmNDViLWY1YzUtNGE4Yy1iMmM0LWQzNDJiNmM5ZThkZiIsImVudk5hbWU6cHJvZHVjdGlvbiIsImVudklkOmRiNjQ5YzJiLWZjZTAtNDZkZS1iMGFhLTU1MzE1Y2VjYmUwNCIsInVwaWQ6NjU3YjViZGEtZWNmOS00NTFlLTk2NzMtODhlMjg4NTM2MzA1Il0sImV4cCI6MTcxMjg0NjA5NiwiaWF0IjoxNzEyODQyNDk2LCJpZGQiOiJmNTlkZjQ1Yi1mNWM1LTRhOGMtYjJjNC1kMzQyYjZjOWU4ZGYiLCJpc3MiOiJodHRwczovL3BsYXllci1hdXRoLXN0Zy5zZXJ2aWNlcy5hcGkudW5pdHkuY29tIiwianRpIjoiMjIyMjExNGUtMzE4Ni00ODljLTk3YzMtNjg4ZWI2NmJkNDVhIiwibmJmIjoxNzEyODQyNDk2LCJub25jZSI6Im51bGwiLCJwcm9qZWN0X2lkIjoiNjU3YjViZGEtZWNmOS00NTFlLTk2NzMtODhlMjg4NTM2MzA1Iiwic2lnbl9pbl9wcm92aWRlciI6ImFub255bW91cyIsInN1YiI6ImtzOWtJeW1iUnloMFVXVmVJbHBvVXZhR3ZueEoiLCJ0b2tlbl90eXBlIjoiYXV0aGVudGljYXRpb24iLCJ2ZXJzaW9uIjoiMSJ9.iVMwPYOp7qGNdzHS0CqWSdhGE7UTQOL_9J418zUJvlZtmDeslSSEinHAJn_Bv58yaVDNV1Z4dzSdKr5ixVDcxhVpe0lNkThFLRD6r2Ae36NNBKkSztBt9BD14k0_hwyU4beDrY7TUDHNfSppRczkBJAKp5T6eOt3rR9M7ilAOLJLd9Tz5l4aoJWkqG-V-S8qjkDvhiMdHE6HwGk2CVch5MGzTiBqHelCNoroA_cjkLFfUBkT4TTRUMBzXfrsyc8qat1iUPtAjxsvF91Y22d75PiPZAffSaCfT1vzIRWKZQcRH1QQl8BcSFUPGYAKrUKqlvP8njU1GuGYAluxJusseg"
          },
          "sessionTokenRestrictions": {
            "$ref": "#/components/schemas/SessionTokenRestrictions"
          }
        }
      },
      "SessionTokenRestrictions": {
        "title": "SessionTokenRestrictions",
        "description": "Restrictions on the session token minted by this sign-in. Later refreshes treat them exactly as restrictions set on Session Token Sign In, including that an Origin policy can replace `audiences` and `ttlSeconds` unless `narrowOnly` is set. Omit for an unrestricted session.",
        "type": "object",
        "properties": {
          "singleUse": {
            "description": "Make the session token single-use, so its first refresh consumes it.",
            "type": "boolean",
            "default": false,
            "example": true
          },
          "audiences": {
            "description": "Scope the session token to these services, as `audiences` on Session Token Sign In.",
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9-]{1,64}$"
            },
            "example": [
              "cloud-save",
              "leaderboards"
            ]
          },
          "ttlSeconds": {
            "description": "Expire the session token after this many seconds. The returned ID token expires no later than this.",
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 31536000,
            "example": 60
          },
          "narrowOnly": {
            "description": "Make these restrictions a ceiling for Origin policies, as `narrowOnly` on Session Token Sign In. Set it when the token must not gain audiences such as `player-auth` from an Origin policy, e.g. for a player identity your server has not verified. A short `ttlSeconds` will not be extended, so usually leave it off.",
            "type": "boolean",
            "default": false,
            "example": true
          }
        }
      },
      "ReadNotificationsResponse": {
        "type": "object",
        "required": [
          "notifications"
        ],
        "properties": {
          "notifications": {
            "type": "array",
            "description": "List of notifications",
            "items": {
              "$ref": "#/components/schemas/Notification"
            }
          }
        }
      },
      "Notification": {
        "type": "object",
        "required": [
          "id",
          "type",
          "playerID",
          "caseID",
          "projectID",
          "message",
          "createdAt"
        ],
        "properties": {
          "id": {
            "description": "The notification identifier",
            "type": "string"
          },
          "type": {
            "description": "The notification type, defaults to DSA",
            "type": "string",
            "example": "DSA"
          },
          "playerID": {
            "description": "The player identifier",
            "type": "string"
          },
          "caseID": {
            "description": "The case identifier",
            "type": "string"
          },
          "projectID": {
            "description": "The project identifier",
            "type": "string"
          },
          "message": {
            "description": "The message content",
            "type": "string"
          },
          "createdAt": {
            "description": "Unix epoch time the notification was triggered",
            "type": "string"
          },
          "updatedAt": {
            "description": "Unix epoch time the notification was last updated",
            "type": "string"
          },
          "deletedAt": {
            "description": "Unix epoch time the notification was soft deleted",
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "Client": {
        "type": "http",
        "scheme": "bearer",
        "description": "To get started with Client Authentication, visit the [Client Authentication section](https://services.docs.unity.com/docs/client-auth)."
      },
      "Admin": {
        "type": "http",
        "scheme": "bearer",
        "description": "To get started with Authentication, please visit the [Service Account Authentication section](https://services.docs.unity.com/docs/service-account-auth)."
      }
    }
  },
  "security": [
    {
      "Client": []
    }
  ],
  "tags": [
    {
      "name": "Player Authentication",
      "description": "For more information about Unity Authentication and how to use these APIs, please read the [Client Authentication Documentation](https://services.docs.unity.com/docs/client-auth). It includes information about available authentication options, login states, and enforcing login state for the end player."
    }
  ]
}
```