> This page is for version v2024-05-25 (default).
> For other versions, use one of these documentation indexes:
> - v2024-05-25 (default): https://docs.monite.com/v-2024-05-25/llms.txt
> - v2024-01-31: https://docs.monite.com/v2024-01-31/llms.txt
> - v2023-09-01: https://docs.monite.com/v2023-09-01/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.monite.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.monite.com/_mcp/server.

# Create a counterpart contact

POST https://api.sandbox.monite.com/v1/counterparts/{counterpart_id}/contacts
Content-Type: application/json

[Counterparts](https://docs.monite.com/common/counterparts/index) of the `organization` type can have additional contacts defined. Contacts are useful if you need to use different contact information for the same counterpart in different [invoices](https://docs.monite.com/accounts-receivable/invoices/index).

The first contact you add to a counterpart becomes its default contact. The default contact, if it exists, is automatically selected when you create invoices and quotes for this counterpart, but the contact information can also be changed later on the document level. To select a different contact as the default one, use `POST /counterparts/{counterpart_id}/contacts/{contact_id}/make_default`.

Reference: https://docs.monite.com/api/counterpart-contacts/post-counterparts-id-contacts

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.sandbox.monite.com/v1` (sandbox, default)
- `https://api.monite.com/v1` (eu_production)
- `https://us.api.monite.com/v1` (na_production)

## Request

### Path parameters

- `counterpart_id` (string, required) — ID of a counterpart to add a contact for. This counterpart must be an organization, not an individual.

### Headers

- `x-monite-version` (string, required)
- `x-monite-entity-id` (string, required) — The ID of the entity that owns the requested resource.

### Body (application/json)

This endpoint expects an object.

- `address` (CounterpartAddress, required) — The address of a contact person.
- `first_name` (string, required) — The first name of a contact person.
- `last_name` (string, required) — The last name of a contact person.
- `email` (string, optional) — The email address of a contact person.
- `phone` (string, optional) — The phone number of a contact person
- `title` (string, optional) — The title or honorific of a contact person. Examples: Mr., Ms., Dr., Prof.

## Response

### 200

Successful Response

- `id` (string, required) — A unique ID assigned to this counterpart contact.
- `address` (CounterpartAddress, required) — The address of a contact person.
- `counterpart_id` (string, required) — ID of the counterpart to which this contact belongs.
- `first_name` (string, required) — The first name of a contact person.
- `is_default` (boolean, required) — Indicates whether this contact is the default one. The default contact is used to fill in the counterpart's contact details when you create invoices and quotes for this counterpart. To select another contact as the default one, use [`POST /counterparts/{counterpart_id}/contacts/{contact_id}/make_default`](https://docs.monite.com/api/counterpart-contacts/post-counterparts-id-contacts-id-make-default).
- `last_name` (string, required) — The last name of a contact person.
- `email` (string, optional) — The email address of a contact person.
- `phone` (string, optional) — The phone number of a contact person
- `title` (string, optional) — The title or honorific of a contact person. Examples: Mr., Ms., Dr., Prof.

## Errors

### 401 Post Counterparts ID Contacts Request Unauthorized Error

The `Authorization` header is missing or contains an invalid or expired access token. See [Authentication](https://docs.monite.com/api/concepts/authentication) to learn how to authenticate API calls.

- `error` (ErrorSchema, required)

### 403 Post Counterparts ID Contacts Request Forbidden Error

The specified access token does not have permissions to perform this operation.

- `error` (ErrorSchema, required)

### 404 Post Counterparts ID Contacts Request Not Found Error

A counterpart with the specified ID was not found.

- `error` (ErrorSchema, required)

### 409 Post Counterparts ID Contacts Request Conflict Error

The specified counterpart is an individual and cannot have contacts.

- `error` (ErrorSchema, required)

### 422 Post Counterparts ID Contacts Request Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 429 Post Counterparts ID Contacts Request Too Many Requests Error

API rate limit has been exceeded. Check the response headers for the rate limit information.

- `any`

## Types

### CounterpartAddress

Address information.

- `city` (string, required) — City name.
- `country` (enum, required) — Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
  - Allowed values: `AF`, `AX`, `AL`, `DZ`, `AS`, `AD`, `AO`, `AI`, `AQ`, `AG`, `AR`, `AM`, `AW`, `AU`, `AT`, `AZ`, `BS`, `BH`, `BD`, `BB`, `BY`, `BE`, `BZ`, `BJ`, `BM`, `BT`, `BO`, `BA`, `BW`, `BV`, `BR`, `IO`, `BN`, `BG`, `BF`, `BI`, `KH`, `CM`, `CA`, `IC`, `CV`, `KY`, `CF`, `EA`, `TD`, `CL`, `CN`, `CX`, `CC`, `CO`, `KM`, `CG`, `CD`, `CK`, `CR`, `CI`, `HR`, `CU`, `CY`, `CZ`, `DK`, `DJ`, `DM`, `DO`, `EC`, `EG`, `SV`, `GQ`, `ER`, `EE`, `SZ`, `ET`, `FK`, `FO`, `FJ`, `FI`, `FR`, `GF`, `PF`, `TF`, `GA`, `GM`, `GE`, `DE`, `GH`, `GI`, `GR`, `GL`, `GD`, `GP`, `GU`, `GT`, `GG`, `GN`, `GW`, `GY`, `HT`, `HM`, `VA`, `HN`, `HK`, `HU`, `IS`, `IN`, `ID`, `IR`, `IQ`, `IE`, `IM`, `IL`, `IT`, `JM`, `JP`, `JE`, `JO`, `KZ`, `KE`, `KI`, `KP`, `KR`, `KW`, `KG`, `LA`, `LV`, `LB`, `LS`, `LR`, `LY`, `LI`, `LT`, `LU`, `MO`, `MG`, `MW`, `MY`, `MV`, `ML`, `MT`, `MH`, `MQ`, `MR`, `MU`, `YT`, `MX`, `FM`, `MD`, `MC`, `MN`, `ME`, `MS`, `MA`, `MZ`, `MM`, `NA`, `NR`, `NP`, `NL`, `AN`, `NC`, `NZ`, `NI`, `NE`, `NG`, `NU`, `NF`, `MP`, `MK`, `NO`, `OM`, `PK`, `PW`, `PS`, `PA`, `PG`, `PY`, `PE`, `PH`, `PN`, `PL`, `PT`, `PR`, `QA`, `RE`, `RO`, `RU`, `RW`, `SH`, `KN`, `LC`, `PM`, `VC`, `WS`, `SM`, `ST`, `SA`, `SN`, `RS`, `SC`, `SL`, `SG`, `SK`, `SI`, `SB`, `SO`, `ZA`, `SS`, `GS`, `ES`, `LK`, `SD`, `SR`, `SJ`, `SE`, `CH`, `SY`, `TW`, `TJ`, `TZ`, `TH`, `TL`, `TG`, `TK`, `TO`, `TT`, `TN`, `TR`, `TM`, `TC`, `TV`, `UG`, `UA`, `AE`, `GB`, `US`, `UM`, `UY`, `UZ`, `VU`, `VE`, `VN`, `VG`, `VI`, `WF`, `EH`, `YE`, `ZM`, `ZW`, `BL`, `BQ`, `CW`, `MF`, `SX`
- `line1` (string, required) — Street address.
- `postal_code` (string, required) — ZIP or postal code.
- `line2` (string, optional) — Additional address information (if any).
- `state` (string, optional) — State, county, province, prefecture, region, or similar component of the counterpart's address. For US counterparts, `state` is required and must be a two-letter [USPS state abbreviation](https://pe.usps.com/text/pub28/28apb.htm), for example, NY or CA.

### ErrorSchema

- `message` (string, required)

### ValidationError

- `loc` (list of ValidationErrorLocItem, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItem

## Examples

**Request**

```json
{
  "address": {
    "city": "Berlin",
    "country": "AF",
    "line1": "Flughafenstrasse 52",
    "postal_code": "10115"
  },
  "first_name": "Mary",
  "last_name": "O'Brien"
}
```

**Response**

```json
{
  "id": "id",
  "address": {
    "city": "Berlin",
    "country": "AF",
    "line1": "Flughafenstrasse 52",
    "postal_code": "10115",
    "line2": "line2",
    "state": "state"
  },
  "counterpart_id": "counterpart_id",
  "first_name": "Mary",
  "is_default": true,
  "last_name": "O'Brien",
  "email": "contact@example.org",
  "phone": "5551235476",
  "title": "Ms."
}
```

**SDK Code**

```python
import requests

url = "https://api.sandbox.monite.com/v1/counterparts/counterpart_id/contacts"

payload = {
    "address": {
        "city": "Berlin",
        "country": "AF",
        "line1": "Flughafenstrasse 52",
        "postal_code": "10115"
    },
    "first_name": "Mary",
    "last_name": "O'Brien"
}
headers = {
    "x-monite-version": "2024-05-25",
    "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.sandbox.monite.com/v1/counterparts/counterpart_id/contacts';
const options = {
  method: 'POST',
  headers: {
    'x-monite-version': '2024-05-25',
    'x-monite-entity-id': '9d2b4c8f-2087-4738-ba91-7359683c49a4',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"address":{"city":"Berlin","country":"AF","line1":"Flughafenstrasse 52","postal_code":"10115"},"first_name":"Mary","last_name":"O\'Brien"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sandbox.monite.com/v1/counterparts/counterpart_id/contacts"

	payload := strings.NewReader("{\n  \"address\": {\n    \"city\": \"Berlin\",\n    \"country\": \"AF\",\n    \"line1\": \"Flughafenstrasse 52\",\n    \"postal_code\": \"10115\"\n  },\n  \"first_name\": \"Mary\",\n  \"last_name\": \"O'Brien\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-monite-version", "2024-05-25")
	req.Header.Add("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.monite.com/v1/counterparts/counterpart_id/contacts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-monite-version"] = '2024-05-25'
request["x-monite-entity-id"] = '9d2b4c8f-2087-4738-ba91-7359683c49a4'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"address\": {\n    \"city\": \"Berlin\",\n    \"country\": \"AF\",\n    \"line1\": \"Flughafenstrasse 52\",\n    \"postal_code\": \"10115\"\n  },\n  \"first_name\": \"Mary\",\n  \"last_name\": \"O'Brien\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sandbox.monite.com/v1/counterparts/counterpart_id/contacts")
  .header("x-monite-version", "2024-05-25")
  .header("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"address\": {\n    \"city\": \"Berlin\",\n    \"country\": \"AF\",\n    \"line1\": \"Flughafenstrasse 52\",\n    \"postal_code\": \"10115\"\n  },\n  \"first_name\": \"Mary\",\n  \"last_name\": \"O'Brien\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sandbox.monite.com/v1/counterparts/counterpart_id/contacts', [
  'body' => '{
  "address": {
    "city": "Berlin",
    "country": "AF",
    "line1": "Flughafenstrasse 52",
    "postal_code": "10115"
  },
  "first_name": "Mary",
  "last_name": "O\'Brien"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'x-monite-entity-id' => '9d2b4c8f-2087-4738-ba91-7359683c49a4',
    'x-monite-version' => '2024-05-25',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.sandbox.monite.com/v1/counterparts/counterpart_id/contacts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-monite-version", "2024-05-25");
request.AddHeader("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"address\": {\n    \"city\": \"Berlin\",\n    \"country\": \"AF\",\n    \"line1\": \"Flughafenstrasse 52\",\n    \"postal_code\": \"10115\"\n  },\n  \"first_name\": \"Mary\",\n  \"last_name\": \"O'Brien\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-monite-version": "2024-05-25",
  "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "address": [
    "city": "Berlin",
    "country": "AF",
    "line1": "Flughafenstrasse 52",
    "postal_code": "10115"
  ],
  "first_name": "Mary",
  "last_name": "O'Brien"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sandbox.monite.com/v1/counterparts/counterpart_id/contacts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```