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

# Create Client

> Creates a new client. Only `client_name` is required.

<Note>
  `client_name` is the only required field. All other fields are optional and can be set later via the [Edit Client](/api-reference/v01.12.00/clients/edit-client) endpoint.
</Note>

<Tip>
  After creating a client, use the [Invite Client](/api-reference/v01.12.00/clients/invite-client) endpoint to send them a client portal invitation email.
</Tip>


## OpenAPI

````yaml api-reference/v01.12.00/openapi-v01.12.00.json POST /clients
openapi: 3.0.0
info:
  title: Roosted
  version: 0.1.12
  contact:
    name: Support
    url: https://support.roostedhr.com/support/home
    email: support@roostedhr.com
  description: |-
    Enterprise API

    Sandbox keys and Production keys are requested from support
servers:
  - url: https://api.roostedhr.com/api/1_12
  - url: https://sandbox.roostedhr.com/api/1_12
security:
  - X-API-KEY: []
tags:
  - name: Announcements
  - name: Areas
  - name: Clients
  - name: Company
  - name: Configuration
  - name: Events
  - name: Locations
  - name: Payroll Groups
  - name: Rate Cards
  - name: Shifts
  - name: Skillsets
  - name: Time Tracking
  - name: Wage Rules
  - name: Workers
paths:
  /clients:
    post:
      tags:
        - Clients
      summary: Create Client
      description: Creates a new client. Only `client_name` is required.
      operationId: post-client
      requestBody:
        description: Client details. Only `client_name` is required.
        content:
          application/json:
            schema:
              type: object
              properties:
                client_name:
                  type: string
                  minLength: 1
                  maxLength: 255
                client_contact_name:
                  type: string
                  maxLength: 255
                client_contact_email:
                  type: string
                  maxLength: 255
                client_invoice_customer_id:
                  type: string
                  maxLength: 255
                client_address:
                  type: string
                  maxLength: 65535
                client_city:
                  type: string
                  maxLength: 255
                client_state:
                  type: string
                  maxLength: 255
                client_postal_code:
                  type: string
                  maxLength: 255
              required:
                - client_name
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Client'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Missing client name:
                  value:
                    code: CLI-100
                    error: Client name is required
                Invalid email format:
                  value:
                    code: CLI-200
                    error: Invalid email format
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Invalid API key:
                  value:
                    code: ATH-100
                    error: Invalid or missing API key
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Insufficient permissions:
                  value:
                    code: CLI-1900
                    error: Insufficient permissions to manage clients
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Not found:
                  value:
                    code: CLI-300
                    error: Client not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Unexpected error:
                  value:
                    code: CLI-2000
                    error: An unexpected error occurred
components:
  schemas:
    Client:
      title: Client
      type: object
      properties:
        id:
          type: string
          description: Unique client identifier.
          example: uLu8K
        client_name:
          type: string
          description: Client display name.
          example: Acme Corp
        client_contact_name:
          type: string
          nullable: true
          description: Primary contact name.
        client_contact_phone:
          type: string
          nullable: true
          description: Primary contact phone number.
        client_contact_email:
          type: string
          nullable: true
          description: Primary contact email address.
        client_contact_title:
          type: string
          nullable: true
          description: Primary contact job title.
        default_comments_for_workers:
          type: string
          nullable: true
          description: >-
            Default instructions shown to workers assigned to this client's
            events.
        client_invoice_customer_id:
          type: string
          nullable: true
          description: External invoice/customer ID for billing integration.
        client_address:
          type: string
          nullable: true
          description: Street address.
        client_city:
          type: string
          nullable: true
          description: City.
        client_state:
          type: string
          nullable: true
          description: State or province.
        client_postal_code:
          type: string
          nullable: true
          description: Postal or ZIP code.
        company_name:
          type: string
          nullable: true
          description: Company name associated with the client.
        client_portal_connection_status:
          type: integer
          nullable: true
          description: >-
            Client portal connection status. `0` = invited, `2` = connected,
            `null` = not connected.
        client_portal_connection_datetime:
          type: string
          nullable: true
          description: Datetime when the client portal was connected.
        client_portal_invite_datetime:
          type: string
          nullable: true
          description: Datetime when the client portal invitation was sent.
        client_portal_invite_email:
          type: string
          nullable: true
          description: Email address the client portal invitation was sent to.
        pending:
          type: boolean
          description: Whether the client is in a pending state.
  securitySchemes:
    X-API-KEY:
      name: X-API-KEY
      type: apiKey
      in: header

````