> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Register Play Fab User

> Registers a new Playfab user account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. You must supply a username and an email address.

## Error codes

This operation may return the following PlayFab errors:

| Error | Code |
| --- | --- |
| EmailAddressNotAvailable | 1006 |
| EncryptionKeyMissing | 1290 |
| EvaluationModePlayerCountExceeded | 1490 |
| InvalidEmailAddress | 1005 |
| InvalidPartnerResponse | 1193 |
| InvalidPassword | 1008 |
| InvalidUsername | 1007 |
| NameNotAvailable | 1058 |
| ProfaneDisplayName | 1234 |
| SignedRequestNotAllowed | 1302 |
| UsernameNotAvailable | 1009 |




## OpenAPI

````yaml /services/playfab/api-references/rest/client/client.openapi.json post /Client/RegisterPlayFabUser
openapi: 3.0.0
info:
  version: '260922'
  title: PlayFab Client API
  description: >-
    APIs which provide the full range of PlayFab features available to the
    client - authentication, account and data management, inventory, friends,
    matchmaking, reporting, and platform-specific functionality
  termsOfService: https://playfab.com/terms/
  contact:
    url: https://community.playfab.com/index.html
  license:
    name: Apache 2.0
    url: https://github.com/PlayFab/API_Specs/blob/master/LICENSE
servers:
  - url: https://{titleId}.playfabapi.com
    description: PlayFab title endpoint
    variables:
      titleId:
        default: your_title_id
        description: Your PlayFab title ID (hex).
security: []
tags:
  - name: Account Management
    description: Account Management APIs
  - name: Advertising
    description: Advertising APIs
  - name: Analytics
    description: Analytics APIs
  - name: Authentication
    description: Authentication APIs
  - name: Character Data
    description: Character Data APIs
  - name: Characters
    description: Characters APIs
  - name: Content
    description: Content Service APIs
  - name: Friend List Management
    description: Friend List Management APIs
  - name: Matchmaking
    description: Matchmaking APIs
  - name: Platform Specific Methods
    description: Platform Specific Methods APIs
  - name: Player Data Management
    description: Player Data Management APIs
  - name: Player Item Management
    description: Player Item Management APIs
  - name: PlayStream
    description: PlayStream Management APIs
  - name: Server-Side Cloud Script
    description: Server-Side Cloud Script APIs
  - name: Shared Group Data
    description: Shared Group Data APIs
  - name: Title-Wide Data Management
    description: Title-Wide Data Management APIs
  - name: Trading
    description: Trading Management APIs
paths:
  /Client/RegisterPlayFabUser:
    post:
      tags:
        - Authentication
      summary: Register Play Fab User
      description: >
        Registers a new Playfab user account, returning a session identifier
        that can subsequently be used for API calls which require an
        authenticated user. You must supply a username and an email address.


        ## Error codes


        This operation may return the following PlayFab errors:


        | Error | Code |

        | --- | --- |

        | EmailAddressNotAvailable | 1006 |

        | EncryptionKeyMissing | 1290 |

        | EvaluationModePlayerCountExceeded | 1490 |

        | InvalidEmailAddress | 1005 |

        | InvalidPartnerResponse | 1193 |

        | InvalidPassword | 1008 |

        | InvalidUsername | 1007 |

        | NameNotAvailable | 1058 |

        | ProfaneDisplayName | 1234 |

        | SignedRequestNotAllowed | 1302 |

        | UsernameNotAvailable | 1009 |
      operationId: RegisterPlayFabUser
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterPlayFabUserRequest'
      responses:
        '200':
          $ref: '#/components/responses/RegisterPlayFabUserResult'
        '400':
          $ref: '#/components/responses/ApiErrorWrapper'
      security: []
