Skip to content

Viewing Documents

FSCO provides APIs for retrieving document details and tracking document activity. This guide covers both viewing document information and monitoring document processing status.

Before you begin, ensure you have:

  • A valid FSCO API key
  • Your application’s environment configured with the API key
  • A document ID to view
  • A collection ID (if filtering by collection)
GET /v2/document/{documentId}
get-document-by-id.sh
#!/bin/bash
curl -X GET "https://api.fsco.io/v2/document/8c1d496f-2827-4750-a11f-74b48c11108d" \
-H "x-api-key: $FSCO_API_KEY" \
-H "x-api-secret: $FSCO_API_SECRET" \
-H "Content-Type: application/json"
response.json
{
"id": "79e6f652-b513-4041-89de-3e468853ef2d",
"refId": "4881927e-7b0f-4d39-b248-c7b97ffd28d1",
"docExt": "application/pdf",
"docName": "Invoice-672.pdf",
"docType": "invoice",
"downloadUrl": "http://minio:9000/fsco/00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26/00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26/hiiro/79e6f652-b513-4041-89de-3e468853ef2d/Invoice-672.pdf?response-content-disposition=inline%3B%20filename%3D%22Invoice-672.pdf%22&response-content-type=application%2Fpdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minio%2F20250819%2Fap-southeast-2%2Fs3%2Faws4_request&X-Amz-Date=20250819T055912Z&X-Amz-Expires=60&X-Amz-SignedHeaders=host&X-Amz-Signature=ad6a9c904cb7260a30e1d4243139300496f955828cc6988aa538960ced93484c",
"uploadBatchId": null,
"isPublic": false,
"source": "PAYMENTS",
"prompts": [
{
"id": "09ebe472-cfff-4883-8391-1e9f1865f0e7",
"name": "Issued Company",
"fieldType": "string",
"format": "add # sign to the company name",
"description": "From this invoice document extract the company name that issued the invoice.",
"itemType": "singleLine",
"children": []
},
{
"id": "9dfc5cc4-444c-4cd6-b56f-b8dfb8bd6bff",
"name": "DueDate",
"fieldType": "string",
"format": "",
"description": "From this invoice document extract the Due Date for the payment. If not explicitly stated, check the payment terms and add the number of days to the invoice issue date. Use the format YYYY-MM-DD",
"itemType": "dateTime",
"children": []
},
{
"id": "9d064a7e-cd93-4b1e-a82e-6f0f0eb000c6",
"name": "TotalAmount",
"fieldType": "float",
"format": "remove the currency symbol if present",
"description": "From this invoice document extract the total including tax. ",
"itemType": "currency",
"children": []
}
],
"providerModelId": "7b313983-7d8c-43ca-9714-c6767201bd3f",
"webhookId": null,
"ocrProvider": "GOOGLE_DOCUMENT_AI",
"status": "created",
"fileData": null
}

The document activity endpoint allows you to track the processing status and history of a document. This includes information about when the document was created, processed, and any errors that may have occurred.

