---
title: "Publish an advisor agreement"
---

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

# Publish an advisor agreement

Path: Nicer API › identity

`POST /identity/agreement`

URL: `https://api.nicer.travel/identity/agreement`

Publishes a new version of the advisor agreement of the agency the request acts for, with the text sent: it is numbered after the existing versions, every earlier draft or published version is terminated, and every advisor must sign the new one. Answers the new version. Agency admins and Nicer staff only.

## Authentication

- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Header parameters

- `x-nicer-company` (`identity.agreement.create.header.x-nicer-company`; string, optional) — Company context for an agency admin who belongs to several companies. Optional when the caller belongs to one.

## Request body

_Required._

- `content` (`identity.agreement.create.content`; string, required)

## Example request

```json
{
  "content": "string"
}
```

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
});

await nicer.identity.agreement.create({
  "content": "string"
});
```

### Nicer CLI

```bash
nicer identity agreement create --input - <<'JSON'
{
  "content": "string"
}
JSON
```

### cURL

```bash
curl --request POST \
  --url https://api.nicer.travel/identity/agreement \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "content": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/identity/agreement';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({content: '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.nicer.travel/identity/agreement"

payload = { "content": "string" }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "companyName": "string",
  "content": "string",
  "customFields": {
    "property1": null,
    "property2": null
  },
  "endDate": "string",
  "publishedAt": "string",
  "startDate": "string",
  "status": "draft",
  "versionNumber": 0,
  "agreementId": "string",
  "createdAt": "string",
  "type": "Agreement",
  "updatedAt": "string"
}
```

- `companyName` (`identity.agreement.create.response.200.companyName`; string, required)
- `content` (`identity.agreement.create.response.200.content`; string, required)
- `publishedAt` (`identity.agreement.create.response.200.publishedAt`; string, required)
- `startDate` (`identity.agreement.create.response.200.startDate`; string, required)
- `status` (`identity.agreement.create.response.200.status`; string, required)
  - one of `"draft"`, `"published"`, `"terminated"`
- `versionNumber` (`identity.agreement.create.response.200.versionNumber`; number, required)
- `agreementId` (`identity.agreement.create.response.200.agreementId`; string, required)
- `createdAt` (`identity.agreement.create.response.200.createdAt`; string, required)
- `type` (`identity.agreement.create.response.200.type`; string, required)
- `updatedAt` (`identity.agreement.create.response.200.updatedAt`; string, required)
- `customFields` (`identity.agreement.create.response.200.customFields`; map of unknown, optional)
- `endDate` (`identity.agreement.create.response.200.endDate`; string, optional)

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`identity.agreement.create.response.400.errorCode`; string, required)
- `errorMessage` (`identity.agreement.create.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`identity.agreement.create.response.401.errorCode`; string, required)
- `errorMessage` (`identity.agreement.create.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`identity.agreement.create.response.403.errorCode`; string, required)
- `errorMessage` (`identity.agreement.create.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/identity/identity.agreement.create/index.md
