Skip to content

Grouping with Collections

Collections in FSCO provide a way to organize and group related documents together. Common uses include:

  • Organizing documents by department (HR documents, Legal contracts, Financial reports)
  • Grouping documents by project or client
  • Creating sets of templates for different business processes
  • Managing document versions and revisions
  • Bundling related forms and agreements together

This guide will walk you through creating and updating collections using our API.

Before you begin, ensure you have:

  • A valid FSCO API key
  • Your application’s environment configured with the API key
POST /v2/document/collection
{
"name": "Your Collection Name",
"description": "Optional description of the collection"
}

The request requires:

  • name: A descriptive name for your collection
  • description: (Optional) A description of what the collection contains
create-collection.sh
#!/bin/bash
curl -X POST https://api.fsco.io/v2/document/collection \
-H "x-api-key: $FSCO_API_KEY" \
-H "x-api-secret: $FSCO_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"name": "Your Collection Name",
"description": "Optional description of the collection"
}'
response.json
{
"collectionId": "8c1d496f-2827-4750-a11f-74b48c11108d",
"name": "Your Collection Name",
"description": "Optional description of the collection",
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-20T10:00:00Z"
}
PUT /v2/document/collection/{collectionId}
{
"name": "Updated Collection Name",
"description": "Updated description of the collection"
}

The request requires:

  • name: The new name for your collection
  • description: (Optional) The new description for your collection
update-collection.sh
curl -X PUT https://api.fsco.io/v2/document/collection/8c1d496f-2827-4750-a11f-74b48c11108d \
-H "x-api-key: $FSCO_API_KEY" \
-H "x-api-secret: $FSCO_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Collection Name",
"description": "Updated description of the collection"
}'
response.json
{
"collectionId": "8c1d496f-2827-4750-a11f-74b48c11108d",
"name": "Updated Collection Name",
"description": "Updated description of the collection",
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-20T11:00:00Z"
}
  • Store the collectionId securely - you’ll need it for all future collection operations
  • Collection names must be unique within your organization
  • Updates to a collection will affect all documents within that collection
  • You can update either the name, description, or both in a single request