Organization API keys (Beta)

Learn how to create, get, and delete organization API keys

The following endpoints are available in the v0.4 Alphamoon Workspace REST API (BETA).

Create organization API key

To create an organization API key (Admin only), use the following endpoint:

POST /api/v0.4/admin/api-keys

Request body example:

{
  "name": "TEST API key",
  "exp": "2024-07-17T07:23:51.104Z",
  "scopes": [
    "workspace.collection:create"
  ]
}

Make sure you:

  • Enter the name of your API key,

  • Set the API key expiration date (we recommend changing the API key every 3 to 6 months),

{
  "id": "31b7de83bfa24a9dbf2150beb5e5660b",
  "name": "TEST API key",
  "orgId": "USER:google-oauth2|123456789123456789123",
  "scopes": [
    "workspace.collection:create"
  ],
  "status": "Active",
  "createdAt": "2024-05-17T07:25:33Z",
  "exp": "2024-07-17T07:23:51Z",
  "key": "your_api_key_here"
}
curl -X 'POST' \
  'https://workspace.alphamoon.ai/api/v0.4/admin/api-keys' \
  -H 'accept: application/json' \
  -H 'Authorization: Basic API_KEY_BASE64_ENCODED' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "TEST API key",
  "exp": "2024-07-17T07:23:51.104Z",
  "scopes": [
    "workspace.collection:create"
  ]
}'

Get API keys

Use the endpoint below to get your organization API keys:

GET /api/v0.4/admin/api-keys

Parameters

Name
Type
Description

offset

query

The number of elements to skip

limit

query

The maximum number of elements to return at once

{
  "apiKeys": [
    {
      "id": "9c75da7200264beb91ffe05912591e46",
      "name": "NEW API key",
      "orgId": "USER:google-oauth2|123456789123456789123",
      "scopes": [
        "workspace.admin.user:read",
        "workspace.collection:update",
        "workspace.admin.process:manage",
        "workspace.collection:delete",
        "workspace.process.api_key:manage",
        "workspace.file:download",
        "workspace.export:delete",
        "workspace.result:read",
        "workspace.destination:delete",
        "workspace.process:read",
        "workspace.process:create",
        "workspace.admin.collection:manage",
        "workspace.admin.api_key:manage",
        "workspace.export:create",
        "workspace.destination:read",
        "workspace.collection:read",
        "workspace.admin.user:invite",
        "workspace.result:create",
        "workspace.process:update",
        "workspace.file:upload",
        "workspace.result:delete",
        "workspace.process:delete",
        "workspace.admin.user:manage",
        "workspace.result:update",
        "workspace.collection:create",
        "workspace.destination:create",
        "workspace.admin.subscriptions:manage"
      ],
      "status": "Active",
      "createdAt": "2024-05-17T07:23:03Z",
      "exp": "2024-07-31T21:59:59Z"
    },
    {
      "id": "31b7de83bfa27a9dbf2150beb5e5660b",
      "name": "TEST API key",
      "orgId": "USER:google-oauth2|123456789123456789123",
      "scopes": [
        "workspace.collection:create"
      ],
      "status": "Active",
      "createdAt": "2024-05-17T07:25:33Z",
      "exp": "2024-07-17T07:23:51Z"
    }
  ],
  "pagination": {
    "offset": 0,
    "limit": 100,
    "total": 2
  }
}

See the example:

curl -X 'GET' \
  'https://workspace.alphamoon.ai/api/v0.4/admin/api-keys?offset=0&limit=100' \
  -H 'accept: application/json' \
  -H 'Authorization: Basic API_KEY_BASE64_ENCODED'

Delete an API key

The endpoint below enables you to delete an API key using its ID.

DELETE /api/v0.4/admin/api-keys/{api-key-id}

Parameters

Name
Type
Description

api_key_id*

string

The ID of the API key you want to delete

"string"

See the example:

curl -X 'DELETE' \
  'https://workspace.alphamoon.ai/api/v0.4/admin/api-keys/31b7de83bfa24a9dbf2150beb5e5660b' \
  -H 'accept: */*' \
  -H 'Authorization: Basic API_KEY_BASE64_ENCODED'

Organization API scopes

Collections & images

The following API scopes allow users to manage collections of files in Alphamoon, including uploading, organizing, deleting, and updating existing collections.

Scope
Description

"workspace.collection:create"

Grants access to create new collections of files.

"workspace.collection:read"

Lists collections in the processes, display collections.

"workspace.collection:update"

Grants access to update collections of files.

"workspace.collection:delete"

Grants access to delete collections of files.

"workspace.collection_editor:override"

Grants access to make changes to existing collections.

Files & documents

The API scopes below provide access to file management features. These scopes allow users to upload new files to the platform as well as download them from Alphamoon to users device.

Scope
Description

"workspace.file:upload"

Grants access to upload files to Alphamoon.

"workspace.file:download"

Grants access to download uploaded files to the user's device.

Results

Results API scopes enable access to the processed extraction results of uploaded documents. Users can retrieve, review, update, and delete the results, as well as create new ones when necessary.

Scope
Description

"workspace.result:read"

Grants access to read the extraction result.

"workspace.result:update"

Grants access to edit the extraction result (e.g. adding or deleting extractions).

Processes

Processes API scopes encompass the coordination and oversight of document processing workflows, enabling users to view, update, and delete processes, as well as manage them.

Scope
Description

"workspace.process:read"

"workspace.process:update"

Grants access to edit processes and their configuration.

"workspace.process:delete"

Grants access to delete processes.

"workspace.process.api_key:manage"

Grants access to create process API keys.

Destinations

Destinations API scopes enable the configuration and management of data destinations. Users can specify where results are sent, ensuring they reach the appropriate systems or storage locations.

Scope
Description

"workspace.destination:create"

Grants access to configure data destinations.

"workspace.destination:read"

Grants access to view the data destinations.

"workspace.destination:delete"

Grants access to delete the data destinations.

Exports

Exports API scopes provide functionality for exporting processed data, including options for defining export formats, and deleting existing exports if necessary.

Scope
Description

"workspace.export:create"

Grants access to create new exports.

"workspace.export:delete"

Grants access to delete created exports.

Users administration

Users Administration API scopes allow Admins to create, modify, and control user access to ensure secure and efficient work with Alphamoon.

Scope
Description

"workspace.admin.user:read"

Grants access to view user's details.

"workspace.admin.user:invite"

Grants access to inviting new users to Alphamoon.

"workspace.admin.user:manage"

Grants access to manage Alphamoon users.

Process administration

Process Administration API scope enables managing and configuring document processing workflows.

Scope
Description

"workspace.admin.process:manage"

Grants access to manage (create, update, and delete) all processes in Alphamoon.

API key administration

API Key Administration scope allows administrators to manage all API keys, essential for secure access to Alphamoon's features, and maintain control over application integrations and data access. Administrators can create and delete API keys.

Scope
Description

"workspace.admin.api_key:manage"

Grants access to manage all API keys in the organization.

Subscription administration

The following scope enable administrators to manage and modify organization subscription.

Scope
Description

"workspace.admin.subscriptions:manage"

Grants access to manage the organization's subscription plan.

See next:

Last updated