---
title: "Create a new client"
description: "Creates a new client for the organization"
---

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

Path: Test And Accept API › Clients

`POST /clients`

Creates a new client for the organization

## Authentication

- `bearerAuth`, http, header `Authorization`, format `tnda_ token`

## Request body

_Required._

- `name` (`clients-create.name`; string, required)
  - minLength 1; maxLength 255
- `description` (`clients-create.description`; string, optional)
- `website` (`clients-create.website`; string, optional)
  - format `uri`
- `industry` (`clients-create.industry`; string, optional)

## Example request

```json
{
  "name": "string",
  "description": "string",
  "website": "http://example.com",
  "industry": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.testandaccept.com/api/rest/clients \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "string",
  "description": "string",
  "website": "http://example.com",
  "industry": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.testandaccept.com/api/rest/clients';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    name: 'string',
    description: 'string',
    website: 'http://example.com',
    industry: 'string'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.testandaccept.com/api/rest/clients"

payload = {
    "name": "string",
    "description": "string",
    "website": "http://example.com",
    "industry": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Successful response

#### Example

```json
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "description": "string",
  "website": "string",
  "industry": "string",
  "organizationId": "string",
  "isPinned": true,
  "pinnedAt": "2019-08-24T14:15:22Z",
  "contacts": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "clientId": "5e505642-9024-474d-9434-e5a44f505cc5",
      "name": "string",
      "email": "string",
      "phone": "string",
      "role": "string",
      "isPrimary": true,
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z"
    }
  ],
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
```

- `id` (`clients-create.response.200.id`; string, required)
  - format `uuid`; pattern `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$`
- `name` (`clients-create.response.200.name`; string, required)
- `organizationId` (`clients-create.response.200.organizationId`; string, required)
- `isPinned` (`clients-create.response.200.isPinned`; boolean, required)
- `pinnedAt` (`clients-create.response.200.pinnedAt`; any of, required)
  - any of: `string`, `null`
- `contacts` (`clients-create.response.200.contacts`; array<object>, required)
  - `id` (`clients-create.response.200.contacts.id`; string, required)
    - format `uuid`; pattern `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$`
  - `clientId` (`clients-create.response.200.contacts.clientId`; string, required)
    - format `uuid`; pattern `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$`
  - `name` (`clients-create.response.200.contacts.name`; string, required)
  - `email` (`clients-create.response.200.contacts.email`; string, required)
  - `isPrimary` (`clients-create.response.200.contacts.isPrimary`; boolean, required)
  - `createdAt` (`clients-create.response.200.contacts.createdAt`; string, required)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
  - `updatedAt` (`clients-create.response.200.contacts.updatedAt`; string, required)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
  - `phone` (`clients-create.response.200.contacts.phone`; string, optional)
  - `role` (`clients-create.response.200.contacts.role`; string, optional)
- `createdAt` (`clients-create.response.200.createdAt`; string, required)
  - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
- `updatedAt` (`clients-create.response.200.updatedAt`; string, required)
  - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
- `description` (`clients-create.response.200.description`; string, optional)
- `website` (`clients-create.response.200.website`; string, optional)
- `industry` (`clients-create.response.200.industry`; string, optional)

### 400

Invalid input data

#### Example

```json
{
  "code": "BAD_REQUEST",
  "message": "Invalid input data",
  "issues": []
}
```

- `message` (`clients-create.response.400.message`; string, required) — The error message
  - example `"Invalid input data"`
- `code` (`clients-create.response.400.code`; string, required) — The error code
  - example `"BAD_REQUEST"`
- `issues` (`clients-create.response.400.issues`; array<object>, optional) — An array of issues that were responsible for the error
  - example `[]`
  - `message` (`clients-create.response.400.issues.message`; string, required)

### 401

Authorization not provided

#### Example

```json
{
  "code": "UNAUTHORIZED",
  "message": "Authorization not provided",
  "issues": []
}
```

- `message` (`clients-create.response.401.message`; string, required) — The error message
  - example `"Authorization not provided"`
- `code` (`clients-create.response.401.code`; string, required) — The error code
  - example `"UNAUTHORIZED"`
- `issues` (`clients-create.response.401.issues`; array<object>, optional) — An array of issues that were responsible for the error
  - example `[]`
  - `message` (`clients-create.response.401.issues.message`; string, required)

### 403

Insufficient access

#### Example

```json
{
  "code": "FORBIDDEN",
  "message": "Insufficient access",
  "issues": []
}
```

- `message` (`clients-create.response.403.message`; string, required) — The error message
  - example `"Insufficient access"`
- `code` (`clients-create.response.403.code`; string, required) — The error code
  - example `"FORBIDDEN"`
- `issues` (`clients-create.response.403.issues`; array<object>, optional) — An array of issues that were responsible for the error
  - example `[]`
  - `message` (`clients-create.response.403.issues.message`; string, required)

### 500

Internal server error

#### Example

```json
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error",
  "issues": []
}
```

- `message` (`clients-create.response.500.message`; string, required) — The error message
  - example `"Internal server error"`
- `code` (`clients-create.response.500.code`; string, required) — The error code
  - example `"INTERNAL_SERVER_ERROR"`
- `issues` (`clients-create.response.500.issues`; array<object>, optional) — An array of issues that were responsible for the error
  - example `[]`
  - `message` (`clients-create.response.500.issues.message`; string, required)


Source: https://docs.testandaccept.com/reference/clients/create/index.md
