> ## 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.

# List Clients

> List clients from an organization.

<Accordion title="Search Query Parameter">
  The search query parameter takes a list of words and enables you to only return clients whose code or name contains all those words.

  ```http
  GET /api/v4/clients?organizationId=1&search=goo,compa&fields.root=count HTP/1.1

  {
    "count": 2,
    "items": [
      {
        "id": 1,
        "name": "Google",
        "code": "World company"
      },
      {
        "id": 1,
        "name": "Google company",
        "code": "Alphabet Group"
    ]
  }
  ```
</Accordion>


## OpenAPI

````yaml /openapi-specs/timmi-project.yaml get /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'
    get:
      tags:
        - Clients
      summary: List Clients
      description: List clients from an organization.
      operationId: get-timmiproject-api-clients
      parameters:
        - $ref: '#/components/parameters/organizationId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/fields_root'
        - $ref: '#/components/parameters/search'
        - schema:
            type: string
          in: query
          description: Only returns clients whose code is strictly equal to sent value
          name: code
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: '#/components/schemas/Client'
                  - $ref: '#/components/schemas/CollectionV4'
        '400':
          $ref: '#/components/responses/ResponseProblem'
        '401':
          $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
    organizationId:
      name: organizationId
      in: query
      required: true
      schema:
        type: integer
      description: Filter on a single organization unique identifier.
    page:
      name: page
      in: query
      required: false
      description: Page number
      schema:
        type: integer
        default: 1
        minimum: 1
    limit:
      name: limit
      in: query
      required: false
      description: Page size
      schema:
        type: integer
        default: 10
    fields_root:
      name: fields.root
      in: query
      required: false
      description: Return total items count (across all pages).
      schema:
        type: string
        enum:
          - count
    search:
      name: search
      in: query
      schema:
        type: array
        items:
          type: string
      description: Comma-separated list of codes / names to search for
  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
    CollectionV4:
      title: CollectionV4
      type: object
      properties:
        next:
          type:
            - string
            - 'null'
          format: uri
        prev:
          type:
            - string
            - 'null'
          format: uri
        count:
          type:
            - integer
            - 'null'
          minimum: 0
  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

````