Writer · Capability

API — File API

API — File API. 6 operations. Lead operation: List files. Self-contained Naftiko capability covering one Writer business surface.

Run with Naftiko WriterFile API

What You Can Do

GET
Gatewaygetfiles — List files
/v1/v1/files
POST
Gatewayuploadfile — Upload file
/v1/v1/files
POST
Gatewayretryfailedfiles — Retry failed files
/v1/v1/files/retry
GET
Gatewaygetfile — Retrieve file
/v1/v1/files/{file-id}
DELETE
Gatewaydeletefile — Delete file
/v1/v1/files/{file-id}
GET
Gatewaydownloadfile — Download file
/v1/v1/files/{file-id}/download

MCP Tools

list-files

List files

read-only idempotent
upload-file

Upload file

retry-failed-files

Retry failed files

retrieve-file

Retrieve file

read-only idempotent
delete-file

Delete file

idempotent
download-file

Download file

read-only idempotent

Capability Spec

writer-file-api.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: API — File API
  description: 'API — File API. 6 operations. Lead operation: List files. Self-contained Naftiko capability covering one Writer
    business surface.'
  tags:
  - Writer
  - File API
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    WRITER_API_KEY: WRITER_API_KEY
capability:
  consumes:
  - type: http
    namespace: writer-file-api
    baseUri: https://api.writer.com
    description: API — File API business capability. Self-contained, no shared references.
    resources:
    - name: v1-files
      path: /v1/files
      operations:
      - name: gatewaygetfiles
        method: GET
        description: List files
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: before
          in: query
          type: string
          description: The ID of the first object in the previous page. This parameter instructs the API to return the previous
            page of results.
        - name: after
          in: query
          type: string
          description: The ID of the last object in the previous page. This parameter instructs the API to return the next
            page of results.
        - name: limit
          in: query
          type: integer
          description: Specifies the maximum number of objects returned in a page. The default value is 50. The minimum value
            is 1, and the maximum value is 100.
        - name: order
          in: query
          type: string
          description: Specifies the order of the results. Valid values are asc for ascending and desc for descending.
        - name: graph_id
          in: query
          type: string
          description: The unique identifier of the graph to which the files belong.
        - name: status
          in: query
          type: string
          description: Specifies the status of the files to retrieve. Valid values are in_progress, completed or failed.
        - name: file_types
          in: query
          type: string
          description: 'The extensions of the files to retrieve. Separate multiple extensions with a comma. For example: `pdf,jpg,docx`.'
      - name: gatewayuploadfile
        method: POST
        description: Upload file
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Content-Disposition
          in: header
          type: string
          description: The disposition type of the file, typically used to indicate the form-data name. Use `attachment` with
            the filename parameter to specify the name of the file, f
          required: true
        - name: Content-Type
          in: header
          type: string
          description: The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types/Common_types) of the file
            being uploaded. Supports `txt`, `doc`, `docx`, `ppt`, `pp
          required: true
        - name: Content-Length
          in: header
          type: integer
          description: The size of the file in bytes.
          required: true
        - name: graphId
          in: query
          type: string
          description: The unique identifier of the Knowledge Graph to associate the uploaded file with.
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: v1-files-retry
      path: /v1/files/retry
      operations:
      - name: gatewayretryfailedfiles
        method: POST
        description: Retry failed files
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: v1-files-file_id
      path: /v1/files/{file_id}
      operations:
      - name: gatewaygetfile
        method: GET
        description: Retrieve file
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: file_id
          in: path
          type: string
          description: The unique identifier of the file.
          required: true
      - name: gatewaydeletefile
        method: DELETE
        description: Delete file
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: file_id
          in: path
          type: string
          description: The unique identifier of the file.
          required: true
    - name: v1-files-file_id-download
      path: /v1/files/{file_id}/download
      operations:
      - name: gatewaydownloadfile
        method: GET
        description: Download file
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: file_id
          in: path
          type: string
          description: The unique identifier of the file.
          required: true
    authentication:
      type: bearer
      token: '{{env.WRITER_API_KEY}}'
  exposes:
  - type: rest
    namespace: writer-file-api-rest
    port: 8080
    description: REST adapter for API — File API. One Spectral-compliant resource per consumed operation, prefixed with /v1.
    resources:
    - path: /v1/v1/files
      name: v1-files
      description: REST surface for v1-files.
      operations:
      - method: GET
        name: gatewaygetfiles
        description: List files
        call: writer-file-api.gatewaygetfiles
        with:
          before: rest.before
          after: rest.after
          limit: rest.limit
          order: rest.order
          graph_id: rest.graph_id
          status: rest.status
          file_types: rest.file_types
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: gatewayuploadfile
        description: Upload file
        call: writer-file-api.gatewayuploadfile
        with:
          Content-Disposition: rest.Content-Disposition
          Content-Type: rest.Content-Type
          Content-Length: rest.Content-Length
          graphId: rest.graphId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/v1/files/retry
      name: v1-files-retry
      description: REST surface for v1-files-retry.
      operations:
      - method: POST
        name: gatewayretryfailedfiles
        description: Retry failed files
        call: writer-file-api.gatewayretryfailedfiles
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/v1/files/{file-id}
      name: v1-files-file-id
      description: REST surface for v1-files-file_id.
      operations:
      - method: GET
        name: gatewaygetfile
        description: Retrieve file
        call: writer-file-api.gatewaygetfile
        with:
          file_id: rest.file_id
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: gatewaydeletefile
        description: Delete file
        call: writer-file-api.gatewaydeletefile
        with:
          file_id: rest.file_id
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/v1/files/{file-id}/download
      name: v1-files-file-id-download
      description: REST surface for v1-files-file_id-download.
      operations:
      - method: GET
        name: gatewaydownloadfile
        description: Download file
        call: writer-file-api.gatewaydownloadfile
        with:
          file_id: rest.file_id
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: writer-file-api-mcp
    port: 9090
    transport: http
    description: MCP adapter for API — File API. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: list-files
      description: List files
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: writer-file-api.gatewaygetfiles
      with:
        before: tools.before
        after: tools.after
        limit: tools.limit
        order: tools.order
        graph_id: tools.graph_id
        status: tools.status
        file_types: tools.file_types
      outputParameters:
      - type: object
        mapping: $.
    - name: upload-file
      description: Upload file
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: writer-file-api.gatewayuploadfile
      with:
        Content-Disposition: tools.Content-Disposition
        Content-Type: tools.Content-Type
        Content-Length: tools.Content-Length
        graphId: tools.graphId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: retry-failed-files
      description: Retry failed files
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: writer-file-api.gatewayretryfailedfiles
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: retrieve-file
      description: Retrieve file
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: writer-file-api.gatewaygetfile
      with:
        file_id: tools.file_id
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-file
      description: Delete file
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: writer-file-api.gatewaydeletefile
      with:
        file_id: tools.file_id
      outputParameters:
      - type: object
        mapping: $.
    - name: download-file
      description: Download file
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: writer-file-api.gatewaydownloadfile
      with:
        file_id: tools.file_id
      outputParameters:
      - type: object
        mapping: $.