> ## 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.

# Edit a file source

> Edits the name or the block of the source's kind; the kind never changes. A call that changes the destination (host, port, user, auth, knownHosts, tls, caCertPem, endpoint, bucket or accessKeyId) of an sftp or ftp source, or of an s3 source with accessKeyId, must send secret in the same call. An edit is refused with 409 and writes nothing when the file source changed while this edit ran; reload the source and send the edit again. secret and passphrase are write-only: they are sealed on arrival and never returned. externalId belongs to Reporter, which generates it. An s3 bucket on AWS without roleArn is incomplete until an edit saves roleArn; outside AWS, accessKeyId and secret are required. A source that moves to an AWS bucket loses its stored secret and takes no secret. Saving or changing roleArn proves the externalId first.



## OpenAPI

````yaml /en/openapi/v3-current/reporter.yaml patch /v1/file-sources/{fileSourceId}
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-sources/{fileSourceId}:
    patch:
      tags:
        - File Sources
      summary: Edit a file source
      description: >-
        Edits the name or the block of the source's kind; the kind never
        changes. A call that changes the destination (host, port, user, auth,
        knownHosts, tls, caCertPem, endpoint, bucket or accessKeyId) of an sftp
        or ftp source, or of an s3 source with accessKeyId, must send secret in
        the same call. An edit is refused with 409 and writes nothing when the
        file source changed while this edit ran; reload the source and send the
        edit again. secret and passphrase are write-only: they are sealed on
        arrival and never returned. externalId belongs to Reporter, which
        generates it. An s3 bucket on AWS without roleArn is incomplete until an
        edit saves roleArn; outside AWS, accessKeyId and secret are required. A
        source that moves to an AWS bucket loses its stored secret and takes no
        secret. Saving or changing roleArn proves the externalId first.
      operationId: updateFileSource
      parameters:
        - description: Unique file source identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: fileSourceId
          required: true
          schema:
            description: Unique file source identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                ftp:
                  $ref: '#/components/schemas/FileSourceFTPInput'
                  description: Whole replacement of the FTP settings.
                name:
                  description: >-
                    New display name; unique per client, trimmed, 1 to 255
                    characters.
                  examples:
                    - daily-deliveries
                  type: string
                passphrase:
                  description: >-
                    Write-only passphrase of an sftp private key; sent only with
                    secret. Never returned.
                  examples:
                    - '-'
                  type: string
                  x-lerian-secret: true
                s3:
                  $ref: '#/components/schemas/FileSourceS3Input'
                  description: Whole replacement of the object storage settings.
                secret:
                  description: >-
                    Write-only credential that replaces the stored one. Required
                    when the destination changes and the result holds a key;
                    refused when the result holds no key. Never returned.
                  examples:
                    - '-'
                  type: string
                  x-lerian-secret: true
                sftp:
                  $ref: '#/components/schemas/FileSourceSFTPInput'
                  description: Whole replacement of the SFTP settings.
              type: object
        description: JSON request payload.
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileSource'
          description: OK
        '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:
    FileSourceFTPInput:
      additionalProperties: false
      properties:
        caCertPem:
          description: >-
            PEM of the CA that signed the server certificate, when it is not a
            public one.
          examples:
            - ''
          type: string
        host:
          description: Server host name or IP address.
          examples:
            - ftp.example.com
          type: string
        port:
          description: Server port.
          examples:
            - 21
          format: int64
          type: integer
        tls:
          description: 'Transport security: none, explicit or implicit.'
          examples:
            - explicit
          type: string
        user:
          description: Login user.
          examples:
            - reporter
          type: string
      required:
        - host
        - port
        - user
        - tls
      type: object
    FileSourceS3Input:
      additionalProperties: false
      properties:
        accessKeyId:
          description: >-
            Static access key id: required for storage outside AWS, refused for
            AWS.
          examples:
            - AKIDEXAMPLE
          type: string
        bucket:
          description: Bucket name.
          examples:
            - daily-deliveries
          type: string
        endpoint:
          description: >-
            Endpoint URL, only for storage outside AWS; empty for AWS. An AWS
            host is refused unless it is https.
          examples:
            - https://storage.example.com
          type: string
        region:
          description: Bucket region.
          examples:
            - sa-east-1
          type: string
        roleArn:
          description: >-
            ARN of the IAM role Reporter assumes to read an AWS bucket; sent
            when editing, not on create.
          examples:
            - arn:aws:iam::123456789012:role/reporter-reader
          type: string
        usePathStyle:
          description: Address buckets by path instead of by host name.
          examples:
            - true
          type: boolean
      required:
        - bucket
        - region
      type: object
    FileSourceSFTPInput:
      additionalProperties: false
      properties:
        auth:
          description: 'Authentication: password or privateKey.'
          examples:
            - password
          type: string
        host:
          description: Server host name or IP address.
          examples:
            - sftp.example.com
          type: string
        knownHosts:
          description: The server public keys, one per line.
          examples:
            - sftp.example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExample
          type: string
        port:
          description: Server port.
          examples:
            - 22
          format: int64
          type: integer
        user:
          description: Login user.
          examples:
            - reporter
          type: string
      required:
        - host
        - port
        - user
        - auth
        - knownHosts
      type: object
    FileSource:
      additionalProperties: false
      properties:
        createdAt:
          description: When the file source was created, in UTC
          examples:
            - '2026-01-01T00:00:00Z'
          format: date-time
          type: string
        ftp:
          $ref: '#/components/schemas/FTP'
          description: FTP settings, set only when kind is ftp
        id:
          description: File source identifier
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        kind:
          description: 'Transport: s3, sftp or ftp'
          examples:
            - sftp
          type: string
        lastConnection:
          $ref: '#/components/schemas/DataSourceConnection'
          description: Outcome of the most recent connection test
        name:
          description: Unique name of the file source within the tenant
          examples:
            - daily-deliveries
          type: string
        s3:
          $ref: '#/components/schemas/S3'
          description: S3 settings, set only when kind is s3
        sftp:
          $ref: '#/components/schemas/SFTP'
          description: SFTP settings, set only when kind is sftp
        updatedAt:
          description: When the file source was last edited, in UTC
          examples:
            - '2026-01-01T00:00:00Z'
          format: date-time
          type: string
      required:
        - id
        - name
        - kind
        - createdAt
        - updatedAt
      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
    FTP:
      additionalProperties: false
      properties:
        caCertPem:
          description: CA that signed the server certificate, when it is not a public one
          examples:
            - '-----BEGIN CERTIFICATE-----'
          type: string
        host:
          description: Server host name
          examples:
            - ftp.example.com
          type: string
        port:
          description: Server port
          examples:
            - 21
          format: int64
          type: integer
        tls:
          description: 'TLS mode: none, explicit or implicit'
          examples:
            - explicit
          type: string
        user:
          description: Login name
          examples:
            - reporter
          type: string
      required:
        - host
        - port
        - user
        - tls
      type: object
    DataSourceConnection:
      additionalProperties: false
      properties:
        checkedAt:
          description: >-
            When the last probe ran, in UTC. Distinct from updatedAt, which
            records configuration edits
          examples:
            - '2026-01-01T00:00:00Z'
          format: date-time
          type: string
        latencyMs:
          description: Full dial+ping round trip of the last probe, in milliseconds
          examples:
            - 42
          format: int64
          type: integer
        message:
          description: >-
            Client-safe classification of the last probe; raw driver errors
            never appear here
          examples:
            - connection successful
          type: string
        status:
          description: 'Outcome of the last probe: connected or failed'
          examples:
            - connected
          type: string
      required:
        - status
        - message
        - latencyMs
        - checkedAt
      type: object
    S3:
      additionalProperties: false
      properties:
        accessKeyId:
          description: Access key id of a static credential
          examples:
            - AKIAEXAMPLE
          type: string
        bucket:
          description: Bucket name
          examples:
            - deliveries
          type: string
        endpoint:
          description: Endpoint URL, set only for storage outside AWS
          examples:
            - https://storage.example.com
          type: string
        externalId:
          description: >-
            External id the role trust policy must require; minted by the
            service on create
          examples:
            - 3f2c9a1e
          type: string
        region:
          description: Bucket region
          examples:
            - us-east-1
          type: string
        roleArn:
          description: Role the service assumes to read the bucket
          examples:
            - arn:aws:iam::123456789012:role/reader
          type: string
        trustPrincipal:
          description: >-
            AWS identity the role trust policy must trust; computed on read,
            never stored
          examples:
            - arn:aws:iam::123456789012:role/reporter
          type: string
        usePathStyle:
          description: Address the bucket by path instead of by host name
          examples:
            - false
          type: boolean
      required:
        - bucket
        - region
      type: object
    SFTP:
      additionalProperties: false
      properties:
        auth:
          description: 'Credential kind: password or privateKey'
          examples:
            - password
          type: string
        host:
          description: Server host name
          examples:
            - sftp.example.com
          type: string
        knownHosts:
          description: The server's public keys, one per line
          examples:
            - sftp.example.com ssh-ed25519 AAAAC3Nza
          type: string
        port:
          description: Server port
          examples:
            - 22
          format: int64
          type: integer
        user:
          description: Login name
          examples:
            - reporter
          type: string
      required:
        - host
        - port
        - user
        - auth
        - knownHosts
      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.