Contacts
The contacts API endpoints allow you to provision and manage individual or organizational registrant and contact records for domains on your ola.cv account. On this page, we'll dive into the different contact endpoints you can use to manage contacts programmatically. We'll look at how to query, create, update, and delete contacts.
The contact model
The contact model contains all the information about your contacts, such as their name, email, phone number and street address.
Properties
- Name
id- Type
- string
- Description
Unique identifier for the contact.
- Name
name- Type
- string
- Description
The full name for the contact.
- Name
email- Type
- string
- Description
The email for the contact.
- Name
phone- Type
- string
- Description
The phone number for the contact.
- Name
fax- Type
- string|null
- Description
The fax number for the contact.
- Name
organization- Type
- string|null
- Description
The contact's organization or company name.
- Name
address- Type
- string
- Description
The contact's physical or street address.
- Name
city- Type
- string
- Description
The contact's city.
- Name
state- Type
- string|null
- Description
The contact's state or province.
- Name
postcode- Type
- string
- Description
The contact's postcode / zip code / postal code.
- Name
country- Type
- string
- Description
The contact's country specified in the 2-letter ISO 3166 format e.g US for United States of America.
- Name
created_at- Type
- timestamp
- Description
Timestamp of when the contact was created.
- Name
updated_at- Type
- timestamp
- Description
Timestamp of when the contact was last updated.
List all contacts
This endpoint allows you to retrieve a paginated list of all your contacts. By default, a maximum of 20 contacts are shown per page.
Optional attributes
- Name
page- Type
- integer
- Description
The page to retrieve contact records for.
- Name
per_page- Type
- integer
- Description
The number of records to retrieve per page.
Request
curl https://ola.cv/api/v1/contacts \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {token}' \
-H 'Content-Type: application/json'
Response
{
"data": [
{
"id": "359384716146888704",
"name": "John Doe",
"email": "jdoe@example.com",
"phone": "+1 818 3000006",
"fax": null,
"organization": "Acme, Inc.",
"address": "124, Bourdillon Boulevard",
"city": "Round Rock",
"state": null,
"postcode": "78000",
"country": "US",
"password": null,
"created_at": "2024-07-24T11:20:24+00:00",
"updated_at": "2024-07-24T11:20:24+00:00"
},
{
"id": "359384716146888780",
"name": "Jane Doe",
"email": "jdoe@example.com",
"phone": "+1 818 3000009",
"fax": null,
"organization": "Acme, Inc.",
"address": "124, Bourdillon Boulevard",
"city": "Round Rock",
"state": null,
"postcode": "78000",
"country": "US",
"password": null,
"created_at": "2024-07-24T11:20:24+00:00",
"updated_at": "2024-07-24T11:20:24+00:00"
},
],
"meta": {
"current_page": 1,
"first_page_url": "https://ola.cv/api/v1/contacts?page=1",
"next_page_url": null,
"path": "https://ola.cv/api/v1/contacts",
"per_page": 20,
"prev_page_url": null,
},
"message": "Contacts retrieved successfully."
}
Create a contact
This endpoint allows you to add a new contact to your contact list on ola.cv. To add a contact, you may provide attributes:
Required attributes
- Name
name- Type
- string
- Description
The full name for the contact.
- Name
email- Type
- string
- Description
The email for the contact.
- Name
phone- Type
- string
- Description
The phone number for the contact.
- Name
address- Type
- string
- Description
The contact's physical or street address.
- Name
city- Type
- string
- Description
The contact's city.
- Name
postcode- Type
- string
- Description
The contact's postcode / zip code / postal code.
- Name
country- Type
- string
- Description
The contact's country specified in the 2-letter ISO 3166 format e.g US for United States of America.
Optional attributes
- Name
fax- Type
- string
- Description
The fax number for the contact.
- Name
organization- Type
- string
- Description
The contact's organization or company name.
- Name
state- Type
- string
- Description
The contact's state or province.
Request
curl https://ola.cv/api/v1/contacts \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {token}' \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"name": "John Doe",
"email": "jdoe@example.com",
"phone": "+1 818 3000006",
"organization": "Acme, Inc.",
"address": "124, Bourdillon Boulevard",
"city": "Round Rock",
"postcode": "78000",
"country": "US"
}'
Response
{
"data": {
"id": "359384716146888780",
"name": "John Doe",
"email": "jdoe@example.com",
"phone": "+1 818 3000006",
"fax": null,
"organization": "Acme, Inc.",
"address": "124, Bourdillon Boulevard",
"city": "Round Rock",
"state": null,
"postcode": "78000",
"country": "US",
"password": null,
"created_at": "2024-07-24T11:20:24+00:00",
"updated_at": "2024-07-24T11:20:24+00:00"
},
"message": "Contact created successfully."
}
Retrieve a contact
This endpoint allows you to retrieve a contact by providing their ola.cv ID. Refer to the list at the top of this page to see which properties are included with contact objects.
Request
curl https://ola.cv/api/v1/contacts/359384716146888780 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {token}' \
-H 'Content-Type: application/json'
Response
{
"data": {
"id": "359384716146888780",
"name": "John Doe",
"email": "jdoe@example.com",
"phone": "+1 818 3000006",
"fax": null,
"organization": "Acme, Inc.",
"address": "124, Bourdillon Boulevard",
"city": "Round Rock",
"state": null,
"postcode": "78000",
"country": "US",
"password": null,
"created_at": "2024-07-24T11:20:24+00:00",
"updated_at": "2024-07-24T11:20:24+00:00"
},
"message": "Contact retrieved successfully."
}
Update a contact
This endpoint allows you to perform an update on a contact. Reference the create contact endpoint for all the allowed attributes.
Request
curl https://ola.cv/api/v1/contacts/359384716146888780 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {token}' \
-H 'Content-Type: application/json' \
-X PATCH \
-d '{
"name": "John Doe",
"email": "jdoe@example.com",
"phone": "+1 818 3000006",
"organization": "Acme, Inc.",
"address": "124, Bourdillon Boulevard",
"city": "Round Rock",
"postcode": "78000",
"country": "US"
}'
Response
{
"data": {
"id": "359384716146888780",
"name": "John Doe",
"email": "jdoe@example.com",
"phone": "+1 818 3000006",
"fax": null,
"organization": "Acme, Inc.",
"address": "124, Bourdillon Boulevard",
"city": "Round Rock",
"state": null,
"postcode": "78000",
"country": "US",
"password": null,
"created_at": "2024-07-24T11:20:24+00:00",
"updated_at": "2024-07-24T11:20:24+00:00"
},
"message": "Contact updated successfully."
}
Delete a contact
This endpoint allows you to delete contacts from your contact list on ola.cv. Note: You cannot delete a contact that is currently a registrant for or linked to any of your domains.
Request
curl -X DELETE https://ola.cv/api/v1/contacts/359384716146888780 \
-H "Authorization: Bearer {token}"
Response
{
"data": {
"id": "359384716146888780"
},
"message": "Contact deleted successfully."
}