naftiko: 1.0.0-alpha2 info: label: API Reference — subpackage_files description: 'API Reference — subpackage_files. 8 operations. Lead operation: List files. Self-contained Naftiko capability covering one Flatfile business surface.' tags: - Flatfile - subpackage_files created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: FLATFILE_API_KEY: FLATFILE_API_KEY capability: consumes: - type: http namespace: flatfile-subpackage-files baseUri: https://api.x.flatfile.com/v1 description: API Reference — subpackage_files business capability. Self-contained, no shared references. resources: - name: files path: /files operations: - name: list method: GET description: List files outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: spaceId in: query type: string - name: pageSize in: query type: integer description: Number of files to return in a page (default 20) - name: pageNumber in: query type: integer description: Based on pageSize, which page of files to return - name: mode in: query type: string description: The storage mode of file to fetch, defaults to "import" - name: Authorization in: header type: string description: Bearer authentication required: true - name: X-Disable-Hooks in: header type: string required: true - name: upload method: POST description: Upload a file outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: Authorization in: header type: string description: Bearer authentication required: true - name: X-Disable-Hooks in: header type: string required: true - name: body in: body type: object description: Request body (JSON). required: false - name: files-detect-header path: /files/detect-header operations: - name: detectheader method: POST description: Detect header outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: Authorization in: header type: string description: Bearer authentication required: true - name: X-Disable-Hooks in: header type: string required: true - name: body in: body type: object description: Request body (JSON). required: false - name: files-fileId path: /files/{fileId} operations: - name: get method: GET description: Get a file outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: fileId in: path type: string required: true - name: Authorization in: header type: string description: Bearer authentication required: true - name: X-Disable-Hooks in: header type: string required: true - name: delete method: DELETE description: Delete a file outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: fileId in: path type: string required: true - name: Authorization in: header type: string description: Bearer authentication required: true - name: X-Disable-Hooks in: header type: string required: true - name: update method: PATCH description: Update a file outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: fileId in: path type: string description: ID of file to update required: true - name: Authorization in: header type: string description: Bearer authentication required: true - name: X-Disable-Hooks in: header type: string required: true - name: body in: body type: object description: Request body (JSON). required: false - name: files-fileId-clone path: /files/{fileId}/clone operations: - name: clone method: POST description: Clone a file outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: fileId in: path type: string required: true - name: Authorization in: header type: string description: Bearer authentication required: true - name: X-Disable-Hooks in: header type: string required: true - name: body in: body type: object description: Request body (JSON). required: false - name: files-fileId-download path: /files/{fileId}/download operations: - name: download method: GET description: Download a file outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: fileId in: path type: string required: true - name: Authorization in: header type: string description: Bearer authentication required: true - name: X-Disable-Hooks in: header type: string required: true authentication: type: bearer token: '{{env.FLATFILE_API_KEY}}' exposes: - type: rest namespace: flatfile-subpackage-files-rest port: 8080 description: REST adapter for API Reference — subpackage_files. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/files name: files description: REST surface for files. operations: - method: GET name: list description: List files call: flatfile-subpackage-files.list with: spaceId: rest.spaceId pageSize: rest.pageSize pageNumber: rest.pageNumber mode: rest.mode Authorization: rest.Authorization X-Disable-Hooks: rest.X-Disable-Hooks outputParameters: - type: object mapping: $. - method: POST name: upload description: Upload a file call: flatfile-subpackage-files.upload with: Authorization: rest.Authorization X-Disable-Hooks: rest.X-Disable-Hooks body: rest.body outputParameters: - type: object mapping: $. - path: /v1/files/detect-header name: files-detect-header description: REST surface for files-detect-header. operations: - method: POST name: detectheader description: Detect header call: flatfile-subpackage-files.detectheader with: Authorization: rest.Authorization X-Disable-Hooks: rest.X-Disable-Hooks body: rest.body outputParameters: - type: object mapping: $. - path: /v1/files/{fileid} name: files-fileid description: REST surface for files-fileId. operations: - method: GET name: get description: Get a file call: flatfile-subpackage-files.get with: fileId: rest.fileId Authorization: rest.Authorization X-Disable-Hooks: rest.X-Disable-Hooks outputParameters: - type: object mapping: $. - method: DELETE name: delete description: Delete a file call: flatfile-subpackage-files.delete with: fileId: rest.fileId Authorization: rest.Authorization X-Disable-Hooks: rest.X-Disable-Hooks outputParameters: - type: object mapping: $. - method: PATCH name: update description: Update a file call: flatfile-subpackage-files.update with: fileId: rest.fileId Authorization: rest.Authorization X-Disable-Hooks: rest.X-Disable-Hooks body: rest.body outputParameters: - type: object mapping: $. - path: /v1/files/{fileid}/clone name: files-fileid-clone description: REST surface for files-fileId-clone. operations: - method: POST name: clone description: Clone a file call: flatfile-subpackage-files.clone with: fileId: rest.fileId Authorization: rest.Authorization X-Disable-Hooks: rest.X-Disable-Hooks body: rest.body outputParameters: - type: object mapping: $. - path: /v1/files/{fileid}/download name: files-fileid-download description: REST surface for files-fileId-download. operations: - method: GET name: download description: Download a file call: flatfile-subpackage-files.download with: fileId: rest.fileId Authorization: rest.Authorization X-Disable-Hooks: rest.X-Disable-Hooks outputParameters: - type: object mapping: $. - type: mcp namespace: flatfile-subpackage-files-mcp port: 9090 transport: http description: MCP adapter for API Reference — subpackage_files. 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: flatfile-subpackage-files.list with: spaceId: tools.spaceId pageSize: tools.pageSize pageNumber: tools.pageNumber mode: tools.mode Authorization: tools.Authorization X-Disable-Hooks: tools.X-Disable-Hooks outputParameters: - type: object mapping: $. - name: upload-file description: Upload a file hints: readOnly: false destructive: false idempotent: false call: flatfile-subpackage-files.upload with: Authorization: tools.Authorization X-Disable-Hooks: tools.X-Disable-Hooks body: tools.body outputParameters: - type: object mapping: $. - name: detect-header description: Detect header hints: readOnly: false destructive: false idempotent: false call: flatfile-subpackage-files.detectheader with: Authorization: tools.Authorization X-Disable-Hooks: tools.X-Disable-Hooks body: tools.body outputParameters: - type: object mapping: $. - name: get-file description: Get a file hints: readOnly: true destructive: false idempotent: true call: flatfile-subpackage-files.get with: fileId: tools.fileId Authorization: tools.Authorization X-Disable-Hooks: tools.X-Disable-Hooks outputParameters: - type: object mapping: $. - name: delete-file description: Delete a file hints: readOnly: false destructive: true idempotent: true call: flatfile-subpackage-files.delete with: fileId: tools.fileId Authorization: tools.Authorization X-Disable-Hooks: tools.X-Disable-Hooks outputParameters: - type: object mapping: $. - name: update-file description: Update a file hints: readOnly: false destructive: false idempotent: true call: flatfile-subpackage-files.update with: fileId: tools.fileId Authorization: tools.Authorization X-Disable-Hooks: tools.X-Disable-Hooks body: tools.body outputParameters: - type: object mapping: $. - name: clone-file description: Clone a file hints: readOnly: false destructive: false idempotent: false call: flatfile-subpackage-files.clone with: fileId: tools.fileId Authorization: tools.Authorization X-Disable-Hooks: tools.X-Disable-Hooks body: tools.body outputParameters: - type: object mapping: $. - name: download-file description: Download a file hints: readOnly: true destructive: false idempotent: true call: flatfile-subpackage-files.download with: fileId: tools.fileId Authorization: tools.Authorization X-Disable-Hooks: tools.X-Disable-Hooks outputParameters: - type: object mapping: $.