openapi: 3.2.0 info: title: LDM v3 Exports API description: 'Multi-tenant B2B outreach automation platform. Auth: JWT Bearer (15-min) or tenant API key (ldm_*) managed in CRM Settings → API Keys. All tenant-scoped endpoints require the X-Tenant-Id header.' version: 1.0.0 contact: {} servers: - url: https://api.live-direct-marketing.online description: Production - url: https://api.dev.live-direct-marketing.online description: Development - url: http://127.0.0.1:3000 description: Local tags: - name: Exports paths: /api/exports/columns: get: operationId: ExportsController_getColumns parameters: - name: entity required: true in: query schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: List exportable columns and groups for an entity tags: - Exports x-required-scope: - exports:read /api/exports: post: operationId: ExportsController_create parameters: - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateExportDto' responses: '201': description: '' security: - jwt: [] summary: Create an export job tags: - Exports get: operationId: ExportsController_list parameters: - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: List my export jobs tags: - Exports /api/exports/{id}: get: operationId: ExportsController_status parameters: - name: id required: true in: path schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: Get the status of an export job tags: - Exports /api/exports/{id}/download: get: operationId: ExportsController_download parameters: - name: id required: true in: path schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: Download a completed export file tags: - Exports components: schemas: CreateExportDto: type: object properties: type: type: string description: Export type enum: - mailing_csv - contacts_csv - companies_csv - entity_table - combined example: contacts_csv params: description: Export parameters, dependent on the type allOf: - $ref: '#/components/schemas/ExportParamsDto' required: - type ExportParamsDto: type: object properties: taskId: type: string description: 'mailing_csv: обязателен — воркер бросает `taskId is required` без него.' pattern: UUID_SHAPE listId: type: string description: 'contacts_csv / companies_csv: идентификатор списка — строка, не число.' pattern: UUID_SHAPE status: type: string entity: type: object description: 'entity_table: воркер сам проверяет этот набор — держим его в ОДНОМ месте.' columns: minItems: 1 type: array items: type: string filters: type: object securitySchemes: jwt: scheme: bearer bearerFormat: JWT type: http description: JWT access token from /auth/login (Bearer ) tenant-api-key: scheme: bearer bearerFormat: JWT type: http description: Tenant API key (Bearer ldm_*) for MCP/A2A clients. Issued via CRM Settings → API Keys. rpa-service: scheme: bearer bearerFormat: JWT type: http description: Dedicated RPA service key. No tenant API-key or query-key authentication.