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

# Create a client

> Create a new client (the end customer of the partner) with identity, contact, and related-data fields. Scoped to the partner the API key belongs to. `customProperties` accepts the custom properties defined for your partner, keyed by property id; send `null` to clear one. Requires the `client:write` scope.



## OpenAPI

````yaml /openapi.yaml post /v1/client
openapi: 3.1.0
info:
  title: ProVision Public API
  version: 1.0.0
  description: >-
    Use the ProVision Public API to integrate with ProVision conversations,
    clients, users, and addresses. All endpoints accept and return JSON, are
    authenticated with an `x-api-key` header, and are scoped to a single partner
    tenant.
  contact:
    email: support@onevisionresources.com
    name: OneVision Resources Support
  license:
    name: Proprietary
servers:
  - url: https://connect.provisionapp.io
    description: Production
security: []
paths:
  /v1/client:
    post:
      tags:
        - client
      summary: Create a client
      description: >-
        Create a new client (the end customer of the partner) with identity,
        contact, and related-data fields. Scoped to the partner the API key
        belongs to. `customProperties` accepts the custom properties defined for
        your partner, keyed by property id; send `null` to clear one. Requires
        the `client:write` scope.
      operationId: createClient
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateClientPayload'
      responses:
        '201':
          description: Created client
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Client'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - OpenApiKeyAuth: []
components:
  schemas:
    CreateClientPayload:
      type: object
      properties:
        firstName:
          type: string
          minLength: 1
          example: Sam
        lastName:
          type: string
          minLength: 1
          example: Client
        marketingOptOut:
          type: boolean
        emails:
          type: array
          items:
            $ref: '#/components/schemas/CreateClientEmail'
        phoneNumbers:
          type: array
          items:
            $ref: '#/components/schemas/CreateClientPhoneNumber'
        customProperties:
          $ref: '#/components/schemas/CustomPropertiesWrite'
      required:
        - firstName
        - lastName
      additionalProperties: false
    Client:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ClientId'
        partnerName:
          type: string
        name:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        marketingOptOut:
          type: boolean
        emails:
          type: array
          items:
            $ref: '#/components/schemas/ClientEmail'
        phoneNumbers:
          type: array
          items:
            $ref: '#/components/schemas/ClientPhoneNumber'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - name
        - firstName
        - lastName
        - createdAt
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - error
    CreateClientEmail:
      type: object
      properties:
        value:
          type: string
          format: email
        label:
          type: string
        isPrimary:
          type: boolean
      required:
        - value
      additionalProperties: false
    CreateClientPhoneNumber:
      type: object
      properties:
        value:
          type: string
          minLength: 1
          example: '+15551234567'
        ext:
          type:
            - number
            - 'null'
        label:
          type: string
          example: Mobile
        isPrimary:
          type: boolean
      required:
        - value
      additionalProperties: false
    CustomPropertiesWrite:
      type: object
      additionalProperties: {}
      description: >-
        Custom property values, keyed by property id. Ids and value types come
        from the properties defined for your partner, so this object cannot be
        described field by field here: an unknown id or a value that does not
        match the property type is rejected with 400. Only the ids you send are
        modified — omit a property to leave it untouched. To clear one, send
        `null`; a blank string and an empty array count as empty too, for every
        property type alike.
      example:
        warranty_count: 5
        region: east
        onsite_required: true
    ClientId:
      type: string
      pattern: ^ovcid-.*$
    ClientEmail:
      type: object
      properties:
        id:
          type: string
          format: uuid
        value:
          type: string
          format: email
        label:
          type: string
        isPrimary:
          type: boolean
      required:
        - id
        - value
      additionalProperties: false
    ClientPhoneNumber:
      type: object
      properties:
        id:
          type: string
          format: uuid
        value:
          type: string
        ext:
          type: number
        label:
          type: string
        isPrimary:
          type: boolean
      required:
        - id
        - value
      additionalProperties: false
    ApiError:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
          example: NOT_FOUND
        message:
          type: string
          description: Human-readable error description
      required:
        - code
        - message
  securitySchemes:
    OpenApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Send the API key in the x-api-key header.

````