Introduction to the Customerly API

The Customerly API allows you to integrate your platform with Customerly's suite of customer support, marketing automation, and customer satisfaction tools. This document provides an overview of how to authenticate and interact with the API.

Authentication

To interact with the Customerly REST API, you must authenticate your requests using an access token.

Get Access Token

  1. Log in to Customerly.
  2. Follow the tutorial: How to Obtain Your API Access Token in Customerly.

Using Access Token

Include the access token as a Bearer token in the Authorization header of your HTTP requests:

Authorization: Bearer YOUR_ACCESS_TOKEN

Error Handling

When an error occurs, the API returns a JSON response with the following structure:

{
  "error": {
    "code": "error_code_here",
    "message": "A human-readable error description.",
    "http_status": 400,
    "details": { ... }
  }
}

The details field is optional and provides additional context when available (e.g., validation errors).

Example Error Response

{
  "error": {
    "code": "auth_missing_authorization_header",
    "message": "The Authorization header is missing.",
    "http_status": 401
  }
}

Error Codes Reference

Below is the complete list of error codes that may be returned by the API:

CodeDescription
account_email_not_verifiedThe account email is not verified.
account_not_foundAccount not found.
app_bannedThe application is banned.
app_insolventThe application is insolvent.
app_not_activeThe application is not active.
attachment_file_too_largeAttachment file size exceeds the maximum allowed (5MB).
attachment_too_many_filesToo many attachments.
attribute_invalid_formatOne or more attributes have invalid format. Attribute names must be alphanumeric (underscores and hyphens allowed), and values must be simple types (strings, numbers, booleans), not arrays or objects.
auth_invalid_access_tokenThe access token is invalid.
auth_missing_authorization_headerThe Authorization header is missing.
company_conflicting_identifiersThe provided identifiers point to different companies. Please provide only one identifier or ensure they all refer to the same company.
company_custom_company_id_requiredTo create a new company, custom_company_id is required.
company_identifier_requiredAt least one identifier (company_id or custom_company_id) is required.
company_invalid_filtersThe filters are invalid. Check the predicate structure, audience, and condition targets/operations.
company_not_foundCompany not found.
contact_cannot_merge_into_itselfA contact cannot be merged into itself. The surviving and victim contacts must be different.
contact_conflicting_identifiersThe provided identifiers point to different contacts. Please provide only one identifier or ensure they all refer to the same contact.
contact_identifier_requiredAt least one identifier (user_id, email, custom_contact_id, or whatsapp_number) is required.
contact_invalid_filtersThe filters are invalid. Check the predicate structure, audience, and condition targets/operations.
contact_is_spamCannot send messages from contacts marked as spam.
contact_merge_conflictOne of the contacts is already involved in an ongoing merge, or has already been merged into another contact. Wait for any pending merge to complete before retrying.
contact_not_foundContact not found.
conversation_access_deniedAccess to this conversation is denied.
conversation_assigned_to_aiCannot reply to a conversation assigned to AI. The conversation must be assigned to a human account first.
conversation_channel_not_supportedCannot reply to this conversation channel. Only email and in_app channels support replies via API.
conversation_email_channel_not_supportedThe email channel is not supported for conversation messages. You should verify domain to send email.
conversation_frozenThis conversation has been frozen and cannot accept new messages.
conversation_missing_content_or_attachmentsEither content or attachments must be provided for the conversation message.
conversation_not_foundThe conversation was not found.
conversation_not_open_for_snoozeOnly open conversations can be snoozed.
message_range_invalid_orderto must be greater than or equal to from.
message_range_exceededThe range between from and to exceeds the maximum allowed window.
document_not_foundThe document was not found.
document_currently_processingThe document is currently being processed and cannot be modified.
document_file_requiredA file is required for upload.
document_file_invalidThe uploaded file is invalid.
document_file_too_largeThe file size exceeds the maximum allowed (100MB).
document_file_type_not_allowedInvalid file type. Only PDF, Word and TXT documents are allowed.
document_conflicting_identifiersCannot specify both document_id and custom_document_id at the same time.
document_folder_not_foundThe document folder was not found.
document_folder_parent_not_foundThe parent folder was not found.
document_folder_destination_not_foundThe destination folder was not found.
document_folder_already_existsA document folder with this name or custom folder ID already exists.
document_folder_invalid_parentThe parent folder is invalid. Only root folders (without a parent) can be used as a parent.
document_folder_conflicting_identifiersCannot specify both folder_id and custom_folder_id at the same time.
document_folder_conflicting_folder_identifiersCannot specify both folder_id and polymorphic_folder_id at the same time.
event_invalid_formatThe event name is invalid. Event names must be alphanumeric (letters, numbers, and underscores only), cannot be empty, and cannot use the reserved prefix "customerly_".
knowledge_base_collection_not_foundThe knowledge base collection was not found.
knowledge_base_invalid_localeThe provided locale is invalid.
knowledge_base_locale_not_in_settingsThe locale is not configured in knowledge base settings.
knowledge_base_slug_conflictA collection or article with this slug already exists in this locale/collection.
knowledge_base_multi_locale_forbiddenMulti-locale feature is not available on your plan.
knowledge_base_parent_locale_mismatchParent collection must be in the same locale as the child collection.
knowledge_base_parent_too_deepCollections can only be nested up to 2 levels deep. The parent collection already has a parent.
knowledge_base_parent_missing_linked_localesThe new parent collection does not have linked collections for all the locales of the child linked collections.
knowledge_base_article_not_foundThe knowledge base article was not found.
knowledge_base_invalid_statusStatus must be 0 (draft) or 1 (published).
knowledge_base_invalid_writerThe writer account ID is invalid.
knowledge_base_writer_not_in_appThe writer must be a valid account in your app.
permission_deniedYou don't have permission to perform this action.
request_conflictConflict.
request_forbiddenForbidden.
request_length_requiredLength required.
request_lockedLocked.
request_method_not_allowedMethod not allowed.
request_not_acceptableNot acceptable.
request_not_foundNot found.
request_not_validThe request is not valid.
request_invalid_jsonThe request body contains invalid JSON.
request_body_must_be_objectThe request body must be a JSON object.
request_payment_requiredPayment required.
request_too_many_requestsToo many requests.
request_unauthorizedUnauthorized.
request_unprocessableUnprocessable entity.
segment_not_foundSegment not found.
segment_invalid_filtersThe filters are invalid. Check the predicate structure, audience, and condition targets/operations.
segment_circular_dependencyThe segment cannot be saved: a circular dependency was detected between segments.
segment_deletion_in_progressThe segment is already being deleted.
segment_used_as_filterThe segment cannot be deleted because it is used as a filter in other segments, workflows, surveys, or automations. Remove the dependencies first.
server_internal_errorAn internal server error occurred, please try again later.
team_not_foundTeam not found.
validation_field_requiredThis field is required.
validation_invalid_emailThe email address is invalid.
validation_invalid_lengthThe field length is invalid.
validation_invalid_typeThe field type is invalid.
validation_invalid_valueThe field value is invalid.
validation_invalid_whatsapp_numberThe WhatsApp number is invalid. It must be in the format +123456789.
validation_invalid_user_include_parameterThe user include parameter is invalid. Valid options are: events, companies, segments, notes.