{"openapi":"3.1.0","info":{"title":"Affinda (BYOK) API","version":"0.1.0","description":"Affinda (BYOK) lets an AI assistant read your own Affinda data through the Affinda API with a key you supply (API key (accounts on the global instance; US and EU instances use other hosts)). Read-only: 10 tools (list_organizations, list_workspaces, get_workspace, list_document_types, get_document_type, list_documents, get_document, get_usage, list_data_sources, list_tags). The BYOK key travels...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-affinda.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-affinda/docs"},"termsOfService":"https://connectorbay.com/byok-affinda/terms"},"servers":[{"url":"https://byok-affinda.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-affinda/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/list_organizations":{"post":{"operationId":"list_organizations","summary":"List the Affinda organizations the key can access with identifier, name and whether it is a trial. Use for \"Which Affind","description":"List the Affinda organizations the key can access with identifier, name and whether it is a trial. Use for \"Which Affinda organizations do I have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"list_organizationsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_workspaces":{"post":{"operationId":"list_workspaces","summary":"List the workspaces of an Affinda organization with document types, duplicate handling, pending and confirmed document c","description":"List the workspaces of an Affinda organization with document types, duplicate handling, pending and confirmed document counts and ingest email. Use for \"Which Affinda workspaces exist and how many documents await review\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"organization":{"description":"Organization identifier, as returned by list_organizations.","maxLength":64,"title":"Organization","type":"string"},"name":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only workspaces whose name matches this text.","title":"Name"}},"required":["organization"],"title":"list_workspacesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_workspace":{"post":{"operationId":"get_workspace","summary":"Get one Affinda workspace by identifier with its document types, counts, ingest email and settings. Use for \"Show the se","description":"Get one Affinda workspace by identifier with its document types, counts, ingest email and settings. Use for \"Show the settings of one Affinda workspace\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"identifier":{"description":"Workspace identifier, as returned by list_workspaces.","maxLength":64,"title":"Identifier","type":"string"}},"required":["identifier"],"title":"get_workspaceArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_document_types":{"post":{"operationId":"list_document_types","summary":"List the document types (extraction models and their ingest email) available to the account, optionally for one organiza","description":"List the document types (extraction models and their ingest email) available to the account, optionally for one organization or workspace. Use for \"Which document types can I extract with Affinda\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"organization":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only types of this organization identifier.","title":"Organization"},"workspace":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only types used in this workspace identifier.","title":"Workspace"}},"title":"list_document_typesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_document_type":{"post":{"operationId":"get_document_type","summary":"Get one Affinda document type by identifier with its name, ingest email and organization. Use for \"Details of one Affind","description":"Get one Affinda document type by identifier with its name, ingest email and organization. Use for \"Details of one Affinda document type\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"identifier":{"description":"Document type identifier, as returned by list_document_types.","maxLength":64,"title":"Identifier","type":"string"}},"required":["identifier"],"title":"get_document_typeArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_documents":{"post":{"operationId":"list_documents","summary":"List documents processed by Affinda with file name, workspace, readiness, failure, review state and dates; extracted fie","description":"List documents processed by Affinda with file name, workspace, readiness, failure, review state and dates; extracted field data is not returned. Use for \"Which Affinda documents failed or still need review\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"offset":{"anyOf":[{"maximum":1000000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of items to skip (for paging).","title":"Offset"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many items to return (1 to 100).","title":"Limit"},"workspace":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only documents of this workspace identifier.","title":"Workspace"},"state":{"anyOf":[{"enum":["uploaded","review","validated","archived","rejected"],"type":"string"},{"type":"null"}],"default":null,"description":"Only documents in this state: uploaded, review, validated, archived or rejected.","title":"State"},"created_dt":{"anyOf":[{"enum":["today","yesterday","week","month","year"],"type":"string"},{"type":"null"}],"default":null,"description":"Only documents created in this period: today, yesterday, week, month or year.","title":"Created Dt"},"search":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Text to match against document names.","title":"Search"},"failed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True to list only documents that failed processing.","title":"Failed"},"ready":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True to list only documents whose processing finished.","title":"Ready"}},"title":"list_documentsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_document":{"post":{"operationId":"get_document","summary":"Get the processing status and metadata of one Affinda document (file name, language, review state, dates, errors); extra","description":"Get the processing status and metadata of one Affinda document (file name, language, review state, dates, errors); extracted field values are not returned. Use for \"Was this Affinda document parsed successfully\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"identifier":{"description":"Document identifier, as returned by list_documents.","maxLength":64,"title":"Identifier","type":"string"}},"required":["identifier"],"title":"get_documentArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_usage":{"post":{"operationId":"get_usage","summary":"Get daily credit consumption of an Affinda organization over a date range, optionally for one workspace and document typ","description":"Get daily credit consumption of an Affinda organization over a date range, optionally for one workspace and document type. Use for \"How many Affinda credits did I use each day this month\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"organization":{"description":"Organization identifier, as returned by list_organizations.","maxLength":64,"title":"Organization","type":"string"},"start":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"First day of the range, as YYYY-MM-DD.","title":"Start"},"end":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Last day of the range, as YYYY-MM-DD.","title":"End"},"workspace":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Limit to this workspace identifier (needs document_type too).","title":"Workspace"},"document_type":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Limit to this document type identifier (needs workspace too).","title":"Document Type"}},"required":["organization"],"title":"get_usageArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_data_sources":{"post":{"operationId":"list_data_sources","summary":"List the custom mapping data sources (lookup lists used to match extracted values) with key and display properties. Use ","description":"List the custom mapping data sources (lookup lists used to match extracted values) with key and display properties. Use for \"Which Affinda data sources are configured\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"offset":{"anyOf":[{"maximum":1000000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of items to skip (for paging).","title":"Offset"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many items to return (1 to 100).","title":"Limit"},"organization":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only data sources of this organization identifier.","title":"Organization"},"workspace":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only data sources of this workspace identifier.","title":"Workspace"},"name":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only data sources whose name matches this text.","title":"Name"}},"title":"list_data_sourcesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_tags":{"post":{"operationId":"list_tags","summary":"List the document tags with name, workspace and document count. Use for \"Which tags do I use on Affinda documents\".","description":"List the document tags with name, workspace and document count. Use for \"Which tags do I use on Affinda documents\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many items to return (1 to 100).","title":"Limit"},"offset":{"anyOf":[{"maximum":1000000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of items to skip (for paging).","title":"Offset"},"workspace":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only tags of this workspace identifier.","title":"Workspace"},"name":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only tags whose name matches this text.","title":"Name"}},"title":"list_tagsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}