Documentation
  • 👋Welcome to Documentation
  • 📖Glossary
  • ❓FAQs
  • General
    • Getting set up
      • Single-user organization
      • Multi-user organization
    • Supported Document Types
  • Platform Walkthrough
    • Dashboard
    • Queue
    • Configuration
    • Supervision
  • User guide How Tos
    • User Management
      • How to invite a new user to the platform?
      • How can I manage existing users?
    • Processes
      • How to create a supervised process or use the template?
      • How to create a custom process?
    • Supervision
      • How to add, assign, and remove annotations?
      • How to edit the value of the extraction?
      • How to open and edit a table mask?
      • How to open, edit, or remove the extracted table?
      • How to export your data via Supervision?
      • How to copy values and tables?
    • Upload
    • Converters
    • Data points definition
    • Data Export
    • Table Data Extraction
    • Enrichment
    • Generating new API key
  • Integrations
    • Zapier Integration
      • Quickstart
      • Alphamoon as a Trigger
      • Alphamoon as an Action
    • Google Sheets - Export
  • Features
    • Continuous Learning (Beta)
    • Document Splitting
  • API
    • Introduction
    • Quickstart
    • Organization API keys (Beta)
    • Process API keys (Beta)
    • Authenticating
    • Versioning
    • Get results
    • Get OCR results
    • Get processes
    • Get process types
    • Get collections
    • Metadata
      • Setting metadata value
    • Upload File
    • Export
    • Download original files
    • Delete collection
    • Reset process configuration
  • Resources
    • 💻Alphamoon Website
Powered by GitBook
On this page
  1. API
  2. Metadata

Setting metadata value

Learn how to update the collection using the Alphamoon's API

PreviousMetadataNextUpload File

Last updated 1 year ago

Alphamoon's API lets you update collections with metadata in just a few clicks.

Let's say you want to indicate that the given collection has already been printed. In this case, you can use the endpoint below to include such information in the server response:

Update collection by ID

This endpoint only allows you to edit the metadata of the collection. You can read more about metadata .

PATCH /api/v0.3/collections/{collection_id}

Path parameters

Name
Type
Description

collection_id*

String

The ID of the selected collection.

You can get the collection_id from:

  • endpoint (Base64 or Binary)

  • Get collections endpoint

  • URL e.g. https://workspace.alphamoon.ai/supervision/223742cc9bca43fd81b2d41b0018e4c7

Request body*

Add your metadata in the request body. For the purposes of this tutorial, let's stick with the printing example. Our metadata will be as follows:

{
  "metadata": {"printed": "yes"}
}

{
  "id": "191719e01ae84f02993168ef95be3c49",
  "name": "Invoice example.pdf",
  "files": [
    {
      "id": "0164f04d3a1e4138b73bb84695395871",
      "collectionId": "191719e01ae84f02993168ef95be3c49",
      "name": "Invoice example.pdf",
      "status": "Accepted",
      "progress": 100,
      "numberOfPages": 1,
      "createdAt": "2024-04-15T15:03:38Z",
      "updatedAt": "2024-04-16T12:29:07Z",
      "metadata": {}
    }
  ],
  "priority": false,
  "split": false,
  "status": "Accepted",
  "progress": 100,
  "numberOfPages": 1,
  "processId": "93580f176efb48cda64f25cba74d8ca4",
  "createdAt": "2024-04-15T15:03:38Z",
  "updatedAt": "2024-04-29T12:07:54Z",
  "metadata": {
    "printed": "yes"
  },
  "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"
}
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

See the example:

curl -X 'PATCH' \
  'https://workspace.alphamoon.ai/api/v0.3/collections/191719e01ae84f02993168ef95be3c49' \
  -H 'accept: application/json' \
  -H 'Authorization: Basic API_KEY_BASE64_ENCODED' \
  -H 'Content-Type: application/json' \
  -d '{
  "metadata": {"printed": "yes"}
}'
{
  "id": "191719e01ae84f02993168ef95be3c49",
  "name": "Invoice example.pdf",
  "files": [
    {
      "id": "0164f04d3a1e4138b73bb84695395871",
      "collectionId": "191719e01ae84f02993168ef95be3c49",
      "name": "Invoice example.pdf",
      "status": "Accepted",
      "progress": 100,
      "numberOfPages": 1,
      "createdAt": "2024-04-15T15:03:38Z",
      "updatedAt": "2024-04-16T12:29:07Z",
      "metadata": {}
    }
  ],
  "priority": false,
  "split": false,
  "status": "Accepted",
  "progress": 100,
  "numberOfPages": 1,
  "processId": "93580f176efb48cda64f25cba74d8ca4",
  "createdAt": "2024-04-15T15:03:38Z",
  "updatedAt": "2024-04-29T12:07:54Z",
  "metadata": {
    "printed": "yes"
  },
  "availableForTraining": true,
  "duplicates": []
}

See next:

Go to the tab to learn more.

here
Upload a file
Metadata