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

# Store the next contract version of a file dataset

> The body is the contract file. It is stored byte for byte as the next version, which enters use, and the SHA-256 of the version is the SHA-256 of the file. After a day was accepted only additions are accepted. A source of kind sftp or ftp needs layout.manifest. 409 when the dataset changed while the version was being stored.



## OpenAPI

````yaml /pt/openapi/v3-current/reporter.yaml post /v1/file-datasets/{fileDatasetId}/contracts
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    Reporter generates regulatory, accounting and operational reports from
    templates over your data sources.
  license:
    name: Lerian Studio General License
  title: Reporter API
  version: 4.0.0
servers:
  - url: https://reporter.sandbox.lerian.net
security:
  - BearerAuth: []
tags:
  - description: Generated report instances and their lifecycle.
    name: Reports
  - description: Reusable report definitions.
    name: Templates
  - description: Interactive construction of report templates.
    name: Template Builder
  - description: Scheduled report due-date tracking.
    name: Deadlines
  - description: Configured inputs that feed report data.
    name: Data Sources
  - description: Configured file transports that deliver datasets.
    name: File Sources
  - description: Datasets read from file sources and the schedule of their days.
    name: File Datasets
  - description: Aggregated reporting metrics.
    name: Metrics
  - description: Published business event catalog and delivery policies.
    name: Streaming
paths:
  /v1/file-datasets/{fileDatasetId}/contracts:
    post:
      tags:
        - File Datasets
      summary: Store the next contract version of a file dataset
      description: >-
        The body is the contract file. It is stored byte for byte as the next
        version, which enters use, and the SHA-256 of the version is the SHA-256
        of the file. After a day was accepted only additions are accepted. A
        source of kind sftp or ftp needs layout.manifest. 409 when the dataset
        changed while the version was being stored.
      operationId: createFileDatasetContractVersion
      parameters:
        - description: Unique file dataset identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: fileDatasetId
          required: true
          schema:
            description: Unique file dataset identifier.
            type: string
        - description: >-
            Client-provided idempotency key that prevents a duplicate contract
            version
          example: file-dataset-contract-request-2026-01
          in: header
          name: X-Idempotency
          schema:
            description: >-
              Client-provided idempotency key that prevents a duplicate contract
              version
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: {}
              type: object
        description: JSON request payload.
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Version'
          description: Created
          headers:
            X-Idempotency-Replayed:
              schema:
                description: >-
                  Set to true when the response replays a completed idempotent
                  request
                type:
                  - string
                  - 'null'
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Not Found
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Conflict
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Internal Server Error
components:
  schemas:
    Version:
      additionalProperties: false
      properties:
        contract:
          description: >-
            The contract JSON the client sent. The stored bytes and sha256 are
            those received; an answer shows the same JSON without insignificant
            whitespace
        createdAt:
          description: When the version was stored, in UTC
          examples:
            - '2026-01-01T00:00:00Z'
          format: date-time
          type: string
        datasetId:
          description: Dataset the contract belongs to
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        sha256:
          description: Hex SHA-256 of the stored contract bytes
          examples:
            - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
          type: string
        version:
          description: Version number, from 1 and without gaps
          examples:
            - 1
          format: int64
          type: integer
      required:
        - datasetId
        - version
        - contract
        - sha256
        - createdAt
      type: object
    Detail:
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          examples:
            - - location: body.templateId
                message: expected string to match 'uuid' format
                value: not-a-uuid
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    ErrorDetail:
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          examples:
            - body.templateId
          type: string
        message:
          description: Error message text
          examples:
            - expected string to match 'uuid' format
          type: string
        value:
          description: The value at the given location
          examples:
            - not-a-uuid
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````

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