components:
  schemas:
    RegisterPlayFabUserRequest:
      type: object
      properties:
        CustomTags:
          description: >-
            The optional custom tags associated with the request (e.g. build
            number, external trace identifiers, etc.).
          type: object
        DisplayName:
          description: >-
            An optional parameter for setting the display name for this title
            (3-25 characters).
          type: string
        Email:
          description: User email address attached to their account
          type: string
        EncryptedRequest:
          description: >-
            Base64 encoded body that is encrypted with the Title's public RSA
            key.
          type: string
        InfoRequestParameters:
          allOf:
            - $ref: '#/components/schemas/GetPlayerCombinedInfoRequestParams'
          description: Flags for which pieces of info to return for the user.
        Password:
          description: Password for the PlayFab account (6-100 characters)
          type: string
        PlayerSecret:
          description: Player secret that is used to verify API request signatures.
          type: string
        RequireBothUsernameAndEmail:
          description: >-
            An optional parameter that specifies whether both the username and
            email parameters are required. If true, both parameters are
            required; if false, the user must supply either the username or
            email parameter. The default value is true.
          type: boolean
        TitleId:
          description: >-
            Unique identifier for the title, found in the Settings > Game
            Properties section of the PlayFab developer site when a title has
            been selected.
          type: string
        Username:
          description: PlayFab username for the account (3-20 characters)
          type: string
      required:
        - TitleId
      example:
        Username: theuser
        Email: me@here.com
        Password: ExampleSecret
        TitleId: '1'
    GetPlayerCombinedInfoRequestParams:
      type: object
      properties:
        GetCharacterInventories:
          description: Whether to get character inventories. Defaults to false.
          type: boolean
        GetCharacterList:
          description: Whether to get the list of characters. Defaults to false.
          type: boolean
        GetPlayerProfile:
          description: >-
            Whether to get player profile. Defaults to false. Has no effect for
            a new player.
          type: boolean
        GetPlayerStatistics:
          description: Whether to get player statistics. Defaults to false.
          type: boolean
        GetTitleData:
          description: Whether to get title data. Defaults to false.
          type: boolean
        GetUserAccountInfo:
          description: Whether to get the player's account Info. Defaults to false
          type: boolean
        GetUserData:
          description: Whether to get the player's custom data. Defaults to false
          type: boolean
        GetUserInventory:
          description: Whether to get the player's inventory. Defaults to false
          type: boolean
        GetUserReadOnlyData:
          description: Whether to get the player's read only data. Defaults to false
          type: boolean
        GetUserVirtualCurrency:
          description: >-
            Whether to get the player's virtual currency balances. Defaults to
            false
          type: boolean
        PlayerStatisticNames:
          description: >-
            Specific statistics to retrieve. Leave null to get all keys. Has no
            effect if GetPlayerStatistics is false
          type: array
          items:
            type: string
        ProfileConstraints:
          allOf:
            - $ref: '#/components/schemas/PlayerProfileViewConstraints'
          description: >-
            Specifies the properties to return from the player profile. Defaults
            to returning the player's display name.
        TitleDataKeys:
          description: >-
            Specific keys to search for in the custom data. Leave null to get
            all keys. Has no effect if GetTitleData is false
          type: array
          items:
            type: string
        UserDataKeys:
          description: >-
            Specific keys to search for in the custom data. Leave null to get
            all keys. Has no effect if GetUserData is false
          type: array
          items:
            type: string
        UserReadOnlyDataKeys:
          description: >-
            Specific keys to search for in the custom data. Leave null to get
            all keys. Has no effect if GetUserReadOnlyData is false
          type: array
          items:
            type: string
      required:
        - GetUserAccountInfo
        - GetUserInventory
        - GetUserVirtualCurrency
        - GetUserData
        - GetUserReadOnlyData
        - GetCharacterInventories
        - GetCharacterList
        - GetTitleData
        - GetPlayerStatistics
        - GetPlayerProfile
      example:
        GetUserAccountInfo: true
        GetUserVirtualCurrency: true
        GetUserData: true
        UserDataKeys:
          - preferences
          - progress
    RegisterPlayFabUserResult:
      description: >-
        Each account must have a unique email address in the PlayFab service.
        Once created, the account may be associated with additional accounts
        (Steam, Facebook, Game Center, etc.), allowing for added social network
        lists and achievements systems.
      type: object
      properties:
        EntityToken:
          allOf:
            - $ref: '#/components/schemas/EntityTokenResponse'
          description: >-
            If LoginTitlePlayerAccountEntity flag is set on the login request
            the title_player_account will also be logged in and returned.
        PlayFabId:
          description: PlayFab unique identifier for this newly created account.
          type: string
        SessionTicket:
          description: >-
            Unique token identifying the user and game at the server level, for
            the current session.
          type: string
        SettingsForUser:
          allOf:
            - $ref: '#/components/schemas/UserSettings'
          description: Settings specific to this user.
        Username:
          description: PlayFab unique user name.
          type: string
      example:
        PlayFabId: 50DF92E291CCD4C3
        SessionTicket: >-
          50DF92E291CCD4C3---A54F-8D3909FF54DEE10-B7817722BC94E536.A6DCCFE1C9709ABB
        Username: username
    ApiErrorWrapper:
      description: The basic wrapper around every failed API response
      type: object
      properties:
        code:
          description: Numerical HTTP code
          type: integer
        status:
          description: String HTTP code
          type: string
        error:
          description: Playfab error code
          type: string
        errorCode:
          description: Numerical PlayFab error code
          type: integer
        errorMessage:
          description: Description for the PlayFab errorCode
          type: string
        errorDetails:
          description: Detailed description of individual issues with the request object
          type: object
      required:
        - code
        - errorCode
    PlayerProfileViewConstraints:
      type: object
      properties:
        ShowAvatarUrl:
          description: Whether to show player's avatar URL. Defaults to false
          type: boolean
        ShowBannedUntil:
          description: Whether to show the banned until time. Defaults to false
          type: boolean
        ShowCampaignAttributions:
          description: Whether to show campaign attributions. Defaults to false
          type: boolean
        ShowContactEmailAddresses:
          description: Whether to show contact email addresses. Defaults to false
          type: boolean
        ShowCreated:
          description: Whether to show the created date. Defaults to false
          type: boolean
        ShowDisplayName:
          description: Whether to show the display name. Defaults to false
          type: boolean
        ShowExperimentVariants:
          description: Whether to show player's experiment variants. Defaults to false
          type: boolean
        ShowLastLogin:
          description: Whether to show the last login time. Defaults to false
          type: boolean
        ShowLinkedAccounts:
          description: Whether to show the linked accounts. Defaults to false
          type: boolean
        ShowLocations:
          description: Whether to show player's locations. Defaults to false
          type: boolean
        ShowMemberships:
          description: Whether to show player's membership information. Defaults to false
          type: boolean
        ShowOrigination:
          description: Whether to show origination. Defaults to false
          type: boolean
        ShowPushNotificationRegistrations:
          description: Whether to show push notification registrations. Defaults to false
          type: boolean
        ShowStatistics:
          description: Reserved for future development
          type: boolean
        ShowTags:
          description: Whether to show tags. Defaults to false
          type: boolean
        ShowTotalValueToDateInUsd:
          description: Whether to show the total value to date in usd. Defaults to false
          type: boolean
        ShowValuesToDate:
          description: Whether to show the values to date. Defaults to false
          type: boolean
      required:
        - ShowDisplayName
        - ShowCreated
        - ShowOrigination
        - ShowLastLogin
        - ShowBannedUntil
        - ShowStatistics
        - ShowCampaignAttributions
        - ShowPushNotificationRegistrations
        - ShowLinkedAccounts
        - ShowContactEmailAddresses
        - ShowTotalValueToDateInUsd
        - ShowValuesToDate
        - ShowTags
        - ShowLocations
        - ShowAvatarUrl
        - ShowMemberships
        - ShowExperimentVariants
    EntityTokenResponse:
      type: object
      properties:
        Entity:
          allOf:
            - $ref: '#/components/schemas/EntityKey'
          description: The entity id and type.
        EntityToken:
          description: The token used to set X-EntityToken for all entity based API calls.
          type: string
        TokenExpiration:
          description: The time the token will expire, if it is an expiring token, in UTC.
          type: string
      example:
        EntityToken: lS2hbYH1Gls1KbnlyozHSQBrF4zsq6q006ci9ijSNqQUiiO6xyCQtVrLjsXjdBJ
        TokenExpiration: '2022-01-26T07:24:12Z'
        Entity:
          Id: 174812abf712
          Type: title_player_account
          TypeString: title_player_account
    UserSettings:
      type: object
      properties:
        GatherDeviceInfo:
          description: >-
            Boolean for whether this player is eligible for gathering device
            info.
          type: boolean
        GatherFocusInfo:
          description: >-
            Boolean for whether this player should report OnFocus play-time
            tracking.
          type: boolean
        NeedsAttribution:
          description: Boolean for whether this player is eligible for ad tracking.
          type: boolean
      required:
        - NeedsAttribution
        - GatherDeviceInfo
        - GatherFocusInfo
    EntityKey:
      description: >-
        Combined entity type and ID structure which uniquely identifies a single
        entity.
      type: object
      properties:
        Id:
          description: Unique ID of the entity.
          type: string
        Type:
          description: >-
            Entity type. See
            https://learn.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types
          type: string
      required:
        - Id
  responses:
    RegisterPlayFabUserResult:
      description: >-
        Each account must have a unique email address in the PlayFab service.
        Once created, the account may be associated with additional accounts
        (Steam, Facebook, Game Center, etc.), allowing for added social network
        lists and achievements systems.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: integer
                description: >-
                  The Http status code. If X-ReportErrorAsSuccess header is set
                  to true, this will report the actual http error code.
              status:
                type: string
                description: The Http status code as a string.
              data:
                $ref: '#/components/schemas/RegisterPlayFabUserResult'
            example:
              code: 200
              status: OK
              data:
                PlayFabId: 50DF92E291CCD4C3
                SessionTicket: >-
                  50DF92E291CCD4C3---A54F-8D3909FF54DEE10-B7817722BC94E536.A6DCCFE1C9709ABB
                Username: username
    ApiErrorWrapper:
      description: This is the outer wrapper for all responses with errors
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorWrapper'

````

## Related topics

- [Register PlayFab User](/services/playfab/api-references/rest/client/authentication/register-playfab-user.md)
- [thirty-day New User Retention Report](/services/playfab/data-analytics/learn-data/reports/thirty-day-new-user-retention-report.md)
- [Thirty-day New User Conversion Report](/services/playfab/data-analytics/learn-data/reports/thirty-day-new-user-conversion-report.md)
- [Login With Play Fab](/api-reference/authentication/login-with-play-fab.md)
- [PlayFab Release Notes 2018](/services/playfab/release-notes/2018.md)
