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

# Create a new log export job

> Queues an async export of deployment logs to CSV or JSON. The export is processed in the background and uploaded to S3. Poll GET /api/team/exports/{exportId} for status and download URL. Max one active export per team. Max 90-day date range.




## OpenAPI

````yaml /openapi-specs/brainbase-openapi.documented.json post /api/team/exports
openapi: 3.0.0
info:
  title: Brainbase REST API
  version: 1.0.3
  description: API documentation for Brainbase REST API
servers:
  - url: https://brainbase-monorepo-api.onrender.com
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Team
    description: Endpoints related to team functionalities
  - name: Integrations
    description: Endpoints for integrations
  - name: Assets
    description: Endpoints for asset management
  - name: Workers
    description: Endpoints for worker operations
  - name: Flows
    description: Endpoints for flow management
  - name: Voice Deployments
    description: Endpoints for voice deployments
  - name: Voice V1 Deployments
    description: Endpoints for voice v1 deployments
  - name: Voice Deployment Logs
    description: Endpoints for voice deployment logs
  - name: Voice Deployment Outbound Data
    description: Endpoints for voice deployment outbound data
  - name: Chat Deployments
    description: Endpoints for chat deployments
  - name: Chat Deployment Logs
    description: Endpoints for chat deployment logs
  - name: Tags
    description: Endpoints for tag management and worker tag assignment
  - name: Echo
    description: Endpoints for Echo test suites, agents, and scorecards
  - name: Flow Versions
    description: Endpoints for flow version control
  - name: Deployment History
    description: Endpoints for deployment change history
  - name: Deployment Parameters
    description: Endpoints for deployment parameters
  - name: Log Exports
    description: Endpoints for async log export to CSV/JSON
  - name: Logs
    description: >-
      Universal log lookup — fetch any deployment log by ID without needing
      worker or deployment context
  - name: Deployments
    description: >-
      Universal deployment lookup — fetch any deployment by ID without needing
      worker context
paths:
  /api/team/exports:
    post:
      tags:
        - Log Exports
      summary: Create a new log export job
      description: >
        Queues an async export of deployment logs to CSV or JSON. The export is
        processed in the background and uploaded to S3. Poll GET
        /api/team/exports/{exportId} for status and download URL. Max one active
        export per team. Max 90-day date range.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLogExportRequest'
      responses:
        '202':
          description: Export job created and queued
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                    enum:
                      - PENDING
                  createdAt:
                    type: string
                    format: date-time
        '400':
          description: Invalid request (bad date range, invalid fields, etc.)
        '401':
          description: Unauthorized
        '429':
          description: Export already in progress or rate limited
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import BrainbaseLabs from 'brainbase-labs';

            const client = new BrainbaseLabs({
              apiKey: process.env['BRAINBASE_LABS_API_KEY'], // This is the default and can be omitted
            });

            const _export = await client.team.exports.create({
              endDate: 'endDate',
              format: 'format',
              startDate: 'startDate',
            });

            console.log(_export.id);
        - lang: Python
          source: |-
            import os
            from brainbase_labs import BrainbaseLabs

            client = BrainbaseLabs(
                api_key=os.environ.get("BRAINBASE_LABS_API_KEY"),  # This is the default and can be omitted
            )
            export = client.team.exports.create(
                end_date="endDate",
                format="format",
                start_date="startDate",
            )
            print(export.id)
components:
  schemas:
    CreateLogExportRequest:
      type: object
      properties:
        format:
          type: string
          nullable: false
        logType:
          type: string
          nullable: true
        startDate:
          type: string
          nullable: false
        endDate:
          type: string
          nullable: false
        workerId:
          type: string
        deploymentId:
          type: string
        fields:
          type: array
          items:
            type: string
        filtersJson:
          type: object
          additionalProperties:
            type: string
      required:
        - format
        - startDate
        - endDate
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key authentication

````