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

# List contacts

> GET /dn/contacts returns a paginated list of your saved contacts. Search by name or company with q.

Retrieve the contacts in your Detrack address book. The response is paginated: use `page` and `limit` to move through it, up to 100 contacts per page, and follow the URLs in `links`. `total_count` is the number of contacts that match.

Use `q` to search by recipient name, last name, or company name. For example, `?q=James` returns every contact whose name, last name, or company name contains "James".

For errors and rate limits, see [Errors](https://detrack.mintlify.site/errors.md) and [Rate limits](https://detrack.mintlify.site/rate-limits.md).


## OpenAPI

````yaml GET /dn/contacts
openapi: 3.0.3
info:
  title: Detrack REST API v2
  version: '2.0'
  description: >-
    Detrack REST API v2. Checked against detrack-webapp origin/main (production)
    on 2026-09-29: dn_jobs.rb @ d246ad006, dn_depots.rb @ 2a5f387, dn_routes.rb
    @ 50a73a9, app_helper.rb @ d745ad2, dn_jobs_helper.rb @ d296e30,
    job_decorator.rb @ 3041da7, run_location_decorator.rb @ 0f0274d,
    vehicle_route_plan_decorator.rb and tsp_route_decorator.rb @ 7d1f3ef,
    data_export.rb @ ed4e135. Vehicle check submissions checked against
    origin/main on 2026-11-03: dn_vehicle_checklist_submissions.rb @ 3071523d1,
    vehicle_checklist_submission_decorator.rb @ f4002c957,
    vehicle_checklist_submission.rb @ b80aea03c,
    vehicle_checklist_submission_rules.rb @ e55194ed7. Contacts checked against
    origin/main on 2026-11-04: dn_contacts.rb, contacts_helper.rb and contact.rb
    @ a1b3694a0, contact_decorator.rb @ a51f1eab7.
servers:
  - url: https://app.detrack.com/api/v2
security:
  - apiKey: []
tags:
  - name: Jobs
    description: Deliveries and collections.
  - name: Depots
    description: Saved warehouse and pickup locations.
  - name: Contacts
    description: Your address book of saved recipients.
  - name: Routes
    description: Optimized multi-stop plans across vehicles.
  - name: Vehicle checks
    description: >-
      Checklists your drivers submit for a vehicle, such as start-of-day and
      end-of-day checks.
paths:
  /dn/contacts:
    get:
      tags:
        - Contacts
      summary: List contacts
      description: >-
        Returns a paginated list of the contacts your API key's user can see.
        Without `sort`, contacts are sorted by `company_name` and then
        `deliver_to_collect_from` if your account uses the company name field,
        or by `deliver_to_collect_from` if it doesn't.
      operationId: listContacts
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/ContactLimit'
        - name: q
          in: query
          schema:
            type: string
          description: >-
            Search text. Matches `deliver_to_collect_from`, `last_name`, or
            `company_name` (partial, case-insensitive).
        - name: sort
          in: query
          schema:
            type: string
          description: >-
            Comma-separated fields to sort by, using the field names in the
            response. Prefix a field with `-` for descending, for example
            `-company_name`.
      responses:
        '200':
          description: A page of contacts.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Contact'
                  links:
                    $ref: '#/components/schemas/Links'
                  total_count:
                    type: integer
                    example: 1
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        default:
          $ref: '#/components/responses/ServerError'
components:
  parameters:
    Page:
      name: page
      in: query
      schema:
        type: integer
        default: 1
      description: Page number.
    ContactLimit:
      name: limit
      in: query
      schema:
        type: integer
        default: 25
        maximum: 100
      description: Records per page, up to 100. A larger value returns 100 records.
  schemas:
    Contact:
      type: object
      description: >-
        A saved recipient. Empty fields are `null`. The pick-up fields
        (`pick_up_*`) are returned only if your account uses point-to-point
        jobs.
      properties:
        id:
          type: string
          readOnly: true
          example: 65263b0c29e804cae4fedd76
        deliver_to_collect_from:
          type: string
          nullable: true
          description: Recipient's name.
          example: James Li
        last_name:
          type: string
          nullable: true
        job_time:
          type: string
          nullable: true
        customer:
          type: string
          nullable: true
        company_name:
          type: string
          nullable: true
          example: Detrack
        address:
          type: string
          nullable: true
          example: 61 Kaki Bukit Ave 1, Singapore 417943
        postal_code:
          type: string
          nullable: true
        address_1:
          type: string
          nullable: true
        address_2:
          type: string
          nullable: true
        address_3:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        state:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
        address_lat:
          type: number
          nullable: true
        address_lng:
          type: number
          nullable: true
        phone_number:
          type: string
          nullable: true
          example: '65432178'
        fax_number:
          type: string
          nullable: true
        notify_email:
          type: string
          nullable: true
          example: test@example.com
        zone:
          type: string
          nullable: true
        instructions:
          type: string
          nullable: true
        boxes:
          type: string
          nullable: true
        cubic_meters:
          type: number
          nullable: true
        cartons:
          type: integer
          nullable: true
        pieces:
          type: integer
          nullable: true
        envelopes:
          type: integer
          nullable: true
        pallets:
          type: integer
          nullable: true
        remarks:
          type: string
          nullable: true
        account_number:
          type: string
          nullable: true
        sales_person:
          type: string
          nullable: true
        pick_up_from:
          type: string
          nullable: true
        pick_up_time:
          type: string
          nullable: true
        pick_up_address:
          type: string
          nullable: true
        pick_up_address_1:
          type: string
          nullable: true
        pick_up_address_2:
          type: string
          nullable: true
        pick_up_address_3:
          type: string
          nullable: true
        pick_up_city:
          type: string
          nullable: true
        pick_up_state:
          type: string
          nullable: true
        pick_up_country:
          type: string
          nullable: true
        pick_up_postal_code:
          type: string
          nullable: true
        pick_up_zone:
          type: string
          nullable: true
        pick_up_lat:
          type: number
          nullable: true
        pick_up_lng:
          type: number
          nullable: true
        sender_phone_number:
          type: string
          nullable: true
        groups:
          type: array
          items:
            $ref: '#/components/schemas/ContactGroup'
        items:
          type: array
          items:
            $ref: '#/components/schemas/ContactItem'
    Links:
      type: object
      properties:
        first:
          type: string
          nullable: true
        last:
          type: string
          nullable: true
        next:
          type: string
          nullable: true
        prev:
          type: string
          nullable: true
    ContactGroup:
      type: object
      properties:
        id:
          type: string
          example: 5e8b2f1a29e804cae4fe0a11
        name:
          type: string
          example: North
    ContactItem:
      type: object
      properties:
        id:
          type: string
          readOnly: true
          example: 6526409e29e804cae4fedd81
        sku:
          type: string
          nullable: true
          example: '12345678'
        description:
          type: string
          nullable: true
          example: iPad
        quantity:
          type: number
          nullable: true
          example: 2
        unit_price:
          type: number
          nullable: true
        fixed_price:
          type: number
          nullable: true
        minimum_quantity:
          type: number
          nullable: true
        position:
          type: integer
          description: Order of the item in the contact's list.
          example: 0
  responses:
    Unauthorized:
      description: >-
        The API key is missing or invalid. A missing `X-API-KEY` returns `{
        "error": "Missing Authorization header" }`; an invalid key returns `{
        "code": "invalid_key", "message": "Invalid key" }`.
      content:
        application/json:
          schema:
            oneOf:
              - type: object
                title: Missing key
                required:
                  - error
                properties:
                  error:
                    type: string
                    example: Missing Authorization header
              - type: object
                title: Invalid key
                required:
                  - code
                properties:
                  code:
                    type: string
                    example: invalid_key
                  message:
                    type: string
                    example: Invalid key
          example:
            code: invalid_key
            message: Invalid key
    Forbidden:
      description: Your API key's user doesn't have permission for this action.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                example: forbidden
          example:
            code: forbidden
    ServerError:
      description: >-
        Unexpected server error. Retry with exponential backoff, and contact
        Detrack support if it persists.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Your Detrack API key, from **Integrations > API Key** in the dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.