> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.askelephant.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.askelephant.ai/_mcp/server.

# List companies

GET https://app.askelephant.ai/api/v2/companies

Returns workspace companies using cursor pagination ordered by `updated_at` descending by default. `filter[crm_associations][eq]` supports only CRM objects with `object_type=company`.

Reference: https://docs.askelephant.ai/api-reference/companies/list-companies

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: AskElephant Public API
  version: 1.0.0
paths:
  /v2/companies:
    get:
      operationId: list-companies
      summary: List companies
      description: >-
        Returns workspace companies using cursor pagination ordered by
        `updated_at` descending by default. `filter[crm_associations][eq]`
        supports only CRM objects with `object_type=company`.
      tags:
        - companies
      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 company display names only.
            This does not search domains, descriptions, or CRM fields.
          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/V2CompaniesGetParametersOrderBy'
        - name: filter[domain][eq]
          in: query
          description: Filter companies by exact domain after normalization.
          required: false
          schema:
            type: string
        - 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]=<supported-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 company list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/company_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
    description: Production
  - url: https://app-staging.askelephant.ai/api
    description: Staging
components:
  schemas:
    V2CompaniesGetParametersOrderBy:
      type: string
      enum:
        - updated_at:asc
        - updated_at:desc
      title: V2CompaniesGetParametersOrderBy
    CompanyListResponseObject:
      type: string
      enum:
        - list
      title: CompanyListResponseObject
    CompanyObject:
      type: string
      enum:
        - company
      title: CompanyObject
    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
    CompanyDomainsItems:
      type: object
      properties:
        domain:
          type: string
      required:
        - domain
      title: CompanyDomainsItems
    company:
      type: object
      properties:
        object:
          $ref: '#/components/schemas/CompanyObject'
        id:
          type: string
        name:
          type:
            - string
            - 'null'
        description:
          type: string
        industry:
          type: string
        website:
          type: string
          format: uri
        number_of_employees:
          type: integer
        logo_url:
          type: string
          format: uri
        crm_association:
          $ref: '#/components/schemas/crm_association'
          description: >-
            CRM record linked to this company. Present when the company has been
            matched to a CRM record via integration or API.
        domains:
          type: array
          items:
            $ref: '#/components/schemas/CompanyDomainsItems'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - object
        - id
        - created_at
        - updated_at
      title: company
    company_list_response:
      type: object
      properties:
        object:
          $ref: '#/components/schemas/CompanyListResponseObject'
        data:
          type: array
          items:
            $ref: '#/components/schemas/company'
        has_more:
          type: boolean
        next_cursor:
          type:
            - string
            - 'null'
      required:
        - object
        - data
        - has_more
        - next_cursor
      title: company_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

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "object": "list",
  "data": [
    {
      "object": "company",
      "id": "cmp_9X4b7K2LpQ",
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-04-20T16:45:00Z",
      "name": "Acme Corporation",
      "description": "Leading provider of innovative industrial solutions.",
      "industry": "Manufacturing",
      "website": "https://www.acmecorp.com",
      "number_of_employees": 3500,
      "logo_url": "https://cdn.acmecorp.com/logos/acme-logo.png",
      "crm_association": {
        "object_type": "company",
        "crm_object_id": "CRM123456789",
        "source": "Salesforce"
      },
      "domains": [
        {
          "domain": "acmecorp.com"
        }
      ]
    }
  ],
  "has_more": true,
  "next_cursor": "eyJpZCI6ImNtcF85WDRCN0syTHBRIn0="
}
```

**SDK Code**

```python
import requests

url = "https://app.askelephant.ai/api/v2/companies"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.get(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.askelephant.ai/api/v2/companies';
const options = {
  method: 'GET',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.askelephant.ai/api/v2/companies"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.askelephant.ai/api/v2/companies")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://app.askelephant.ai/api/v2/companies")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://app.askelephant.ai/api/v2/companies', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.askelephant.ai/api/v2/companies");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.askelephant.ai/api/v2/companies")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```