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": "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": [],
"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"
}

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&limit=10" \
-H "x-api-key: $FSCO_API_KEY" \
-H "x-api-secret: $FSCO_API_SECRET" \
-H "Content-Type: application/json"
response.json
{
"page": {
"number": 1,
"size": 10,
"totalCount": 4,
"totalPages": 1,
"hasNext": false,
"hasPrev": false
},
"items": [
{
"id": "43b9f67f-b836-4ee8-ac81-087e5943526f",
"domainId": "1533aa81-aef6-4c4e-b1ef-c618719fab6b",
"eventSignature": "io.fsco.ocr.event.ocrStarted",
"message": {
"s3Key": "s3key",
"blobId": "758dc83b-66d6-4870-80b1-952bec60139e",
"blobKey": "hiiro/1533aa81-aef6-4c4e-b1ef-c618719fab6b/my_invoice_2025-05-06.pdf",
"s3Bucket": "s3bucket",
"documentId": "1533aa81-aef6-4c4e-b1ef-c618719fab6b"
},
"createdAt": "2025-05-19T06:54:13.952Z"
},
{
"id": "850ef3a6-f433-482c-9cbb-56c94e12c125",
"domainId": "1533aa81-aef6-4c4e-b1ef-c618719fab6b",
"eventSignature": "io.fsco.ocr.event.ocrCompleted",
"message": {
"prompt": "",
"documentId": "1533aa81-aef6-4c4e-b1ef-c618719fab6b",
"ocrResultBlobKey": "1533aa81-aef6-4c4e-b1ef-c618719fab6b.json"
},
"createdAt": "2025-05-19T06:54:18.301Z"
},
{
"id": "2a406b98-18c4-4bf1-a736-bbddc2164ce4",
"domainId": "1533aa81-aef6-4c4e-b1ef-c618719fab6b",
"eventSignature": "io.fsco.ai.event.documentTypeSelected",
"message": {
"result": {
"document_type": "financial"
},
"documentId": "1533aa81-aef6-4c4e-b1ef-c618719fab6b"
},
"createdAt": "2025-05-19T06:54:21.774Z"
},
{
"id": "62895163-5ee6-4fd8-a390-8eabacdaff6b",
"domainId": "1533aa81-aef6-4c4e-b1ef-c618719fab6b",
"eventSignature": "io.fsco.ai.event.documentProcessed",
"message": {
"model": "GPT_4O",
"result": {
"Issuer": {
"value": "Figma, Inc.",
"promptId": "91e0fd01-4df3-422b-afa7-adfd489cc0f5",
"promptName": "Issuer"
}
},
"documentId": "1533aa81-aef6-4c4e-b1ef-c618719fab6b"
},
"createdAt": "2025-05-19T06:54:23.009Z"
}
]
}
GET /v2/document

All parameters are required:

  • page: Page number for pagination (number)
  • limit: Number of items per page (number)
  • groupId: Group ID to filter documents (string)
get-document-list.sh
#!/bin/bash
curl -X GET "https://api.fsco.io/v2/document?page[number]=1&limit=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": [],
"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
}
GET /v2/document/collection/{collectionId}

All parameters are required:

  • page: Page number for pagination (number)
  • limit: 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&limit=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