HostingAddressbooks & contacts
Create contact
POST
/api/addressbooks/{code}/{addressbook_id}/contactsCreates a new contact in an addressbook.
Authorization
api_key X-Api-Token<token>
API token used to authenticate requests.
In: header
Path Parameters
code*string
Email account code: usually EA followed by 8 digits. Postmaster accounts use P followed by 9 digits. Examples: EA12345678, P123456789.
addressbook_id*integer
Format
int32Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
given_name?string
Contact given name.
surname?string
Contact surname.
fullname?string
Contact full name.
title?string
Contact title.
nickname?string
Contact nickname.
company_name?string
Contact company name.
phone_numbers?object[]
Array item: object
value?string
Phone number value.
type?string
Phone number type.
work= work contact field.home= home or personal contact field.cell= mobile phone number.home fax= home fax number.work fax= work fax number.
Default
homeValues work | home | cell | home fax | work faxemails?object[]
Array item: object
value?string
Email address value.
type?string
Email address type.
work= work contact field.home= home or personal contact field.
Default
homeValues work | homeurl?object[]
Array item: object
value?string
URL value.
type?string
URL type.
work= work contact field.home= home or personal contact field.
Default
homeValues work | homeaddresses?object[]
Array item: object
street_address?string
Street address.
city?string
City.
postal_code?string
Postal code.
region?string
Region/state.
country?string
Country.
type?string
Address type.
work= work contact field.home= home or personal contact field.
Default
homeValues work | homenotes?string
Contact notes. Use escaped line breaks (\n) for newlines.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/addressbooks/string/0/contacts" \ -H "X-Api-Token: YOUR_API_TOKEN" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{}'{
"message": "string",
"resource_code": "string"
}{
"message": "Unauthorized",
"errors": []
}{
"message": "Forbidden",
"errors": []
}{
"message": "Not found",
"errors": []
}{
"message": "Validation failed",
"errors": [
{
"field": "name",
"description": "is not valid"
}
]
}