naftiko: 1.0.0-alpha2 info: label: Core API — Account Documents description: 'Core API — Account Documents. 3 operations. Lead operation: List documents. Self-contained Naftiko capability covering one Marqeta business surface.' tags: - Marqeta - Account Documents created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: MARQETA_API_KEY: MARQETA_API_KEY capability: consumes: - type: http namespace: core-account-documents baseUri: '' description: Core API — Account Documents business capability. Self-contained, no shared references. resources: - name: accounts-account_token-documents path: /accounts/{account_token}/documents operations: - name: getaccountdocuments method: GET description: List documents outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: account_token in: path type: string description: Unique identifier of the credit account for which you want to get documents. required: true - name: accounts-account_token-documents-document_type path: /accounts/{account_token}/documents/{document_type} operations: - name: getdocumentbyaccountandtype method: GET description: Retrieve document outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: account_token in: path type: string description: Unique identifier of the credit account for which to retrieve a specific type of document. required: true - name: document_type in: path type: string required: true - name: accounts-account_token-documents-document_type-history path: /accounts/{account_token}/documents/{document_type}/history operations: - name: getdocumenthistorybyaccountandtype method: GET description: Retrieve document history outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: account_token in: path type: string description: Unique identifier of the credit account for which to get document history. required: true - name: document_type in: path type: string required: true - name: count in: query type: integer description: Number of account document resources to retrieve. - name: start_index in: query type: integer description: Sort order index of the first resource in the returned array. - name: sort_by in: query type: string description: Field on which to sort. authentication: type: basic username: '{{env.MARQETA_USER}}' password: '{{env.MARQETA_PASS}}' exposes: - type: rest namespace: core-account-documents-rest port: 8080 description: REST adapter for Core API — Account Documents. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/accounts/{account-token}/documents name: accounts-account-token-documents description: REST surface for accounts-account_token-documents. operations: - method: GET name: getaccountdocuments description: List documents call: core-account-documents.getaccountdocuments with: account_token: rest.account_token outputParameters: - type: object mapping: $. - path: /v1/accounts/{account-token}/documents/{document-type} name: accounts-account-token-documents-document-type description: REST surface for accounts-account_token-documents-document_type. operations: - method: GET name: getdocumentbyaccountandtype description: Retrieve document call: core-account-documents.getdocumentbyaccountandtype with: account_token: rest.account_token document_type: rest.document_type outputParameters: - type: object mapping: $. - path: /v1/accounts/{account-token}/documents/{document-type}/history name: accounts-account-token-documents-document-type-history description: REST surface for accounts-account_token-documents-document_type-history. operations: - method: GET name: getdocumenthistorybyaccountandtype description: Retrieve document history call: core-account-documents.getdocumenthistorybyaccountandtype with: account_token: rest.account_token document_type: rest.document_type count: rest.count start_index: rest.start_index sort_by: rest.sort_by outputParameters: - type: object mapping: $. - type: mcp namespace: core-account-documents-mcp port: 9090 transport: http description: MCP adapter for Core API — Account Documents. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: list-documents description: List documents hints: readOnly: true destructive: false idempotent: true call: core-account-documents.getaccountdocuments with: account_token: tools.account_token outputParameters: - type: object mapping: $. - name: retrieve-document description: Retrieve document hints: readOnly: true destructive: false idempotent: true call: core-account-documents.getdocumentbyaccountandtype with: account_token: tools.account_token document_type: tools.document_type outputParameters: - type: object mapping: $. - name: retrieve-document-history description: Retrieve document history hints: readOnly: true destructive: false idempotent: true call: core-account-documents.getdocumenthistorybyaccountandtype with: account_token: tools.account_token document_type: tools.document_type count: tools.count start_index: tools.start_index sort_by: tools.sort_by outputParameters: - type: object mapping: $.