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

# Create a new Client

> Create a new client.



## OpenAPI

````yaml /openapi-specs/timmi-project.yaml post /timmi-project/api/v4/clients
openapi: 3.1.0
info:
  title: Lucca Project API (not v3)
  version: '1.0'
  description: >
    Welcome on the documentation for the Lucca Project API.


    It is not conforming to the "v3 API" constraints. Main differences are:

    - All available fields are systematically returned. Fields sets may be
    differente between endpoints for resources collections and single resources.

    - Paging is controlled through the `take` and `offset` parameters.
  contact:
    name: API Support
    url: https://support.lucca.fr
    email: contact@luccasoftware.com
  license:
    name: Unlicensed
    url: https://www.luccasoftware.com
servers:
  - url: https://{host}
    description: Your Lucca account URL.
    variables:
      host:
        default: example.ilucca.net
        description: >-
          The URL of your dedicated Lucca account: `{account}.{env}.{region}`.


          Account reflects your company name. Env indicates the environment.
          Region depends on your server location.


          **Please, use your test or sandbox environments (and not your
          production env.) for testing purposes.**


          Environments:

          - `ilucca`: production environment for customers.

          - `ilucca-test`: test environment for customers.

          - `ilucca-demo`: demo environment for prospects.


          Regions:

          - `.ch` for Swiss located accounts.

          - `.net` for the others.


          Regarding sandboxes, the pattern differs:
          `https://{account}-{sandboxName}.sandbox.{server}.luccasoftware.com`,
          where:

          - `{sandboxName}` is automatically generated upon creation.

          - `{server}` may be "eu1", "eu2" or "ch1".
security: []
tags:
  - name: Clients
    description: Clients the projects are serving.
  - name: Core concepts
    description: Concepts that are commonly used in the whole app.
  - name: Financials
    description: Exposes KPI for project management.
  - name: Organizations
    description: Set of legal establishments sharing the same accounting.
  - name: Project services
    description: Items of work (WBS) for a project.
  - name: Projects
    description: The main resource in Lucca Project.
paths:
  /timmi-project/api/v4/clients:
    parameters:
      - $ref: '#/components/parameters/Authorization'
    post:
      tags:
        - Clients
      summary: Create a new Client
      description: Create a new client.
      operationId: post-timmiproject-api-clients
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Client'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Client'
        '400':
          $ref: '#/components/responses/ResponseProblem'
        '401':
          $ref: '#/components/responses/ResponseProblem'
        '403':
          $ref: '#/components/responses/ResponseProblem'
        '404':
          $ref: '#/components/responses/ResponseProblem'
        '500':
          $ref: '#/components/responses/ResponseProblem'
components:
  parameters:
    Authorization:
      name: Authorization
      required: true
      description: 'API key. Value must be formatted like so: `lucca application={api_key}`.'
      in: header
      schema:
        type: string
  schemas:
    Client:
      title: The Client resource
      type: object
      x-tags:
        - Clients
      description: >-
        A client must belong to a single
        [organization](reference/Timmi-Project.yaml/components/schemas/Organization).


        The organizationId field is required upon creation (POST) and cannot be
        modified later.
      examples: []
      properties:
        id:
          type: number
          readOnly: true
        name:
          type: string
          minLength: 1
        code:
          type: string
          minLength: 1
          description: >-
            **Unique** code for this client. Used for identifying the client in
            invoices export if externalCode is null.
        externalCode:
          type:
            - 'null'
            - string
          description: >-
            Used for identifying the client in invoices exports. Is not subject
            to unicity.
        ownerId:
          type:
            - 'null'
            - integer
          description: Unique identifier of the user managing this client.
          writeOnly: true
        owner:
          type:
            - 'null'
            - object
          properties:
            id:
              type: integer
              minimum: 1
              readOnly: true
            firstName:
              type: string
              readOnly: true
            lastName:
              type: string
              readOnly: true
            dtContractEnd:
              type:
                - 'null'
                - string
              format: uri
              readOnly: true
            picture:
              type: object
              properties:
                href:
                  type: string
                  format: uri
                  readOnly: true
            establishmentId:
              type: integer
              minimum: 1
              readOnly: true
          readOnly: true
        organizationId:
          type: integer
          description: >-
            Unique identifier of the
            [organization](reference/Timmi-Project.yaml/components/schemas/Organization)
            this client belongs to.
          writeOnly: true
      required:
        - name
        - code
        - organizationId
  responses:
    ResponseProblem:
      description: Problem
      content:
        application/json:
          schema:
            description: ''
            type: object
            x-examples:
              example-1:
                type: https://tools.ietf.org/html/rfc7231#section-6.5.1
                title: One or more validation errors occurred.
                status: 400
                traceId: 00-da6c8638331d052ea1c8c0087705b797-56ea5435c7c46706-00
                errors:
                  organizationId:
                    - >-
                      A value for the 'organizationId' parameter or property was
                      not provided.
            properties:
              type:
                type: string
                minLength: 1
                format: uri
              title:
                type: string
              status:
                type: integer
                enum:
                  - 400
                  - 401
                  - 403
                  - 404
                  - 405
                  - 500
              traceId:
                type: string
                minLength: 1
                format: uuid
              errors:
                type: object
                additionalProperties: true

````