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

# Start an OTLP export of a project

> Queues an export of the project's logs, traces and metrics over [from, to), at most 31 days, as gzipped OTLP/JSON files (one Export*ServiceRequest per line), read within the plan's retention. Free on every plan; one export at a time per organization, 5 a day. Owners and admins only: the console session, the CLI signed in as you (apsio login), or an agent with your exports:write grant (Settings > Agents and tokens); never a project token (person_required, D115). Audited as export.create, with via, tool, oauth_client_id and grant_id. Send `Content-Type: application/json`.



## OpenAPI

````yaml /api-reference/openapi.json post /projects/{projectId}/exports
openapi: 3.1.0
info:
  title: Apsio API
  version: 0.1.0
  description: >-
    Read API v0: your projects, release health and comparisons, missing symbols,
    issues, sessions, vitals, cohort comparisons, performance (app start,
    screens, hangs, MetricKit) and network endpoints and traces for one project.
    Authenticate with a project token as a bearer token, with an OAuth access
    token from Apsio's authorization server (MCP clients), or, from the console,
    with the session cookie of a member of the project's organization.
servers:
  - url: https://api.apsio.io/v1
security: []
paths:
  /projects/{projectId}/exports:
    post:
      summary: Start an OTLP export of a project
      description: >-
        Queues an export of the project's logs, traces and metrics over [from,
        to), at most 31 days, as gzipped OTLP/JSON files (one
        Export*ServiceRequest per line), read within the plan's retention. Free
        on every plan; one export at a time per organization, 5 a day. Owners
        and admins only: the console session, the CLI signed in as you (apsio
        login), or an agent with your exports:write grant (Settings > Agents and
        tokens); never a project token (person_required, D115). Audited as
        export.create, with via, tool, oauth_client_id and grant_id. Send
        `Content-Type: application/json`.
      parameters:
        - schema:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            example: 0192f3a4-0000-7000-8000-00000000a101
          required: true
          name: projectId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                signals:
                  type: array
                  items:
                    type: string
                    enum:
                      - logs
                      - traces
                      - metrics
                    description: >-
                      logs (crashes, hangs and events included), traces (spans)
                      or metrics.
                  minItems: 1
                  maxItems: 3
                from:
                  type: string
                  format: date-time
                to:
                  type: string
                  format: date-time
              required:
                - signals
                - from
                - to
      responses:
        '201':
          description: Queued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OtlpExport'
        '400':
          description: No signal, an empty or too long range, or one in the future.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: No valid bearer token or console session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Not allowed: the sandbox; a project token (person_required: exports
            need a person, D115); a member (owners and admins only); or an agent
            without the person's exports:write grant (grant_required,
            grant_expired, with grant_url).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WriteRefusal'
        '404':
          description: No such project, or no such export in it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: An export of this organization is already queued or running.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: >-
            The project or its organization is being deleted (`erasing`):
            nothing more to read; do not retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '415':
          description: The body is not JSON.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: The organization started its 5 exports for the day.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Exports are not set up here.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearer: []
        - session: []
components:
  schemas:
    OtlpExport:
      type: object
      properties:
        id:
          type: string
        project_id:
          type: string
        signals:
          type: array
          items:
            type: string
            enum:
              - logs
              - traces
              - metrics
            description: >-
              logs (crashes, hangs and events included), traces (spans) or
              metrics.
        from:
          type: string
          description: The range start, inclusive.
        to:
          type: string
          description: The range end, exclusive.
        status:
          type: string
          enum:
            - queued
            - running
            - done
            - failed
        requested_by:
          type:
            - string
            - 'null'
        created_at:
          type: string
        started_at:
          type:
            - string
            - 'null'
        finished_at:
          type:
            - string
            - 'null'
        counts:
          type: object
          additionalProperties:
            type: number
          description: Records exported per signal, once done.
        error:
          type:
            - string
            - 'null'
          description: Why it failed, as a code; null otherwise.
        expires_at:
          type:
            - string
            - 'null'
          description: 'When the files are deleted: 7 days after it is done.'
      required:
        - id
        - project_id
        - signals
        - from
        - to
        - status
        - requested_by
        - created_at
        - started_at
        - finished_at
        - counts
        - error
        - expires_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_request
            message:
              type: string
            subject:
              type: string
              enum:
                - organization
                - project
              description: >-
                With `erasing` (410) only: what is being deleted, the
                organization or the project.
          required:
            - code
            - message
      required:
        - error
    WriteRefusal:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: grant_required
            message:
              type: string
            grant_url:
              type: string
              description: >-
                grant_required and grant_expired for an OAuth client: the
                console page (Settings > Agents and tokens) where the user gives
                this client the capability.
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: >-
        A project token (apsio_pt_v0...), which reads exactly one project, or an
        OAuth access token issued for the API, which reads what its user can.
        Access tokens issued for Apsio's MCP server are accepted only from the
        MCP server itself.
    session:
      type: apiKey
      in: cookie
      name: apsio_session
      description: >-
        The console session, set by /v1/auth/callback (`__Host-apsio_session`
        when host-only).

````

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