# List contacts GET https://app.askelephant.ai/api/v2/contacts Returns workspace contacts using cursor pagination ordered by `updated_at` descending by default. `filter[crm_associations][eq]` supports only CRM objects with `object_type=contact`. Requires the `contacts:read` scope. Reference: https://docs.askelephant.ai/api-reference/contacts/list-contacts ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: AskElephant Public API version: 1.0.0 paths: /v2/contacts: get: operationId: list-contacts summary: List contacts description: >- Returns workspace contacts using cursor pagination ordered by `updated_at` descending by default. `filter[crm_associations][eq]` supports only CRM objects with `object_type=contact`. Requires the `contacts:read` scope. tags: - subpackage_contacts parameters: - name: limit in: query description: >- Maximum number of results to return. Defaults to 25 and is capped at 100. required: false schema: type: integer default: 25 - name: cursor in: query description: Opaque cursor from a previous list response. required: false schema: type: string - name: search in: query description: >- Free-text search string matched against contact full names and email addresses. This does not search phone numbers, descriptions, or company data. required: false schema: type: string - name: order_by in: query description: Sort order for the list. Defaults to `updated_at:desc`. required: false schema: $ref: '#/components/schemas/V2ContactsGetParametersOrderBy' - name: filter[crm_associations][eq] in: query description: >- Filter resources by CRM associations. For readability, docs examples use indexed bracket syntax such as `filter[crm_associations][eq][0][id]=123` plus `filter[crm_associations][eq][0][object_type]=`. The API also accepts a JSON-encoded array string with objects containing `id` and `object_type`. CRM source is inferred from the workspace's connected CRM state. Supported `object_type` values depend on the endpoint. Supports up to 20 objects. required: false schema: type: string - name: filter[updated_at][gt] in: query description: >- Return resources updated strictly after the provided ISO-8601 UTC timestamp. required: false schema: type: string format: date-time - name: filter[updated_at][gte] in: query description: >- Return resources updated at or after the provided ISO-8601 UTC timestamp. required: false schema: type: string format: date-time - name: filter[updated_at][lt] in: query description: >- Return resources updated strictly before the provided ISO-8601 UTC timestamp. required: false schema: type: string format: date-time - name: filter[updated_at][lte] in: query description: >- Return resources updated at or before the provided ISO-8601 UTC timestamp. required: false schema: type: string format: date-time - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Paginated contacts list. content: application/json: schema: $ref: '#/components/schemas/contact_list_response' '400': description: Request validation failed. content: application/json: schema: $ref: '#/components/schemas/error' '401': description: Authentication is missing or invalid. content: application/json: schema: $ref: '#/components/schemas/error' '403': description: Authenticated but missing required scope. content: application/json: schema: $ref: '#/components/schemas/error' '429': description: Too many requests. content: application/json: schema: $ref: '#/components/schemas/error' '500': description: Unexpected server error. content: application/json: schema: $ref: '#/components/schemas/error' servers: - url: https://app.askelephant.ai/api - url: https://app-staging.askelephant.ai/api components: schemas: V2ContactsGetParametersOrderBy: type: string enum: - updated_at:asc - updated_at:desc title: V2ContactsGetParametersOrderBy ContactListResponseObject: type: string enum: - list description: Resource discriminator for list responses. title: ContactListResponseObject ContactObject: type: string enum: - contact description: Resource discriminator for contact payloads. title: ContactObject resource_ref: type: object properties: id: type: string object: type: string required: - id - object title: resource_ref ContactEmailsItems: type: object properties: email: type: string format: email description: Contact email address. is_primary: type: boolean description: Indicates whether this is the primary email address. required: - email - is_primary title: ContactEmailsItems ContactPhoneNumbersItems: type: object properties: phone_number: type: string description: Contact phone number in the source-system format. is_primary: type: boolean description: Indicates whether this is the primary phone number. required: - phone_number - is_primary title: ContactPhoneNumbersItems crm_association: type: object properties: object_type: type: string description: CRM object type. crm_object_id: type: string description: The record ID in the source CRM system. source: type: string description: CRM source system. required: - object_type - crm_object_id - source title: crm_association contact: type: object properties: object: $ref: '#/components/schemas/ContactObject' description: Resource discriminator for contact payloads. id: type: string description: Stable AskElephant contact identifier. first_name: type: - string - 'null' description: Contact given name. last_name: type: - string - 'null' description: Contact family name. description: type: string description: Free-form contact summary or notes visible through the public API. company: $ref: '#/components/schemas/resource_ref' description: >- Lightweight reference to the contact's associated company when one exists. emails: type: array items: $ref: '#/components/schemas/ContactEmailsItems' description: Email addresses associated with the contact. phone_numbers: type: array items: $ref: '#/components/schemas/ContactPhoneNumbersItems' description: Phone numbers associated with the contact. crm_association: $ref: '#/components/schemas/crm_association' description: >- CRM record linked to this contact. Present when the contact has been matched to a CRM record via integration or API. time_zone: type: string description: IANA time zone identifier for the contact. created_at: type: string format: date-time description: Timestamp when the contact was first created in AskElephant. updated_at: type: string format: date-time description: Timestamp when the contact was most recently updated in AskElephant. required: - object - id - created_at - updated_at description: Public representation of a workspace contact. title: contact contact_list_response: type: object properties: object: $ref: '#/components/schemas/ContactListResponseObject' description: Resource discriminator for list responses. data: type: array items: $ref: '#/components/schemas/contact' description: Contact records in the current page. has_more: type: boolean description: Indicates whether another page of contacts is available. next_cursor: type: - string - 'null' description: >- Opaque cursor for the next page, or `null` when there are no more results. required: - object - data - has_more - next_cursor description: Cursor-paginated list response containing contacts. title: contact_list_response error_item: type: object properties: field: type: string description: Request field or parameter associated with the error. code: type: string description: Stable machine-readable error code. message: type: string description: Human-readable explanation of the error. required: - code - message description: Structured validation or field-level error detail. title: error_item error: type: object properties: type: type: string format: uri description: Stable URI identifying the error category. title: type: string description: Short human-readable summary of the error. status: type: integer description: HTTP status code for this error response. detail: type: string description: Human-readable explanation specific to this request. request_id: type: string description: Correlation identifier for support and debugging. errors: type: array items: $ref: '#/components/schemas/error_item' description: Optional field-level validation errors. required: - type - title - status - detail - request_id description: RFC 9457 problem details response returned for client-visible failures. title: error securitySchemes: BearerAuth: type: http scheme: bearer ``` ## SDK Code Examples ```python First page of contacts import requests url = "https://app.askelephant.ai/api/v2/contacts" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript First page of contacts const url = 'https://app.askelephant.ai/api/v2/contacts'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go First page of contacts package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.askelephant.ai/api/v2/contacts" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby First page of contacts require 'uri' require 'net/http' url = URI("https://app.askelephant.ai/api/v2/contacts") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java First page of contacts import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://app.askelephant.ai/api/v2/contacts") .header("Authorization", "Bearer ") .asString(); ``` ```php First page of contacts request('GET', 'https://app.askelephant.ai/api/v2/contacts', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp First page of contacts using RestSharp; var client = new RestClient("https://app.askelephant.ai/api/v2/contacts"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift First page of contacts import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://app.askelephant.ai/api/v2/contacts")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```