> For the complete documentation index, see [llms.txt](https://docs.usepylon.com/pylon-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usepylon.com/pylon-docs/developer/api/api-reference/contacts.md).

# Contacts

## Get all contacts

> Returns a paginated list of contacts for the organization.\
> \
> \*\*Rate limit:\*\* 60 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetContactsResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetContactsResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetContactsResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/Contact"},"type":"array"},"pagination":{"$ref":"#/components/schemas/Pagination"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"},"Contact":{"properties":{"account":{"$ref":"#/components/schemas/MiniAccount"},"avatar_url":{"description":"Avatar URL of the contact.","type":"string"},"custom_fields":{"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom field values associated with the contact.","type":"object"},"email":{"description":"The primary email of the contact, if it exists.","type":"string"},"emails":{"description":"The list of all emails of the contact.","items":{"type":"string"},"type":"array"},"external_ids":{"description":"External IDs associated with the contact.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"id":{"description":"The ID of the contact.","type":"string"},"integration_user_ids":{"description":"Integration user IDs linking this contact to external systems.","items":{"$ref":"#/components/schemas/IntegrationUserID"},"type":"array"},"name":{"description":"The name of the contact.","type":"string"},"phone_numbers":{"description":"The list of all phone numbers of the contact.","items":{"type":"string"},"type":"array"},"portal_role":{"description":"Portal role slug assigned to the contact. For backwards compatibility.","enum":["no_access","member","admin"],"type":"string"},"portal_role_id":{"description":"The ID of the custom portal role assigned to the contact.","type":"string"},"primary_phone_number":{"description":"The primary phone number of the contact, if it exists.","type":"string"}},"type":"object"},"MiniAccount":{"properties":{"external_ids":{"description":"External IDs associated with the account.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"id":{"description":"The ID of the account.","type":"string"}},"type":"object"},"ExternalID":{"properties":{"external_id":{"description":"The external ID. Must be unique per object type (ex. account).","type":"string"},"label":{"description":"The label of the external ID. Must be unique per object.","type":"string"}},"type":"object"},"CustomFieldValue":{"properties":{"slug":{"description":"The slug of the custom field.","type":"string"},"value":{"description":"The value of the custom field. Only to be used for single-valued custom fields. If unset, the custom field will be unset. If the custom field is a select field, the value must be the select option slug, which you can find from the GET /custom-fields endpoint. If the custom field is a relationship field, the value must be the related object ID.","type":"string"},"values":{"description":"The values of the custom field. Only to be used for multi-valued custom fields (ex. multiselect). If unset, the custom field will be unset. If the custom field is a multiselect field, the values must be the select option slugs which you can find from the GET /custom-fields endpoint.","items":{"type":"string"},"type":"array"}},"type":"object"},"IntegrationUserID":{"properties":{"id":{"description":"The user ID in the external system.","type":"string"},"source":{"description":"The integration source (e.g., \"slack\", \"intercom\", \"hubspot\").","type":"string"}},"type":"object"},"Pagination":{"properties":{"cursor":{"description":"The cursor for the next page of results.","type":"string"},"has_next_page":{"description":"Indicates if there is a next page of results.","type":"boolean"}},"required":["cursor","has_next_page"],"type":"object"},"ErrorApiResponseBody":{"properties":{"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}}},"paths":{"/contacts":{"get":{"description":"Returns a paginated list of contacts for the organization.\n\n**Rate limit:** 60 requests per minute","operationId":"GetContacts","parameters":[{"description":"The cursor to use for pagination.","in":"query","name":"cursor","schema":{"type":"string"}},{"description":"The number of contacts to fetch. Defaults to 100. Must be greater than 0 and less than 1000.","in":"query","name":"limit","schema":{"format":"int64","type":"integer"}}],"responses":{"200":{"$ref":"#/components/responses/GetContactsResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get all contacts","tags":["contacts"]}}}}
```

## Create a new contact

> Creates a new contact with the specified email and optional metadata.\
> \
> \*\*Rate limit:\*\* 60 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"CreateContactRequestBody":{"properties":{"account_external_id":{"description":"The external ID of the account that this contact belongs to. Cannot be used together with account_id.","type":"string"},"account_id":{"description":"The account that this contact belongs to.","type":"string"},"avatar_url":{"description":"The avatar URL of the contact. Must be a square .png, .jpg or .jpeg.","type":"string"},"custom_fields":{"description":"An array of custom fields to be applied to this contact.","items":{"$ref":"#/components/schemas/CustomFieldValue"},"type":"array"},"email":{"description":"The email of the contact.","type":"string"},"external_ids":{"description":"An array of external IDs to be used on this contact.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"name":{"description":"The name of the contact.","type":"string"},"phone_numbers":{"description":"The phone numbers of the contact. Must contain only digits 0-9 and be 15 digits or less.","items":{"type":"string"},"type":"array"},"portal_role":{"description":"The portal role to assign to the contact. If not provided uses the default portal role from the portal settings.","enum":["no_access","member","admin"],"type":"string"},"portal_role_id":{"description":"The ID of the custom portal role to assign to the contact. Takes precedence over portal_role if provided.","type":"string"},"primary_phone_number":{"description":"The primary phone number. Must be in the list of phone_numbers. If there are any phone_numbers and this is not specified, the first phone number will be primary.","type":"string"}},"required":["name"],"type":"object"},"CustomFieldValue":{"properties":{"slug":{"description":"The slug of the custom field.","type":"string"},"value":{"description":"The value of the custom field. Only to be used for single-valued custom fields. If unset, the custom field will be unset. If the custom field is a select field, the value must be the select option slug, which you can find from the GET /custom-fields endpoint. If the custom field is a relationship field, the value must be the related object ID.","type":"string"},"values":{"description":"The values of the custom field. Only to be used for multi-valued custom fields (ex. multiselect). If unset, the custom field will be unset. If the custom field is a multiselect field, the values must be the select option slugs which you can find from the GET /custom-fields endpoint.","items":{"type":"string"},"type":"array"}},"type":"object"},"ExternalID":{"properties":{"external_id":{"description":"The external ID. Must be unique per object type (ex. account).","type":"string"},"label":{"description":"The label of the external ID. Must be unique per object.","type":"string"}},"type":"object"},"CreateContactResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/Contact"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"},"Contact":{"properties":{"account":{"$ref":"#/components/schemas/MiniAccount"},"avatar_url":{"description":"Avatar URL of the contact.","type":"string"},"custom_fields":{"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom field values associated with the contact.","type":"object"},"email":{"description":"The primary email of the contact, if it exists.","type":"string"},"emails":{"description":"The list of all emails of the contact.","items":{"type":"string"},"type":"array"},"external_ids":{"description":"External IDs associated with the contact.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"id":{"description":"The ID of the contact.","type":"string"},"integration_user_ids":{"description":"Integration user IDs linking this contact to external systems.","items":{"$ref":"#/components/schemas/IntegrationUserID"},"type":"array"},"name":{"description":"The name of the contact.","type":"string"},"phone_numbers":{"description":"The list of all phone numbers of the contact.","items":{"type":"string"},"type":"array"},"portal_role":{"description":"Portal role slug assigned to the contact. For backwards compatibility.","enum":["no_access","member","admin"],"type":"string"},"portal_role_id":{"description":"The ID of the custom portal role assigned to the contact.","type":"string"},"primary_phone_number":{"description":"The primary phone number of the contact, if it exists.","type":"string"}},"type":"object"},"MiniAccount":{"properties":{"external_ids":{"description":"External IDs associated with the account.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"id":{"description":"The ID of the account.","type":"string"}},"type":"object"},"IntegrationUserID":{"properties":{"id":{"description":"The user ID in the external system.","type":"string"},"source":{"description":"The integration source (e.g., \"slack\", \"intercom\", \"hubspot\").","type":"string"}},"type":"object"},"ErrorApiResponseBody":{"properties":{"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}},"responses":{"CreateContactResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}}},"paths":{"/contacts":{"post":{"description":"Creates a new contact with the specified email and optional metadata.\n\n**Rate limit:** 60 requests per minute","operationId":"CreateContact","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactRequestBody"}}}},"responses":{"200":{"$ref":"#/components/responses/CreateContactResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Create a new contact","tags":["contacts"]}}}}
```

## Get a contact by its ID or external ID

> Returns a single contact by ID or external ID.\
> \
> \*\*Rate limit:\*\* 60 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetContactResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetContactResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetContactResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/Contact"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"},"Contact":{"properties":{"account":{"$ref":"#/components/schemas/MiniAccount"},"avatar_url":{"description":"Avatar URL of the contact.","type":"string"},"custom_fields":{"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom field values associated with the contact.","type":"object"},"email":{"description":"The primary email of the contact, if it exists.","type":"string"},"emails":{"description":"The list of all emails of the contact.","items":{"type":"string"},"type":"array"},"external_ids":{"description":"External IDs associated with the contact.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"id":{"description":"The ID of the contact.","type":"string"},"integration_user_ids":{"description":"Integration user IDs linking this contact to external systems.","items":{"$ref":"#/components/schemas/IntegrationUserID"},"type":"array"},"name":{"description":"The name of the contact.","type":"string"},"phone_numbers":{"description":"The list of all phone numbers of the contact.","items":{"type":"string"},"type":"array"},"portal_role":{"description":"Portal role slug assigned to the contact. For backwards compatibility.","enum":["no_access","member","admin"],"type":"string"},"portal_role_id":{"description":"The ID of the custom portal role assigned to the contact.","type":"string"},"primary_phone_number":{"description":"The primary phone number of the contact, if it exists.","type":"string"}},"type":"object"},"MiniAccount":{"properties":{"external_ids":{"description":"External IDs associated with the account.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"id":{"description":"The ID of the account.","type":"string"}},"type":"object"},"ExternalID":{"properties":{"external_id":{"description":"The external ID. Must be unique per object type (ex. account).","type":"string"},"label":{"description":"The label of the external ID. Must be unique per object.","type":"string"}},"type":"object"},"CustomFieldValue":{"properties":{"slug":{"description":"The slug of the custom field.","type":"string"},"value":{"description":"The value of the custom field. Only to be used for single-valued custom fields. If unset, the custom field will be unset. If the custom field is a select field, the value must be the select option slug, which you can find from the GET /custom-fields endpoint. If the custom field is a relationship field, the value must be the related object ID.","type":"string"},"values":{"description":"The values of the custom field. Only to be used for multi-valued custom fields (ex. multiselect). If unset, the custom field will be unset. If the custom field is a multiselect field, the values must be the select option slugs which you can find from the GET /custom-fields endpoint.","items":{"type":"string"},"type":"array"}},"type":"object"},"IntegrationUserID":{"properties":{"id":{"description":"The user ID in the external system.","type":"string"},"source":{"description":"The integration source (e.g., \"slack\", \"intercom\", \"hubspot\").","type":"string"}},"type":"object"},"ErrorApiResponseBody":{"properties":{"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}}},"paths":{"/contacts/{id}":{"get":{"description":"Returns a single contact by ID or external ID.\n\n**Rate limit:** 60 requests per minute","operationId":"GetContact","parameters":[{"description":"The ID or external ID of the contact.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/GetContactResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get a contact by its ID or external ID","tags":["contacts"]}}}}
```

## Update a contact by its ID or external ID

> Updates a contact by ID or external ID. Only provided fields are modified.\
> \
> \*\*Rate limit:\*\* 60 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"UpdateContactRequestBody":{"properties":{"account_external_id":{"description":"The external ID of the account to move the contact to. Cannot be used together with account_id.","type":"string"},"account_id":{"description":"The account to move the contact to. If empty string is passed in, the contact will be removed from its account.","type":"string"},"avatar_url":{"description":"The avatar URL of the contact. Must be a square .png, .jpg or .jpeg.","type":"string"},"custom_fields":{"description":"An array of custom fields to be applied to this contact.","items":{"$ref":"#/components/schemas/CustomFieldValue"},"type":"array"},"email":{"description":"The email of the contact. Cannot be used together with the `emails` array field.","type":"string"},"emails":{"description":"The emails of the contact as an array. Cannot be used together with the singular `email` field.\nEach entry must include an `email` string and an optional `is_primary` boolean.\nIf no email is marked as primary, the first email becomes the primary.","items":{"$ref":"#/components/schemas/UpdateContactEmail"},"type":"array"},"external_ids":{"description":"An array of external IDs to be used on this contact. If provided, the contact's external IDs will be updated to the given external IDs.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"name":{"description":"in: body\nThe name of the contact.","type":"string"},"phone_numbers":{"description":"The phone numbers of the contact. Must contain only digits 0-9 and be 15 digits or less.","items":{"type":"string"},"type":"array"},"portal_role":{"description":"The portal role to assign to the contact. Can be one of `no_access`, `member`, or `admin`, or a custom role slug.","enum":["no_access","member","admin"],"type":"string"},"portal_role_id":{"description":"The ID of the custom portal role to assign to the contact. Takes precedence over portal_role if provided.","type":"string"},"primary_phone_number":{"description":"The primary phone number. Must be in the list of phone_numbers. If there are any phone_numbers and this is not specified, the first phone number will be primary.","type":"string"}},"type":"object"},"CustomFieldValue":{"properties":{"slug":{"description":"The slug of the custom field.","type":"string"},"value":{"description":"The value of the custom field. Only to be used for single-valued custom fields. If unset, the custom field will be unset. If the custom field is a select field, the value must be the select option slug, which you can find from the GET /custom-fields endpoint. If the custom field is a relationship field, the value must be the related object ID.","type":"string"},"values":{"description":"The values of the custom field. Only to be used for multi-valued custom fields (ex. multiselect). If unset, the custom field will be unset. If the custom field is a multiselect field, the values must be the select option slugs which you can find from the GET /custom-fields endpoint.","items":{"type":"string"},"type":"array"}},"type":"object"},"UpdateContactEmail":{"properties":{"email":{"description":"The email address.","type":"string"},"is_primary":{"description":"Whether this is the primary email address.","type":"boolean"}},"required":["email"],"title":"UpdateContactEmail represents an email entry in the emails array for contact updates.","type":"object"},"ExternalID":{"properties":{"external_id":{"description":"The external ID. Must be unique per object type (ex. account).","type":"string"},"label":{"description":"The label of the external ID. Must be unique per object.","type":"string"}},"type":"object"},"UpdateContactResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/Contact"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"},"Contact":{"properties":{"account":{"$ref":"#/components/schemas/MiniAccount"},"avatar_url":{"description":"Avatar URL of the contact.","type":"string"},"custom_fields":{"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom field values associated with the contact.","type":"object"},"email":{"description":"The primary email of the contact, if it exists.","type":"string"},"emails":{"description":"The list of all emails of the contact.","items":{"type":"string"},"type":"array"},"external_ids":{"description":"External IDs associated with the contact.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"id":{"description":"The ID of the contact.","type":"string"},"integration_user_ids":{"description":"Integration user IDs linking this contact to external systems.","items":{"$ref":"#/components/schemas/IntegrationUserID"},"type":"array"},"name":{"description":"The name of the contact.","type":"string"},"phone_numbers":{"description":"The list of all phone numbers of the contact.","items":{"type":"string"},"type":"array"},"portal_role":{"description":"Portal role slug assigned to the contact. For backwards compatibility.","enum":["no_access","member","admin"],"type":"string"},"portal_role_id":{"description":"The ID of the custom portal role assigned to the contact.","type":"string"},"primary_phone_number":{"description":"The primary phone number of the contact, if it exists.","type":"string"}},"type":"object"},"MiniAccount":{"properties":{"external_ids":{"description":"External IDs associated with the account.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"id":{"description":"The ID of the account.","type":"string"}},"type":"object"},"IntegrationUserID":{"properties":{"id":{"description":"The user ID in the external system.","type":"string"},"source":{"description":"The integration source (e.g., \"slack\", \"intercom\", \"hubspot\").","type":"string"}},"type":"object"},"ErrorApiResponseBody":{"properties":{"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}},"responses":{"UpdateContactResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}}},"paths":{"/contacts/{id}":{"patch":{"description":"Updates a contact by ID or external ID. Only provided fields are modified.\n\n**Rate limit:** 60 requests per minute","operationId":"UpdateContact","parameters":[{"description":"The ID or external ID of the contact to update.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactRequestBody"}}}},"responses":{"200":{"$ref":"#/components/responses/UpdateContactResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Update a contact by its ID or external ID","tags":["contacts"]}}}}
```

## Delete a contact by its ID or external ID

> Permanently deletes a contact by ID or external ID.\
> \
> \*\*Rate limit:\*\* 10 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"DeleteContactResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteContactResponseBody"}}},"description":""}},"schemas":{"DeleteContactResponseBody":{"properties":{"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}}},"paths":{"/contacts/{id}":{"delete":{"description":"Permanently deletes a contact by ID or external ID.\n\n**Rate limit:** 10 requests per minute","operationId":"DeleteContact","parameters":[{"description":"The ID or external ID of the contact to delete.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/DeleteContactResponse"}},"summary":"Delete a contact by its ID or external ID","tags":["contacts"]}}}}
```

## Search for contacts by a given filter

> Filterable fields and their allowed operators:\
> \
> &#x20;Field | Allowed operators |\
> &#x20;\--- | --- |\
> &#x20;\`id\` | \`equals\`, \`in\`, \`not\_in\` |\
> &#x20;\`email\` | \`equals\`, \`in\`, \`not\_in\`, \`string\_contains\` |\
> &#x20;\`name\` | \`equals\`, \`in\`, \`not\_in\`, \`string\_contains\` |\
> &#x20;\`account\_id\` | \`equals\`, \`in\`, \`not\_in\` |\
> \
> For custom fields, pass the field slug as \`field\`.\
> \
> \*\*Rate limit:\*\* 20 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"SearchContactsRequest":{"properties":{"cursor":{"description":"The cursor to use for pagination.","type":"string"},"filter":{"$ref":"#/components/schemas/Filter"},"limit":{"description":"The number of contacts to fetch. Defaults to 100. Must be greater than 0 and less than 1000.","format":"int64","type":"integer"},"search_text":{"description":"Fuzzy text search. Results are intersected with any provided filter.","type":"string"}},"type":"object"},"Filter":{"properties":{"field":{"description":"The field for this filter.  For allowed fields, see the documentation for\nthe specific endpoint you are using.\nFor non-compound filters (any operators other than \"and\" or \"or\"),\nfield must be set, along with either value or values, depending on the operator.","type":"string"},"operator":{"description":"The operator for this filter.","enum":["equals","not_equals","contains","does_not_contain","in","not_in","and","or","time_is_after","time_is_before","time_range","string_contains","string_does_not_contain","is_set","is_unset","greater_than","less_than","greater_than_or_equals","less_than_or_equals"],"type":"string"},"subfilters":{"description":"Sub-filters for this filter.  Valid only when operator is \"and\" or \"or\".\nThe maximum allowed depth for a tree of filters is 3.","items":{"$ref":"#/components/schemas/Filter"},"type":"array"},"value":{"description":"The value for this filter. Only used for single-valued operators\n(\"equals\", \"not_equals\", \"contains\", \"does_not_contain\")","type":"string"},"values":{"description":"The values for this filter. Only used for multi-valued operators (\"in\", \"not_in\").","items":{"type":"string"},"type":"array"}},"required":["operator"],"type":"object"},"SearchContactsResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/Contact"},"type":"array"},"pagination":{"$ref":"#/components/schemas/Pagination"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"},"Contact":{"properties":{"account":{"$ref":"#/components/schemas/MiniAccount"},"avatar_url":{"description":"Avatar URL of the contact.","type":"string"},"custom_fields":{"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom field values associated with the contact.","type":"object"},"email":{"description":"The primary email of the contact, if it exists.","type":"string"},"emails":{"description":"The list of all emails of the contact.","items":{"type":"string"},"type":"array"},"external_ids":{"description":"External IDs associated with the contact.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"id":{"description":"The ID of the contact.","type":"string"},"integration_user_ids":{"description":"Integration user IDs linking this contact to external systems.","items":{"$ref":"#/components/schemas/IntegrationUserID"},"type":"array"},"name":{"description":"The name of the contact.","type":"string"},"phone_numbers":{"description":"The list of all phone numbers of the contact.","items":{"type":"string"},"type":"array"},"portal_role":{"description":"Portal role slug assigned to the contact. For backwards compatibility.","enum":["no_access","member","admin"],"type":"string"},"portal_role_id":{"description":"The ID of the custom portal role assigned to the contact.","type":"string"},"primary_phone_number":{"description":"The primary phone number of the contact, if it exists.","type":"string"}},"type":"object"},"MiniAccount":{"properties":{"external_ids":{"description":"External IDs associated with the account.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"id":{"description":"The ID of the account.","type":"string"}},"type":"object"},"ExternalID":{"properties":{"external_id":{"description":"The external ID. Must be unique per object type (ex. account).","type":"string"},"label":{"description":"The label of the external ID. Must be unique per object.","type":"string"}},"type":"object"},"CustomFieldValue":{"properties":{"slug":{"description":"The slug of the custom field.","type":"string"},"value":{"description":"The value of the custom field. Only to be used for single-valued custom fields. If unset, the custom field will be unset. If the custom field is a select field, the value must be the select option slug, which you can find from the GET /custom-fields endpoint. If the custom field is a relationship field, the value must be the related object ID.","type":"string"},"values":{"description":"The values of the custom field. Only to be used for multi-valued custom fields (ex. multiselect). If unset, the custom field will be unset. If the custom field is a multiselect field, the values must be the select option slugs which you can find from the GET /custom-fields endpoint.","items":{"type":"string"},"type":"array"}},"type":"object"},"IntegrationUserID":{"properties":{"id":{"description":"The user ID in the external system.","type":"string"},"source":{"description":"The integration source (e.g., \"slack\", \"intercom\", \"hubspot\").","type":"string"}},"type":"object"},"Pagination":{"properties":{"cursor":{"description":"The cursor for the next page of results.","type":"string"},"has_next_page":{"description":"Indicates if there is a next page of results.","type":"boolean"}},"required":["cursor","has_next_page"],"type":"object"}},"responses":{"SearchContactsResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchContactsResponseBody"}}},"description":""}}},"paths":{"/contacts/search":{"post":{"description":"Filterable fields and their allowed operators:\n\n Field | Allowed operators |\n --- | --- |\n `id` | `equals`, `in`, `not_in` |\n `email` | `equals`, `in`, `not_in`, `string_contains` |\n `name` | `equals`, `in`, `not_in`, `string_contains` |\n `account_id` | `equals`, `in`, `not_in` |\n\nFor custom fields, pass the field slug as `field`.\n\n**Rate limit:** 20 requests per minute","operationId":"SearchContacts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchContactsRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/SearchContactsResponse"}},"summary":"Search for contacts by a given filter","tags":["contacts"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.usepylon.com/pylon-docs/developer/api/api-reference/contacts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
