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

# Create an End User

> CreateEndUser creates a new End User for the given organisation.

The end user requires a unique `externalId`. This is an immutable field so should not be set to something that may change
such as an email address.




## OpenAPI

````yaml /openapi/platform-api.yaml post /o/{organisation_id}/users
openapi: 3.1.0
info:
  title: Versori Platform API
  version: 0.0.1
  license:
    name: UNLICENSED
servers:
  - description: Production
    url: https://platform.versori.com/api/v2
  - description: Staging
    url: https://platform-staging.versori.com/api/v2
  - description: Development
    url: http://localhost:8901
security:
  - bearerToken: []
  - cookie: []
paths:
  /o/{organisation_id}/users:
    parameters:
      - $ref: '#/components/parameters/organisation_id'
    post:
      tags:
        - end_users
      summary: Create an End User
      description: >
        CreateEndUser creates a new End User for the given organisation.


        The end user requires a unique `externalId`. This is an immutable field
        so should not be set to something that may change

        such as an email address.
      operationId: CreateEndUser
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EndUserCreate'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndUser'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    organisation_id:
      name: organisation_id
      in: path
      required: true
      schema:
        type: string
        format: ulid
        x-go-type: ulid.ULID
        x-go-name: OrganisationID
        x-go-type-import:
          path: versori.dev/vergo/ulid
  schemas:
    EndUserCreate:
      description: Request to create a new End User
      type: object
      properties:
        externalId:
          description: ExternalID is the identifier of the user
          type: string
          x-go-type-name: ExternalID
        displayName:
          description: DisplayName is a human-readable name for the user
          type: string
          x-go-type-skip-optional-pointer: true
      required:
        - externalId
    EndUser:
      type: object
      properties:
        id:
          description: >
            ID is the Versori identifier for the user. Most APIs will not use
            this field but instead reference

            users by their externalId.
          type: string
          format: ulid
          x-go-type: ulid.ULID
          x-go-type-skip-optional-pointer: true
          x-go-type-import:
            path: versori.dev/vergo/ulid
          x-go-name: ID
        externalId:
          description: >
            ExternalID is the identifier for the user as determined by the
            organisation. This typically should

            be the same as the user's ID on the organisations system. Regardless
            of the value, it must

            be unique within the Organisation.
          type: string
          x-go-name: ExternalID
        displayName:
          description: >
            DisplayName is an optional human-readable name for the user. If not
            set, the default is an empty string.
          type: string
        organisationId:
          description: The organisation ID to which the user belongs to.
          type: string
          format: ulid
          x-go-type: ulid.ULID
          x-go-type-skip-optional-pointer: true
          x-go-type-import:
            path: versori.dev/vergo/ulid
          x-go-name: OrganisationID
        createdAt:
          type: string
          format: date-time
          description: CreatedAt is the time the user was created.
          x-go-type: time.Time
        updatedAt:
          type: string
          format: date-time
          description: UpdatedAt is the time the user was last updated.
          x-go-type: time.Time
      required:
        - id
        - externalId
        - displayName
        - organisationId
        - createdAt
        - updatedAt
    Error:
      type: object
      properties:
        code:
          type: string
          description: Code is a machine-readable error code.
        message:
          type: string
          description: Message is a human-readable error message.
        fields:
          type: array
          items:
            $ref: '#/components/schemas/ErrorField'
          x-go-type-skip-optional-pointer: true
        details:
          type: string
          x-go-type-skip-optional-pointer: true
      required:
        - code
        - message
    ErrorField:
      description: ErrorField denotes a field which has an error.
      type: object
      properties:
        field:
          type: string
          description: >
            Field is the name of the field which has an error, this may be a
            path to a nested field, including array

            elements. The format of this field is of the form:
            "field1.field2[0].field3"
        message:
          type: string
          description: Message is the error message for this specific field.
      required:
        - field
        - message
  securitySchemes:
    bearerToken:
      description: >
        Bearer token authentication used by the Versori Platform. External
        consumers must provide an API key, however

        internal consumers must provide a JWT id_token issued by our IdP.
      type: http
      scheme: bearer
    cookie:
      description: Cookie authentication used by the Versori Platform.
      type: apiKey
      in: cookie
      name: cookie

````