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

# Export API key usage

> Downloads the full usage log as CSV (default) or JSON. Optional `before` / `after` ISO-8601 timestamps narrow the time range.

### Requirements

- **Permission:** `usage:read`.
- **Project access:** the path project must match the API key's project.



## OpenAPI

````yaml /signal/api-reference/openapi.json get /v1/projects/{projectId}/api-keys/{keyId}/usage/export
openapi: 3.1.0
info:
  title: Apollo Signal API
  version: 1.0.0
  description: >-
    Public REST API for transactional email, contacts, audiences, webhooks,
    metrics, projects, and sending domains.
servers:
  - url: https://api.signal.apollodeploy.com
    description: Production
security: []
tags:
  - name: Emails
    description: Send, inspect, cancel, validate, and stream transactional email activity.
  - name: Metrics
    description: Read project, topic, message, and deliverability analytics.
  - name: Suppressions
    description: Manage addresses that Apollo Signal must not send to.
  - name: Segments
    description: Create dynamic contact groups and inspect their membership.
  - name: Topics
    description: Manage subscription topics and topic membership.
  - name: Contact properties
    description: Define the custom fields available on project contacts.
  - name: Contacts
    description: >-
      Manage contacts, audience membership, images, activity, and engagement
      data.
  - name: Webhooks
    description: Manage webhook endpoints, deliveries, tests, and replays.
  - name: API key usage
    description: Inspect API key metadata and request usage without exposing raw keys.
  - name: Projects
    description: Inspect projects and project-scoped email logs.
  - name: Sending domains
    description: >-
      Register, verify, inspect, and remove sending domains and BIMI
      configuration.
paths:
  /v1/projects/{projectId}/api-keys/{keyId}/usage/export:
    get:
      tags:
        - API key usage
      summary: Export API key usage
      description: >-
        Downloads the full usage log as CSV (default) or JSON. Optional `before`
        / `after` ISO-8601 timestamps narrow the time range.


        ### Requirements


        - **Permission:** `usage:read`.

        - **Project access:** the path project must match the API key's project.
      operationId: exportApiKeyUsage
      parameters:
        - name: projectId
          in: path
          required: true
          deprecated: false
          explode: false
          schema:
            type: string
            title: String
          description: >-
            Project identifier. For API-key authentication, it must match the
            project bound to the key.
        - name: keyId
          in: path
          required: true
          deprecated: false
          explode: false
          schema:
            type: string
            title: String
          description: API key identifier. Raw API key values are never accepted here.
        - name: format
          in: query
          required: false
          deprecated: false
          explode: false
          schema:
            type: string
            title: String
          description: 'Export encoding: `csv` (default) or `json`.'
        - name: before
          in: query
          required: false
          deprecated: false
          explode: false
          schema:
            type: string
            title: String
          description: Return records before this ISO 8601 timestamp.
        - name: after
          in: query
          required: false
          deprecated: false
          explode: false
          schema:
            type: string
            title: String
          description: >-
            Return records after this ISO 8601 timestamp, or continue from the
            supplied membership cursor where documented.
      responses:
        '200':
          description: >-
            Usage-log attachment encoded as CSV by default, or JSON when
            `format=json` is supplied.
          headers:
            Content-Disposition:
              description: Attachment filename selected for the requested export format.
              schema:
                type: string
          content:
            text/csv:
              schema:
                type: string
                description: UTF-8 CSV usage export.
            application/json:
              schema:
                type: string
                description: JSON usage export document.
        '401':
          headers: {}
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/com.apollodeploy.commons.core.error.ApiProblem
          description: >-
            The API key or stream token is missing, invalid, expired, or
            inactive.
        '403':
          description: >-
            The credential lacks the required permission or cannot access this
            project.
          headers: {}
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/com.apollodeploy.commons.core.error.ApiProblem
        '404':
          headers: {}
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/com.apollodeploy.commons.core.error.ApiProblem
          description: The requested resource was not found in the authenticated project.
        '413':
          headers: {}
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/com.apollodeploy.commons.core.error.ApiProblem
          description: The request or imported data exceeds the supported size.
      deprecated: false
      security:
        - bearerAuth: []
components:
  schemas:
    com.apollodeploy.commons.core.error.ApiProblem:
      type: object
      properties:
        code:
          type: string
          title: ErrorCode
        detail:
          type: string
          title: String
        errors:
          type: array
          items:
            $ref: >-
              #/components/schemas/com.apollodeploy.commons.core.error.FieldProblem
          title: List<FieldProblem>
        instance:
          type: string
          title: ProblemInstance
        requestId:
          type: string
          title: String
        status:
          type: integer
          format: int32
          title: Int
        title:
          type: string
          title: String
        type:
          type: string
          title: ProblemType
      required:
        - code
        - status
        - title
        - type
      title: ApiProblem
    com.apollodeploy.commons.core.error.FieldProblem:
      type: object
      properties:
        detail:
          type: string
          title: String
        pointer:
          type: string
          title: String
      required:
        - detail
        - pointer
      title: FieldProblem
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Project-bound Apollo Signal API key. Keys begin with `ap_signal_` and
        must carry the permission shown on the operation.

````