> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oneperfectslice.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Search CRM companies

> Search CRM companies by name across your organization. Returns matching companies with call counts. CRM data is shared across all teams in your org.



## OpenAPI

````yaml /api/openapi.yaml get /api/public/v1/filters/crm-companies
openapi: 3.1.0
info:
  title: OnePerfectSlice API
  version: 1.0.0
  description: |
    Programmatic access to OnePerfectSlice. Authenticate with a team-scoped
    API key (Bearer sk_...) obtained from Org Settings → API Keys.
servers:
  - url: https://app.oneperfectslice.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /api/public/v1/filters/crm-companies:
    get:
      tags:
        - Filters
      summary: Search CRM companies
      description: >-
        Search CRM companies by name across your organization. Returns matching
        companies with call counts. CRM data is shared across all teams in your
        org.
      operationId: getCrmCompanies
      parameters:
        - name: q
          in: query
          required: false
          schema:
            type: string
          description: Optional prefix search string
      responses:
        '200':
          description: Org-scoped CRM company options
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - crmCompanies
                    properties:
                      crmCompanies:
                        type: array
                        items:
                          $ref: '#/components/schemas/PublicCrmCompanyOption'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          description: Filter lookup request timed out
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                error:
                  code: FILTER_LOOKUP_TIMEOUT
                  message: Filter lookup request timed out
      security:
        - bearerAuth: []
components:
  schemas:
    PublicCrmCompanyOption:
      type: object
      required:
        - id
        - externalId
        - name
        - callCount
      properties:
        id:
          type: integer
          format: int64
          example: 201
        externalId:
          type: string
          example: hs_67890
        name:
          type: string
          example: Acme Corp
        callCount:
          type: integer
          example: 0
    ApiError:
      type: object
      description: Standard error envelope for all public API error responses
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable UPPER_SNAKE_CASE error code
              example: INVALID_TOKEN
            message:
              type: string
              description: Human-readable error description
              example: Token is invalid
            details:
              type: object
              description: Optional additional error context
              additionalProperties: true
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            missingToken:
              value:
                error:
                  code: MISSING_TOKEN
                  message: Authorization header with Bearer token is required
            invalidToken:
              value:
                error:
                  code: INVALID_TOKEN
                  message: Token is invalid
            tokenRevoked:
              value:
                error:
                  code: TOKEN_REVOKED
                  message: Token has been revoked
            tokenExpired:
              value:
                error:
                  code: TOKEN_EXPIRED
                  message: Token has expired
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key with sk_ prefix. Create one in Org Settings → API Keys.
      x-default: sk_your_api_key

````