GET /v2/document/{documentId}/activity
get-document-activity.sh
#!/bin/bash
curl -X GET "https://api.fsco.io/v2/document/8c1d496f-2827-4750-a11f-74b48c11108d/activity?page[number]=1&page[size]=10" \
-H "x-api-key: $FSCO_API_KEY" \
-H "x-api-secret: $FSCO_API_SECRET" \
-H "Content-Type: application/json"
response.json
{
"items": [
{
"activityId": "cc43c11e-8976-477e-b5ff-96437f1b016a",
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"eventSignature": "document.created",
"payload": {
"data": {
"object": {
"refId": "4881927e-7b0f-4d39-b248-c7b97ffd28d1",
"docExt": "application/pdf",
"source": "PAYMENTS",
"docName": "Invoice-672.pdf",
"docType": "invoice",
"isPublic": false,
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"externalEventType": "document.created"
}
},
"type": "document.created",
"userId": "00000000-0000-0000-0000-000000000000",
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26"
},
"createdAt": "2025-08-19T05:58:19.747Z"
},
{
"activityId": "4115935e-0d77-41bd-9e7b-9bc723538db9",
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"eventSignature": "ocr.started",
"payload": {
"data": {
"object": {
"s3Key": "s3key",
"blobId": "4fcd7bd9-e4e8-428a-8f2a-72d550ad95c6",
"userId": "00000000-0000-0000-0000-000000000000",
"blobKey": "hiiro/79e6f652-b513-4041-89de-3e468853ef2d/Invoice-672.pdf",
"s3Bucket": "s3bucket",
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26",
"externalEventType": "ocr.started"
}
},
"type": "ocr.started",
"userId": "00000000-0000-0000-0000-000000000000",
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26"
},
"createdAt": "2025-08-19T06:01:12.899Z"
},
{
"activityId": "9837ea15-566b-4477-a499-32d936a92760",
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"eventSignature": "ocr.completed",
"payload": {
"data": {
"object": {
"prompt": "",
"userId": "00000000-0000-0000-0000-000000000000",
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26",
"ocrResultBlobKey": "79e6f652-b513-4041-89de-3e468853ef2d.json",
"externalEventType": "ocr.completed"
}
},
"type": "ocr.completed",
"userId": "00000000-0000-0000-0000-000000000000",
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26"
},
"createdAt": "2025-08-19T06:01:15.937Z"
},
{
"activityId": "3752e0ec-26b2-4665-a36f-09ebd4a3c376",
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"eventSignature": "document.updated",
"payload": {
"data": {
"object": {
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"externalEventType": "document.updated"
}
},
"type": "document.updated",
"userId": "00000000-0000-0000-0000-000000000000",
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26"
},
"createdAt": "2025-08-19T06:01:16.062Z"
},
{
"activityId": "ffda85ff-b4a6-4fdb-93f3-2ead3a9ab23a",
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"eventSignature": "ai.typeSelected",
"payload": {
"data": {
"object": {
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d"
}
},
"type": "ai.typeSelected",
"userId": "00000000-0000-0000-0000-000000000000",
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26"
},
"createdAt": "2025-08-19T06:01:17.953Z"
},
{
"activityId": "c1c8d024-3b30-4a0b-b5fe-e7d3ead25377",
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"eventSignature": "document.updated",
"payload": {
"data": {
"object": {
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"externalEventType": "document.updated"
}
},
"type": "document.updated",
"userId": "00000000-0000-0000-0000-000000000000",
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26"
},
"createdAt": "2025-08-19T06:01:17.999Z"
},
{
"activityId": "5efedae5-38d4-4f54-8e88-667e017800b4",
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"eventSignature": "ai.started",
"payload": {
"data": {
"object": {
"userId": "00000000-0000-0000-0000-000000000000",
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26",
"externalEventType": "ai.started"
}
},
"type": "ai.started",
"userId": "00000000-0000-0000-0000-000000000000",
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26"
},
"createdAt": "2025-08-19T06:01:18.017Z"
},
{
"activityId": "606418c8-4cb2-4ea8-b240-ff8ab3dc885d",
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"eventSignature": "ai.processed",
"payload": {
"data": {
"object": {
"model": "GPT_4O",
"result": {
"DueDate": {
"value": null,
"promptId": "9dfc5cc4-444c-4cd6-b56f-b8dfb8bd6bff",
"promptName": "DueDate"
},
"TotalAmount": {
"value": "1254.08",
"promptId": "9d064a7e-cd93-4b1e-a82e-6f0f0eb000c6",
"promptName": "TotalAmount"
},
"Issued Company": {
"value": "#Tech Solutions Ltd",
"promptId": "09ebe472-cfff-4883-8391-1e9f1865f0e7",
"promptName": "Issued Company"
}
},
"userId": "00000000-0000-0000-0000-000000000000",
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26",
"externalEventType": "ai.processed"
}
},
"type": "ai.processed",
"userId": "00000000-0000-0000-0000-000000000000",
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26"
},
"createdAt": "2025-08-19T06:01:20.440Z"
},
{
"activityId": "75e661d8-250c-4f96-81bc-4e5b337fcac4",
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"eventSignature": "document.updated",
"payload": {
"data": {
"object": {
"documentId": "79e6f652-b513-4041-89de-3e468853ef2d",
"externalEventType": "document.updated"
}
},
"type": "document.updated",
"userId": "00000000-0000-0000-0000-000000000000",
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26"
},
"createdAt": "2025-08-19T06:01:20.452Z"
}
],
"page": {
"number": 1,
"size": 10,
"totalPages": 1,
"totalCount": 9,
"hasNext": false,
"hasPrev": false
}
}
GET /v2/document

All parameters are required:

  • page[number]: Page number for pagination (number)
  • page[size]: Number of items per page (number)
