Update collection
A quick guide on how to update collection by ID, using the Alphamoon API
To update collection via API, get the collection_id of the processed file from:
Upload a file endpoint (Base64 or Binary)
Get collections endpoint
URL e.g. https://workspace.alphamoon.ai/supervision/223742cc9bca43fd81b2d41b0018e4c7
Use the following endpoint to update the collection:
Update collection by ID
PATCH /api/v0.3/collections/{collection_id}
Path parameters
Name
Type
Description
collection-id*
String
The ID of the collection
{
"id": "c0da3bd0798e4549a1eb673887258dd3",
"name": "Invoices_2023.pdf",
"files": [
{
"id": "c4f70139d07e4b7abbd7162ecc34860c",
"collectionId": "c0da3bd0798e4549a1eb673887258dd3",
"name": "Invoices_2023.pdf",
"status": "Needs Review",
"progress": 100,
"numberOfPages": 4,
"createdAt": "2024-01-09T10:20:31Z",
"updatedAt": "2024-01-09T10:21:32Z",
"metadata": {}
}
],
"priority": false,
"split": false,
"status": "Needs Review",
"progress": 100,
"numberOfPages": 4,
"processId": "93580f176efb48cda64f25cba74d8ca4",
"createdAt": "2024-01-09T10:20:31Z",
"updatedAt": "2024-04-03T15:35:05Z",
"metadata": {},
"availableForTraining": true,
"duplicates": []
}{
"action": "The client should not repeat this request without modification.",
"detail": "Please see the 'errors' field for details.",
"errors": [
{
"location": "body: priority",
"message": "field required",
"type": "request_validation_error"
}
],
"instance": "30e18f59-7c88-4e25-9bed-61863b2abf4b",
"status": 400,
"timestamp": "2021-11-09T17:43:36Z",
"title": "The server cannot process the request due to a client error.",
"type": "RequestValidationError"
}{
"action": "The client should not repeat this request without modification.",
"detail": "Please see the 'errors' field for details.",
"errors": [
{
"location": "body: priority",
"message": "field required",
"type": "request_validation_error"
}
],
"instance": "30e18f59-7c88-4e25-9bed-61863b2abf4b",
"status": 400,
"timestamp": "2021-11-09T17:43:36Z",
"title": "The server cannot process the request due to a client error.",
"type": "RequestValidationError"
}{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}See the example:
curl -X 'PATCH' \
'https://workspace.alphamoon.ai/api/v0.3/collections/c0da3bd0798e4549a1eb673887258dd3' \
-H 'accept: application/json' \
-H 'Authorization: Basic API_KEY_BASE64_ENCODED' \
-H 'Content-Type: application/json' \
-d '{
"metadata": {}
}'{
"id": "c0da3bd0798e4549a1eb673887258dd3",
"name": "Invoices_2023.pdf",
"files": [
{
"id": "c4f70139d07e4b7abbd7162ecc34860c",
"collectionId": "c0da3bd0798e4549a1eb673887258dd3",
"name": "Invoices_2023.pdf",
"status": "Needs Review",
"progress": 100,
"numberOfPages": 4,
"createdAt": "2024-01-09T10:20:31Z",
"updatedAt": "2024-01-09T10:21:32Z",
"metadata": {}
}
],
"priority": false,
"split": false,
"status": "Needs Review",
"progress": 100,
"numberOfPages": 4,
"processId": "93580f176efb48cda64f25cba74d8ca4",
"createdAt": "2024-01-09T10:20:31Z",
"updatedAt": "2024-04-03T15:35:05Z",
"metadata": {},
"availableForTraining": true,
"duplicates": []
}See next:
Last updated