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

# Duplicate a report



## OpenAPI

````yaml POST /reports/{id}/duplicate
openapi: 3.0.0
info:
  title: Costory
  version: '1.0'
  description: API Documentation
servers:
  - url: https://app-api.costory.io
security: []
paths:
  /reports/{id}/duplicate:
    post:
      tags:
        - Reports
      summary: Duplicate a report
      operationId: duplicateReport
      parameters:
        - schema:
            type: string
            format: cuid
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
      responses:
        '201':
          description: Report duplicated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportCreated'
        '400':
          description: Validation or scope error
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ReportsValidationError'
                  - type: object
                    properties:
                      error:
                        type: string
                        enum:
                          - SCOPE_NOT_FOUND
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: string
                        enum:
                          - DESTINATIONS_REQUIRED
                    required:
                      - error
                    additionalProperties: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportsTeamMemberRequired'
        '404':
          description: Report not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportsNotFound'
      security:
        - bearerAuth: []
components:
  schemas:
    ReportCreated:
      type: object
      properties:
        reportId:
          type: string
      required:
        - reportId
      additionalProperties: false
    ReportsValidationError:
      type: object
      properties:
        error:
          type: string
          enum:
            - VALIDATION_ERROR
        reason:
          type: string
        details:
          anyOf:
            - type: string
            - type: number
            - type: boolean
            - nullable: true
              type: string
              enum:
                - null
            - type: array
              items: {}
            - type: object
              additionalProperties: {}
      required:
        - error
        - details
      additionalProperties: false
    Unauthorized:
      type: object
      properties:
        error:
          type: string
          description: Unauthorized error message
      required:
        - error
    ReportsTeamMemberRequired:
      type: object
      properties:
        error:
          type: string
          enum:
            - TEAM_MEMBER_REQUIRED
      required:
        - error
      additionalProperties: false
    ReportsNotFound:
      type: object
      properties:
        error:
          type: string
          enum:
            - NOT_FOUND
      required:
        - error
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or Clerk ak_* API key
      description: >-
        Send `Authorization: Bearer <credential>` using either a Clerk session
        JWT or a Clerk API key (`ak_*`). API keys may identify a user (`user_*`)
        or organization (`org_*`) principal and are generated in the Clerk
        Dashboard under API keys.

````