Constant Contact Contacts API
Endpoints and methods to get, create, delete, and update one or more contacts.
Endpoints and methods to get, create, delete, and update one or more contacts.
swagger: '2.0'
info:
description: The Constant Contact, Inc. V3 public API, for building integrations with Constant Contact, the leading small-business email marketing platform.
version: 3.0.149
title: AppConnect V3 Account Services Contacts API
contact:
name: webservices@constantcontact.com
license:
name: Private
url: https://www.constantcontact.com/legal/terms-of-use
host: api.cc.email
basePath: /v3
schemes:
- https
consumes:
- application/json
produces:
- application/json
tags:
- name: Contacts
description: Endpoints and methods to get, create, delete, and update one or more contacts.
paths:
/contacts/{contact_id}:
get:
tags:
- Contacts
summary: GET a Contact
description: This endpoint GETs a specific contact resource (contact_id). Use the `include` query parameter to add any of the available contact sub-resources to the response payload.
operationId: getContact
produces:
- application/json
parameters:
- name: contact_id
in: path
description: Unique ID of contact to GET
required: true
type: string
x-example: 04fe9a-a579-43c5-bb1a-58ed29bf0a6a
- name: include
in: query
description: 'Use `include` to specify which contact sub-resources to include in the response. Use a comma to separate multiple sub-resources. Valid values: `custom_fields`, `list_memberships`, `phone_numbers`, `street_addresses`, `notes`, and `taggings`.'
required: false
type: string
format: csv
enum:
- custom_fields
- list_memberships
- phone_numbers
- street_addresses
- taggings
- notes
x-example: custom_fields,list_memberships
responses:
'200':
description: Request successful
schema:
$ref: '#/definitions/ContactResource'
'400':
description: Bad request. Either the JSON was malformed or there was a data validation error.
'401':
description: The Access Token used is invalid.
'403':
description: Forbidden request. You lack the necessary scopes, you lack the necessary user privileges, or the application is deactivated.
'404':
description: The requested resource was not found.
'500':
description: There was a problem with our internal service.
'503':
description: Our internal service is temporarily unavailable.
security:
- oauth2_implicit:
- contact_data
- oauth2_access_code:
- contact_data
x-authorization-privileges:
- contacts:read
x-sdk-methodName: getContactById
put:
tags:
- Contacts
summary: PUT (update) a Contact
description: "The PUT method updates an existing contact. You must include the `update_source` property in the PUT request payload. To restore a deleted contact you must specify the `update_source` as `Account`. When updating any resource using PUT, all properties are updated, overwriting all previous values. Any properties left blank or not included in the request are overwritten with null value - however this does not apply to contact subresources. \n\nAdd or change any of the subresources by including them in the PUT request payload. Omitted subresources are not overwritten with null. If the contact being updated is deleted, the contact will be revived.\nIf `email_address` is specified: <div class=\"Msg\"><p class=\"note-text\"> **Only use this method when a contact gives you their explicit permission to send them an email. It is a violation of anti-spam and telemarketing laws, as well as a serious violation of the Constant Contact Terms of Service to use the Opt-in features of the API to opt a contact back in without his or her own action and consent.</p></div>\n\nIf `sms_channel` is specified: <div class=\"Msg\"><p class=\"note-text\">Only use this method when a contact gives you their explicit permission to send them an SMS. It is a violation of anti-spam and telemarketing laws, as well as a serious violation of the Constant Contact Terms of Service to use the Opt-in features of the API to opt a contact back in without his or her own action and consent.</p></div>"
operationId: putContact
consumes:
- application/json
produces:
- application/json
parameters:
- name: contact_id
in: path
description: Unique ID of contact to update
required: true
type: string
x-example: 04fe9a-a579-43c5-bb1a-58ed29bf0a6a
- in: body
name: body
description: JSON payload defining the contact object, with updates. Any properties left blank or not included in the PUT payload are overwritten with null value - does not apply to contact subresources.
required: true
schema:
$ref: '#/definitions/ContactPutRequest'
responses:
'200':
description: Contact resource has been updated
schema:
$ref: '#/definitions/ContactResource'
'400':
description: Bad request. Either the JSON was malformed or there was a data validation error.
'401':
description: The Access Token used is invalid.
'403':
description: Forbidden request. You lack the necessary scopes, you lack the necessary user privileges, or the application is deactivated.
'404':
description: The requested resource was not found.
'409':
description: Conflict. The resource you are creating or updating conflicts with an existing resource.
'500':
description: There was a problem with our internal service.
'503':
description: Our internal service is temporarily unavailable.
security:
- oauth2_implicit:
- contact_data
- oauth2_access_code:
- contact_data
x-authorization-privileges:
- contacts:write
x-sdk-methodName: updateContact
delete:
tags:
- Contacts
summary: DELETE a Contact
description: Deletes the contact identified by the contact_id path parameter. Deleted contacts won't receive email from you, and they don't count as active contacts. Unlike unsubscribed contacts, deleted contacts can be revived, or added back to an account. Learn how to [revive deleted contacts](/api_guide/contacts_delete.html#revive).
operationId: deleteContact
consumes:
- application/json
produces:
- application/json
parameters:
- name: contact_id
in: path
description: Unique ID of contact to DELETE
required: true
type: string
x-example: 04fe9a-a579-43c5-bb1a-58ed29bf0a6a
responses:
'204':
description: Request successful; No content returned
'400':
description: Bad request. Either the JSON was malformed or there was a data validation error.
'401':
description: The Access Token used is invalid.
'403':
description: Forbidden request. You lack the necessary scopes, you lack the necessary user privileges, or the application is deactivated.
'404':
description: The requested resource was not found.
'415':
description: Unsupported Media Type.
'500':
description: There was a problem with our internal service.
'503':
description: Our internal service is temporarily unavailable.
security:
- oauth2_implicit:
- contact_data
- oauth2_access_code:
- contact_data
x-authorization-privileges:
- contacts:write
/contacts:
get:
tags:
- Contacts
summary: GET Contacts Collection
description: 'Use this method to return a collection of contacts. Use the query parameters to search for contacts that match specific contact properties and sub-resource properties as criteria. For example, you can search using the contact''s `email` address, `lists` memberships, and by the date range that a contact was created or updated. Use the `limit` query parameter to limit the number of results returned per page. Use the `include` query parameter to include contact sub-resources in the response and `include_count` to include the total number of contacts that meet your specified search criteria.
By default, this method returns all contacts that are not deleted. Use the `status` query parameter with the value `all` to return all contacts including deleted contacts.'
operationId: getContacts
produces:
- application/json
parameters:
- name: status
in: query
description: 'Use the `status` query parameter to search for contacts by status. This parameter accepts one or more comma separated values: `all`, `active`, `deleted`, `not_set`, `pending_confirmation`, `temp_hold`, and `unsubscribed`.'
required: false
type: string
format: csv
enum:
- all
- active
- deleted
- not_set
- pending_confirmation
- temp_hold
- unsubscribed
- name: email
in: query
description: Use the `email` query parameter to search for a contact using a specific email address.
required: false
type: string
x-example: xyz@example.com
- name: lists
in: query
description: Use the `lists` query parameter to search for contacts that are members of one or more specified lists. Use a comma to separate multiple `list_id` values, up to a maximum of 25.
required: false
type: string
maximum: 25
x-example: 04fe9a-a579-43c5-bb1a-58ed29bf0a6a,04fe9a-a579-43c5-bb1a-58ed29bf0a6a,04fe9a-a579-43c5-bb1a-58ed29bf0a6a
- name: segment_id
in: query
description: Use to get contacts that meet the segment criteria for a single specified `segment_id`. This query parameter can only be combined with the limit query parameter. When using the `segment_id` query parameter, the V3 API may return a 202 response code instead of a 200 response. The 202 response code indicates that your request has been accepted, but not fully completed. Retry sending your API request to return the completed results and a 200 response code.
required: false
type: string
maximum: 1
x-example: '14'
- name: tags
in: query
description: Use to get contact details for up to 50 specified tags. Use a comma to separate each `tag_id`.
required: false
type: string
maximum: 50
format: uuid
x-example: fa85f64-5717-4562-b3fc-2c963f66afa6
- name: updated_after
in: query
description: Use `updated_after` to search for contacts that have been updated after the date you specify. To search for updated contacts within a date range, specify both `updated_after` and `updated_before` dates. Accepts ISO-8601 formatted dates.
required: false
type: string
format: date-time
x-example: '2022-01-01T16:37:59.091Z'
- name: updated_before
in: query
description: Use `updated_before` to search for contacts that have been updated before a specified date. To search for updated contacts within a date range, specify both `updated_after` and `updated_before` dates. Accepts ISO-8601 formatted dates.
required: false
type: string
format: date-time
x-example: '2022-07-16T16:37:59.091Z'
- name: created_after
in: query
description: Use `created_after` to search for contacts created after a specified date. To search for contacts created within a date range, specify both `created_after` and `created_before` dates. Accepts ISO-8601 formatted dates.
required: false
type: string
format: date-time
x-example: '2021-01-01T16:37:59.091Z'
- name: created_before
in: query
description: Use `created_before` to search for contacts created before a specified date. To search for contacts created within a date range, specify both `created_after` and `created_before` dates. Accepts ISO-8601 formatted dates.
required: false
type: string
format: date-time
x-example: '2022-07-16T16:37:59.091Z'
- name: optout_after
in: query
description: Use `optout_after` to search for contacts that unsubscribed after a specified date.
required: false
type: string
format: date-time
x-example: '2022-11-16T16:20:59.091Z'
- name: optout_before
in: query
description: Use `optout_before` to search for contacts that unsubscribed before a specified date.
required: false
type: string
format: date-time
x-example: '2022-11-16T16:20:59.091Z'
- name: include
in: query
description: 'Use `include` to specify which contact sub-resources to include in the response. Use a comma to separate multiple sub-resources. Valid values: `custom_fields`, `list_memberships`, `taggings`, `notes`,`phone_numbers`, `street_addresses`.'
required: false
type: string
format: csv
enum:
- custom_fields
- list_memberships
- phone_numbers
- street_addresses
- taggings
- notes
x-example: custom_fields,list_memberships
- name: sms_status
in: query
description: 'Use to get contacts by their SMS status. This parameter accepts one or more comma separated values: `all`, `explicit`, `unsubscribed`, `pending_confirmation`, `not_set`.'
required: false
type: string
format: csv
enum:
- all
- explicit
- unsubscribed
- pending_confirmation
- not_set
- name: include_count
in: query
description: Set `include_count=true` to include the total number of contacts (`contacts_count`) that meet all search criteria in the response body.
required: false
type: boolean
x-example: 'true'
- name: limit
in: query
description: Specifies the number of results displayed per page of output in the response, from 1 - 500, default = 50.
required: false
type: integer
default: 50
maximum: 500
minimum: 1
x-example: 25
responses:
'200':
description: Request successful
schema:
$ref: '#/definitions/Contacts'
'202':
description: Accepted
schema:
$ref: '#/definitions/Contacts'
'400':
description: Bad request. Either the JSON was malformed or there was a data validation error.
'401':
description: The Access Token used is invalid.
'403':
description: Forbidden request. You lack the necessary scopes, you lack the necessary user privileges, or the application is deactivated.
'404':
description: The requested resource was not found.
'500':
description: There was a problem with our internal service.
'503':
description: Our internal service is temporarily unavailable.
security:
- oauth2_implicit:
- contact_data
- oauth2_access_code:
- contact_data
x-authorization-privileges:
- contacts:read
x-sdk-methodName: getAllContacts
post:
tags:
- Contacts
summary: POST (create) a Contact
description: '
Creates a new contact resource. You must include the `create_source` property and at least one of the following properties: `first_name`, `last_name`, a unique `email_address` (specified using the `EmailAddress` object), or the `sms_channel` property (specified using the `ContactSmsChannel` object).
<div class="Msg"><p class="note-text">If `email_address` is specified: **Only use this method when a contact gives you their explicit permission to send them an email. It is a violation of anti-spam and telemarketing laws, as well as a serious violation of the Constant Contact Terms of Service to use the Opt-in features of the API to opt a contact back in without his or her own action and consent.</p></div>
If `sms_channel` is specified: <div class="Msg"><p class="note-text">Only use this method when a contact gives you their explicit permission to send them an SMS. It is a violation of anti-spam and telemarketing laws, as well as a serious violation of the Constant Contact Terms of Service to use the Opt-in features of the API to opt a contact back in without his or her own action and consent.</p></div>'
operationId: createContact
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
description: The JSON payload defining the contact
required: true
schema:
$ref: '#/definitions/ContactPostRequest'
responses:
'201':
description: New contact successfully created
schema:
$ref: '#/definitions/ContactResource'
'400':
description: Bad request. Either the JSON was malformed or there was a data validation error.
'401':
description: The Access Token used is invalid.
'403':
description: Forbidden request. You lack the necessary scopes, you lack the necessary user privileges, or the application is deactivated.
'409':
description: Conflict. The resource you are creating or updating conflicts with an existing resource.
'415':
description: Unsupported Media Type; the payload must be in JSON format, and Content-Type must be application/json
'500':
description: There was a problem with our internal service.
'503':
description: Our internal service is temporarily unavailable.
security:
- oauth2_implicit:
- contact_data
- oauth2_access_code:
- contact_data
x-authorization-privileges:
- contacts:write
/contacts/sign_up_form:
post:
tags:
- Contacts
summary: Create or Update a Contact
description: "Use this method to create a new contact or update an existing contact. In the request body, this method requires including the `list_memberships` array as well as either the contact's `email_address` string or `sms_channel` object which includes the contact's SMS number. The information you specify determines if a new contact is either created (the email address or SMS number does not already exist in the account), or if an existing contact is updated (the email address or SMS number already exists). The SMS product feature does not need to be enabled to include a contacts SMS details.\n\nUpdates to existing contacts are partial updates. This method only updates the contact properties you include in the request body. Updates append new contact lists or custom fields to the existing `list_memberships` or `custom_fields` arrays.\n\nIf `email_address` is specified: <div class=\"Msg\"><p class=\"note-text\">Only use this method when a contact gives you their explicit permission to send them an email. It is a violation of anti-spam and telemarketing laws, as well as a serious violation of the Constant Contact Terms of Service to use the Opt-in features of the API to opt a contact back in without his or her own action and consent.</p></div>\n\nIf `sms_channel` is specified: <div class=\"Msg\"><p class=\"note-text\">Only use this method when a contact gives you their explicit permission to send them an SMS. It is a violation of anti-spam and telemarketing laws, as well as a serious violation of the Constant Contact Terms of Service to use the Opt-in features of the API to opt a contact back in without his or her own action and consent.</p></div>\n\nWhen this method creates a new contact, it returns a 201 response code.When this method updates an existing contact, it returns a 200 response code. Updating a deleted contact restores the contact.\n\nThe method automatically modifies the contact's `permission_to_send` and `opt_in_source` properties depending on the [Confirmed Opt-In](https://knowledgebase.constantcontact.com/articles/KnowledgeBase/5533-obtain-permission-to-send-email-campaigns-to-your-contacts-by-using-confirmed-opt-in) Constant Contact account setting:\n\nIf Confirmed Opt-in is _enabled_, this method automatically sets the `permission_to_send` property as `pending_confirmation` for new contacts. If Confirmed Opt-in is _disabled_, this method automatically sets the `permission_to_send` property as explicit and the `opt_in_source` property as `Contact` for new contacts. Updated contacts have their `permission_to_send` property set as explicit.\n "
operationId: createOrUpdateContact
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
description: A JSON request body payload that contains the contact resource you are creating or updating. The request body must contain the `email_address` property and `list_memberships` array, or the `sms_channel` object.
required: true
schema:
$ref: '#/definitions/ContactCreateOrUpdateInput'
responses:
'200':
description: Contact successfully updated.
schema:
$ref: '#/definitions/ContactCreateOrUpdateResponse'
'201':
description: Contact successfully created.
schema:
$ref: '#/definitions/ContactCreateOrUpdateResponse'
'400':
description: Bad request. Either the JSON was malformed or there was a data validation error.
'401':
description: The Access Token used is invalid.
'403':
description: Forbidden request. You lack the necessary scopes, you lack the necessary user privileges, or the application is deactivated.
'404':
description: The requested resource was not found.
'409':
description: Conflict. You sent simultaneous requests that are attempting to modify the same contact.
'500':
description: There was a problem with our internal service.
'503':
description: Our internal service is temporarily unavailable.
security:
- oauth2_implicit:
- contact_data
- oauth2_access_code:
- contact_data
x-authorization-privileges:
- contacts:write
/contacts/contact_id_xrefs:
get:
tags:
- Contacts
summary: GET a collection of V2 and V3 API contact IDs
description: '<div class="Msg Msg--warning"><p class="note-text">Use this endpoint to migrate your locally stored V2 contact ids to the new V3 format. Developers are expected to use this endpoint sparingly. This endpoint is NOT intended for regular or repeated use. Constant Contact will eventually deprecate and remove this endpoint.</p></div>
This GET call retrieves a collection of cross-referenced contact sequence IDs (`id` used in the V2 API) and UUIDs (`contact_id` used in the V3 API). This endpoint is intended for developers who have an existing V2 API integration, and are migrating their users to a new V3 API integration. The V2 and V3 APIs use different resource ID formats. Use the `sequence_ids` query parameter to specify a set of comma delimited V2 contacts ids to cross-referenced with their V3 `contact_ids`. See [Migrating to V3](/api_guide/migration_overview.html) to learn more.'
operationId: getContactIdXrefs
produces:
- application/json
parameters:
- name: sequence_ids
in: query
description: Comma delimited list of V2 API contact `ids` to cross-reference with the V3 API `contact_id` value. Endpoint accepts a maximum of 500 ids at a time.
required: true
type: string
maxItems: 500
format: csv
x-example: 1995998026,1882999944,1775099999
responses:
'200':
description: Request successful
schema:
$ref: '#/definitions/ContactXrefs'
'400':
description: Bad request. Either the JSON was malformed or there was a data validation error.
'401':
description: The Access Token used is invalid.
'403':
description: Forbidden request. You lack the necessary scopes, you lack the necessary user privileges, or the application is deactivated.
'404':
description: The requested resource was not found.
'500':
description: There was a problem with our internal service.
'503':
description: Our internal service is temporarily unavailable.
security:
- oauth2_implicit:
- contact_data
- oauth2_access_code:
- contact_data
x-authorization-privileges:
- contacts:read
/contacts/sms_engagement_history/{contact_id}:
get:
tags:
- Contacts
summary: GET SMS Engagement History for a Contact
description: Use this method to return SMS engagement details for a contact, such as SMS consent and advertising frequency details.
operationId: getSmsEngagementHistory
consumes:
- application/json
produces:
- application/json
parameters:
- name: contact_id
in: path
description: The contact's unique ID.
required: true
type: string
x-example: 04fe9a-a579-43c5-bb1a-58ed29bf0a6a
responses:
'200':
description: Request successful
schema:
$ref: '#/definitions/SmsEngagementHistory'
'400':
description: Bad request. Either the JSON was malformed or there was a data validation error.
'401':
description: The Access Token used is invalid.
'403':
description: Forbidden request. You lack the necessary scopes, you lack the necessary user privileges, or the application is deactivated.
'404':
description: The requested resource was not found.
'500':
description: There was a problem with our internal service.
'503':
description: Our internal service is temporarily unavailable.
security:
- oauth2_implicit:
- contact_data
- oauth2_access_code:
- contact_data
x-authorization-privileges:
- contacts:read
/contacts/counts:
get:
tags:
- Contacts
summary: GET Contact Consent Counts
description: Use to get the total contacts count for the account and the total contact-consent counts for each consent state. Optionally, to include the total number of contacts that subscribed within the last 30 days in the results, use `new_subscribers` in the `include` query parameter. To optimize open rates, reduce spam reports, and help grow your business, you must value your contact's consent to receive or to not receive your emails.
operationId: countContact
consumes:
- application/json
produces:
- application/json
parameters:
- name: include
in: query
description: Use to return the total number of contacts that subscribed within the last 30 days in the results.
required: false
type: string
enum:
- new_subscriber
x-example: new_subscriber
responses:
'200':
description: Request successful
schema:
$ref: '#/definitions/ContactsCounts'
'400':
description: Bad request. Either the JSON was malformed or there was a data validation error.
'401':
description: The Access Token used is invalid.
'403':
description: Forbidden request. You lack the necessary scopes, you lack the necessary user privileges, or the application is deactivated.
'404':
description: The requested resource was not found.
'500':
description: There was a problem with our internal service.
'503':
description: Our internal service is temporarily unavailable.
security:
- oauth2_implicit:
- contact_data
- oauth2_access_code:
- contact_data
x-authorization-privileges:
- contacts:read
x-sdk-methodName: getContactCounts
/contacts/resubscribe/{contact_id}:
put:
tags:
- Contacts
summary: PUT Resubscribe a Contact
description: 'Use this endpoint to send a confirmation resubscribe email to a contact in order to get their confirmation to resubscribe. This endpoint also adds the resubscribed contact to the contact lists you specify in the request body. You can only send a resubscribe email to the unsubscribed contact once. The contact is not resubscribed until after you receive their confirmation. '
operationId: resubscribeContact
produces:
- application/json
parameters:
- name: contact_id
in: path
description: The ID that uniquely identifies the contact to resubscribe.
required: true
type: string
x-example: 04fe9a-a579-43c5-bb1a-58ed29bf0a6a
- in: body
name: body
description: The JSON payload used to specify one (or more) contact lists to which the contact requested to be resubscribed.
required: true
schema:
$ref: '#/definitions/ContactResubscribeRequest'
x-example: 50429486-338f-11ed-a355-fa163ef30863
responses:
'200':
description: Contact resource has been updated.
'400':
description: Bad request. Either the JSON was malformed or there was a data validation error.
'401':
description: The Access Token used is invalid.
'403':
description: Forbidden request. You lack the necessary scopes, you lack the necessary user privileges, or the application is deactivated.
'404':
description: The requested resource was not found.
'409':
description: Conflict. The resource you are creating or updating conflicts with an existing resource.
'500':
description: There was a problem with our internal service.
'503':
description: Our internal service is temporarily unavailable.
security:
- oauth2_implicit:
- contact_data
- oauth2_access_code:
- contact_data
x-authorization-privileges:
- contacts:write
definitions:
ContactResource:
type: object
properties:
contact_id:
type: string
format: uuid
example: 1618ae62-4752-11e9-9c8a-fa163e6b01c1
description: Unique ID for each contact resource
readOnly: true
email_address:
$ref: '#/definitions/EmailAddress'
first_name:
type: string
example: Debora
description: The first name of the contact.
maxLength: 50
last_name:
type: string
example: Lang
description: The last name of the contact.
maxLength: 50
job_title:
type: string
example: Musician
description: The job title of the contact.
maxLength: 50
company_name:
type: string
example: Acme Corp.
description: The name of the company where the contact works.
maxLength: 50
birthday_month:
type: integer
example: 11
description: The month value for the contact's birthday. Valid values are from 1 through 12. You must use this property with <code>birthday_month</code>.
birthday_day:
type: integer
example: 24
description: The day value for the contact's birthday. Valid values are from 1 through 12. You must use this property with <code>birthday_day</code>.
anniversary:
type: string
example: '2006-11-15'
description: The anniversary date for the contact. For example, this value could be the date when the contact first became a customer of an organization in Constant Contact. Valid date formats are MM/DD/YYYY, M/D/YYYY, YYYY/MM/DD, YYYY/M/D, YYYY-MM-DD, YYYY-M-D,M-D-YYYY, or M-DD-YYYY.
maxLength: 10
update_source:
type: string
example: Contact
description: Identifies who last updated the contact; valid values are <code>Contact</code> or <code>Account</code>.
create_source:
type: string
example: Account
description: Describes who added the contact; valid values are <code>Contact</code> or <
# --- truncated at 32 KB (73 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/constant-contact/refs/heads/main/openapi/constant-contact-contacts-api-openapi.yml