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

# Create A User

> Creates a new user object.

<Note>Includes a new [user token](/link/user-tokens) in the response.</Note>




## OpenAPI

````yaml post /v2/users
openapi: 3.0.0
info:
  title: Users API
  version: 1.0.0
  description: |
    API for managing users. Users connect their payroll accounts using Link.
servers:
  - url: https://api-sandbox.argyle.com
    description: Sandbox
  - url: https://api.argyle.com
    description: Production
security:
  - basicAuth: []
paths:
  /v2/users:
    post:
      summary: Create a user
      description: >-
        Creates a new user object. Includes a new [user
        token](/link/user-tokens) in the response.
      requestBody:
        content:
          application/json:
            examples:
              Default:
                summary: Default
                value: {}
              Wholesale mortgage:
                summary: Wholesale mortgage
                value:
                  first_name: John
                  last_name: Smith
                  email: john.smith@email.com
                  external_metadata:
                    broker:
                      name: Jane Diaz
                      company_name: Acme Mortgage
                      phone_number: '+14165551234'
                      email: jane.diaz@email.com
                      nmls: '1234567'
            schema:
              type: object
              properties:
                first_name:
                  type: string
                  description: Pre-fill Link's login screen with this first name.
                last_name:
                  type: string
                  description: Pre-fill Link's login screen with this last name.
                email:
                  type: string
                  description: >
                    Pre-fill Link's login screen with this email.


                    **Required for banking verifications when** `phone_number`
                    is not provided.


                    Invalid email addresses will cause the request to fail.

                    We recommend client-side validation and retrying the request
                    without the invalid email if you receive:

                    ```json

                    {
                      "email": [
                        "Enter a valid email address."
                      ]
                    }

                    ```
                phone_number:
                  type: string
                  description: >
                    Pre-fill Link's login screen with this phone number.

                    E.164 international format recommended.


                    **Required for banking verifications when** `email` is not
                    provided.


                    Invalid phone numbers will cause the request to fail.

                    We recommend client-side validation and retrying the request
                    without the invalid phone number if you receive:

                    ```json

                    {
                      "phone_number": [
                        "Enter a valid phone number."
                      ]
                    }

                    ```
                ssn:
                  type: string
                  description: >
                    Social Security number.


                    **Required for banking verifications when** `birth_date` is
                    not provided.
                address:
                  type: object
                  description: Address of the user.
                  properties:
                    city:
                      type: string
                      description: >-
                        Name of the city, town, district, or similar regional
                        entity.
                    line1:
                      type: string
                      description: >-
                        Address-Line 1, usually street address or P.O. Box
                        information.
                    line2:
                      type: string
                      description: Address-Line 2, usually the apartment or unit number.
                    state:
                      type: string
                      description: State, county, province, region, or equivalent.
                    country:
                      type: string
                      description: Two-letter country code (ISO 3166-1 alpha-2 format).
                    postal_code:
                      type: string
                      description: Zip code, or equivalent.
                birth_date:
                  type: object
                  description: >
                    Date of birth of the user.


                    **Required for banking verifications when** `ssn` is not
                    provided.
                  properties:
                    year:
                      type: integer
                      description: Birth year (1900 or later).
                    month:
                      type: integer
                      description: Birth month (between 1 and 12).
                    day:
                      type: integer
                      description: Birth day (between 1 and 31).
                external_metadata:
                  type: object
                  description: Any valid JSON.
                  properties:
                    broker:
                      allOf:
                        - $ref: '#/components/schemas/Broker'
                      required:
                        - name
                    open_banking:
                      type: object
                      description: >-
                        Can be optionally included when ordering [banking
                        verifications](/verifications/verification-types/banking).
                      properties:
                        end_user:
                          type: object
                          description: >-
                            Contains details about the person or entity making
                            the lending decision.
                          properties:
                            name:
                              type: string
                              description: Name of the lender or entity.
                            address:
                              type: string
                              description: >-
                                Street address or P.O. Box information (include
                                apartment or unit numbers).
                            city:
                              type: string
                              description: >-
                                Name of the city, town, district, or similar
                                regional entity.
                            state:
                              type: string
                              description: State, county, province, region, or equivalent.
                            zip:
                              type: string
                              description: Zip code, or equivalent.
                            phone:
                              type: string
                              description: >
                                Phone number of the lender or entity.


                                Must be 10 or 11 digits (with or without
                                hyphens).
                external_id:
                  type: string
                  description: Any string. Maximum 100 characters.
      responses:
        '200':
          description: ''
          content:
            application/json:
              example:
                user_token: >-
                  eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiIxNDRhMTRkNS04YzEzLTQzZGYtOTI4Ni01OWY4NjFkOWEyMDIiLCJleHAiOjE2NzgzNDExNDMsImZpZCI6ImIyYzY4YzUwLTc2MTQtNDAwNy1iMzNmLWZiMzlkMDFmMmM3MCIsImlhdCI6MTY3ODMzNzU0MywiaXNzIjoiYXJneWxlLWNvcmUtYXV0aC1kZXYiLCJqdGkiOiI3ZTU0ZTY1NS05YWN2LTRiZDctOWI3OC0xODMxMjVkYjM1MzMiLCJzdWIiOiIwMTg2YzRiNi04ZTgyLWQ5OWMtOGY4Mi1mNjMyMjgxMzk2ZTQiLCJ1c2VyX2lkIjoiMDE4NmM0YjYtOGU4Mi1kOTljLThmODItZjYzMjI4MTM5NmU0In0.q5bkZTFAohISOcjJDb2wSzKcHmwrOM4pp9imOVybaWk
                id: 018051aa-f7a9-a0db-2f38-6cfa325e9d69
              schema:
                type: object
                properties:
                  user_token:
                    type: string
                    description: Token associated with the created user.
                  id:
                    type: string
                    format: uuid
                    description: Unique ID of the user.
components:
  schemas:
    Broker:
      type: object
      description: >
        **Note:** Only for wholesale mortgage integrations.


        Contains information about the user's mortgage broker for
        [broker-branded invites](/verifications/wholesale-mortgage).
      properties:
        name:
          type: string
          description: Name of the mortgage broker.
        company_name:
          type: string
          nullable: true
          description: >-
            Name of the mortgage broker's company. Used by the
            `[Broker_company]` variable in [wholesale email/SMS
            templates](/console/flows/email-sms-templates#wholesale-mortgage-templates).
        phone_number:
          type: string
          description: >-
            Phone number of the mortgage broker.
            [E.164](https://en.wikipedia.org/wiki/E.164) international format.
        email:
          type: string
          description: Email address of the mortgage broker.
        nmls:
          type: string
          description: NMLS ID of the mortgage broker.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Username = api_key_id, Password = api_key_secret

````