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

# Export activity

> Exports rep-stats history as a CSV file. Contacts are scoped the same way as the feed. Returns a CSV download, not JSON.

Export rep-stats history as a CSV file

**This is the contact activity feed**, not a scheduling API — it exports the same event feed you see on the right-hand side of a contact's profile. Note the route is `/metrics/export`, outside the `/api` prefix.



## OpenAPI

````yaml /api-reference/specs/schedule.json get /metrics/export
openapi: 3.1.0
info:
  title: ConveYour API — Schedule
  description: >-
    Read a paginated feed of contact activity events and export rep-stats
    history as CSV.
  version: 1.0.0
servers:
  - url: https://{subdomain}.conveyour.com
    description: Your organization's ConveYour instance
    variables:
      subdomain:
        default: acme
        description: >-
          Your organization's slug — the subdomain you sign in on. Replace
          `acme` with yours: if you sign in at `bigco.conveyour.com`, enter
          `bigco`.
security:
  - conveyourToken: []
tags:
  - name: Schedule
    description: >-
      Read a paginated feed of contact activity events and export rep-stats
      history as CSV.
paths:
  /metrics/export:
    get:
      tags:
        - Schedule
      summary: Export activity
      description: >-
        Exports rep-stats history as a CSV file. Contacts are scoped the same
        way as the feed. Returns a CSV download, not JSON.


        Export rep-stats history as a CSV file


        **This is the contact activity feed**, not a scheduling API — it exports
        the same event feed you see on the right-hand side of a contact's
        profile. Note the route is `/metrics/export`, outside the `/api` prefix.
      operationId: exportRepStatsHistoryAsACsvFile
      parameters:
        - name: date
          in: query
          description: >-
            Restrict to the day range containing this date (parsed in the org's
            rep-bucket timezone). Also appended to the downloaded filename.
          schema:
            type: string
        - name: sort
          in: query
          description: Sort option passed through to the history query.
          schema:
            type: string
        - name: record_filters
          in: query
          description: Record-level filters applied to the exported history rows.
          schema:
            type: string
        - name: fields
          in: query
          description: >-
            Comma-separated list (or array) of fields to project when scoping
            contacts.
          schema:
            type: string
        - name: teams
          in: query
          description: Team id (or array of team ids) to scope contacts by team.
          schema:
            type: string
        - name: search
          in: query
          description: Contact search string. `filters` is accepted as an alias.
          schema:
            type: string
        - name: bookmark
          in: query
          description: Apply a saved bookmark's contact filter.
          schema:
            type: string
        - $ref: '#/components/parameters/teams'
      responses:
        '200':
          description: >-
            A CSV file. Returns `Content-Type: text/csv` with a
            content-disposition attachment header — there is no JSON envelope on
            this endpoint. The file is named from the `name` query parameter
            (special characters stripped, spaces replaced), and is sent with
            `pragma: no-cache` and `expires: 0`.
          content:
            text/csv:
              schema:
                type: string
                format: binary
                description: CSV rows. Downloaded as <name>.csv.
        '403':
          $ref: '#/components/responses/ForbiddenToken'
components:
  parameters:
    teams:
      name: teams[]
      in: query
      description: >-
        Team scope for the request, as one or more team ObjectIds. The brackets
        are required: PHP keeps only the last value for a repeated plain key, so
        `teams=A&teams=B` silently resolves to B alone. On requests with a JSON
        body you may send `teams` (no brackets) in the body instead.


        **Values that are not valid ObjectIds are silently ignored** — a
        mistyped team ID behaves as if no team was sent. See the [teams section
        of the API conventions guide](/guides/api-conventions#team-scoping).
      style: form
      explode: true
      schema:
        type: array
        items:
          type: string
      example:
        - 64a1b2c3d4e5f6a7b8c9d0ff
  responses:
    ForbiddenToken:
      description: >-
        The token is missing, expired, or not permitted for this HTTP method.
        **This endpoint enforces no named permission**, so a 403 here never
        carries a `permission` field.
      content:
        application/json:
          example:
            status: failed
            message: Token is either expired or does not have the correct permissions
            data: []
  securitySchemes:
    conveyourToken:
      type: apiKey
      in: header
      name: x-conveyour-token
      description: >-
        Your API key token. Contacts endpoints require a **Server-only — Full
        API** key — see [Authentication](/quickstart).

````

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