Clients API

Manage clients within your companies. Clients are the organizations or individuals for whom projects are created and managed.

The Client Object

{
  "id": 123,
  "title": "Acme Corporation",
  "company": {
    "id": 456,
    "title": "Design Studio Inc"
  },
  "created_at": "2023-01-01T12:00:00.000000Z",
  "updated_at": "2023-01-01T12:00:00.000000Z"
}

Attributes

Attribute Type Description
id integer Unique identifier for the client
title string The client's name or company name
company object The company this client belongs to (id, title). Included in list responses; omitted from single-client responses.
created_at string ISO 8601 timestamp when the client was created
updated_at string ISO 8601 timestamp when the client was last updated

List Clients

Retrieves a list of clients for the authenticated user's companies.

GET /api/v1/clients

Query Parameters

Parameter Type Description
company_id integer Filter clients by specific company ID
title string Filter clients by title (partial match)
per_page integer Number of results per page (max 1000)

Example Request

GET /api/v1/clients?company_id=456&per_page=25
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Example Response

[
  {
    "id": 123,
    "title": "Acme Corporation",
    "company": { "id": 456, "title": "Design Studio Inc" },
    "created_at": "2023-01-01T12:00:00.000000Z",
    "updated_at": "2023-01-01T12:00:00.000000Z"
  },
  {
    "id": 124,
    "title": "Beta Industries",
    "company": { "id": 456, "title": "Design Studio Inc" },
    "created_at": "2023-01-02T10:30:00.000000Z",
    "updated_at": "2023-01-02T10:30:00.000000Z"
  }
]

Get a Client

Retrieves a specific client by ID.

GET /api/v1/clients/{id}

Example Request

GET /api/v1/clients/123
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Example Response

{
  "id": 123,
  "title": "Acme Corporation",
  "created_at": "2023-01-01T12:00:00.000000Z",
  "updated_at": "2023-01-01T12:00:00.000000Z"
}

Create a Client

Creates a new client within the specified company.

POST /api/v1/clients

Request Body

Parameter Type Required Description
title string Yes The client's name or company name
company_id integer Yes ID of the company this client belongs to

Example Request

POST /api/v1/clients
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
Accept: application/json

{
  "title": "New Client Corp",
  "company_id": 456
}

Example Response

{
  "id": 125,
  "title": "New Client Corp",
  "created_at": "2023-01-03T14:20:00.000000Z",
  "updated_at": "2023-01-03T14:20:00.000000Z"
}

Update a Client

Updates an existing client's information.

PUT /api/v1/clients/{id}

Request Body

Parameter Type Required Description
title string No The client's updated name

Example Request

PUT /api/v1/clients/123
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
Accept: application/json

{
  "title": "Acme Corporation Ltd"
}

Example Response

{
  "id": 123,
  "title": "Acme Corporation Ltd",
  "created_at": "2023-01-01T12:00:00.000000Z",
  "updated_at": "2023-01-03T15:45:00.000000Z"
}

Delete a Client

Permanently deletes a client. This action cannot be undone.

DELETE /api/v1/clients/{id}

Warning: Deleting a client will permanently remove it and may affect associated projects. This action cannot be undone.

Example Request

DELETE /api/v1/clients/123
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Example Response

204 No Content