get-document-list.sh
#!/bin/bash
curl -X GET "https://api.fsco.io/v2/document?page[number]=1&page[size]=10" \
-H "x-api-key: $FSCO_API_KEY" \
-H "x-api-secret: $FSCO_API_SECRET" \
-H "Content-Type: application/json"
response.json
{
"items": [
{
"id": "79e6f652-b513-4041-89de-3e468853ef2d",
"refId": "4881927e-7b0f-4d39-b248-c7b97ffd28d1",
"docExt": "application/pdf",
"docName": "Invoice-672.pdf",
"docType": "invoice",
"uploadBatchId": null,
"isPublic": false,
"source": "PAYMENTS",
"prompts": [
{
"id": "09ebe472-cfff-4883-8391-1e9f1865f0e7",
"name": "Issued Company",
"fieldType": "string",
"format": "add # sign to the company name",
"description": "From this invoice document extract the company name that issued the invoice.",
"itemType": "singleLine",
"children": []
},
{
"id": "9dfc5cc4-444c-4cd6-b56f-b8dfb8bd6bff",
"name": "DueDate",
"fieldType": "string",
"format": "",
"description": "From this invoice document extract the Due Date for the payment. If not explicitly stated, check the payment terms and add the number of days to the invoice issue date. Use the format YYYY-MM-DD",
"itemType": "dateTime",
"children": []
},
{
"id": "9d064a7e-cd93-4b1e-a82e-6f0f0eb000c6",
"name": "TotalAmount",
"fieldType": "float",
"format": "remove the currency symbol if present",
"description": "From this invoice document extract the total including tax. ",
"itemType": "currency",
"children": []
}
],
"webhookId": null,
"ocrProvider": "GOOGLE_DOCUMENT_AI",
"status": "active",
"fileData": {
"DueDate": {
"value": null,
"promptId": "9dfc5cc4-444c-4cd6-b56f-b8dfb8bd6bff",
"promptName": "DueDate"
},
"TotalAmount": {
"value": "1254.08",
"promptId": "9d064a7e-cd93-4b1e-a82e-6f0f0eb000c6",
"promptName": "TotalAmount"
},
"Issued Company": {
"value": "#Tech Solutions Ltd",
"promptId": "09ebe472-cfff-4883-8391-1e9f1865f0e7",
"promptName": "Issued Company"
}
}
}
],
"page": {
"number": 1,
"size": 10,
"totalPages": 1,
"totalCount": 1,
"hasNext": false,
"hasPrev": false
}
}
GET /v2/document/collection/{collectionId}

All parameters are required:

  • page[number]: Page number for pagination (number)
  • page[size]: Number of items per page (number)
get-documents-by-collection.sh
#!/bin/bash
curl -X GET "https://api.fsco.io/v2/document/collection/8c1d496f-2827-4750-a11f-74b48c11108d?page[number]=1&page[size]=10" \
-H "x-api-key: $FSCO_API_KEY" \
-H "x-api-secret: $FSCO_API_SECRET" \
-H "Content-Type: application/json"
response.json
{
"items": [
{
"id": "84d2e1b7-84ff-41b1-89db-a908708917eb",
"createdAt": "2025-05-19T23:44:05.298Z",
"updatedAt": "2025-05-19T23:44:05.298Z",
"isTest": false,
"config": null,
"fileData": null,
"ocrProvider": "GOOGLE_DOCUMENT_AI",
"ocrData": null,
"docExt": "application/pdf",
"docName": "my_invoice_2025-05-06.pdf",
"docType": "invoice",
"uploadBatchId": "2993F653-E268-4CE6-A6A0-A5FC05DB1888",
"refId": "2a2e4823-017c-4acd-a683-87e91c647500",
"blobId": "88151bc0-3cd3-46c8-9c49-49e82a54597b",
"isPublic": false,
"isUploaded": false,
"source": "My API",
"webhookId": null,
"organisationId": "00b4b8e6-6e9c-4ec8-8bc0-4f27cba57e26",
"userId": "0d05e804-cb6c-4bd4-8bf7-2d283b466eca",
"status": "created",
"version": 1,
"prompts": [
{
"id": "91e0fd01-4df3-422b-afa7-adfd489cc0f5",
"name": "Issuer",
"format": "",
"children": [],
"itemType": "singleLine",
"fieldType": "string",
"description": "Who is the issuer of this invoice"
}
],
"providerModelId": "7b313983-7d8c-43ca-9714-c6767201bd3f",
"documentGroups": [
{
"id": "d2e75489-324d-4a37-8cb6-9514217f4622",
"documentId": "84d2e1b7-84ff-41b1-89db-a908708917eb",
"groupId": "3429793f-eb82-4a06-ab55-d641d5a26aa4",
"createdAt": "2025-05-20T01:46:33.127Z"
}
],
"providerModel": {
"providerModelId": "7b313983-7d8c-43ca-9714-c6767201bd3f",
"providerName": "OPENAI",
"modelName": "GPT_4O",
"description": "Default provider model",
"displayName": "GPT_4O"
},
"uploadUrl": "url-to-upload-the-document",
"downloadUrl": "url-to-download-the-document"
}
],
"total": 1,
"page": 1,
"limit": 10
}
  • The list endpoint supports pagination for efficient data retrieval
  • Results are scoped to your organization
  • Documents can be filtered by both group and collection
  • The response includes metadata about the documents such as creation date and status