External keys

Add external keys to access the intended services

External keys that lets Mammoth to user certain services. User brings their own key to access the service e.g AI based rules need an Open AI key

post/workspaces/{workspace_id}/external_keys

Request

  • Base URL: https://app.mammoth.io/api/v2
  • URL: https://app.mammoth.io/api/v2/workspaces/{workspace_id}/external_keys
  • Auth: one of:
    • HTTP bearer
    • API key in header X-API-KEY and API key in header X-API-SECRET and API key in header X-WORKSPACE-ID

Path parameters

workspace_idinteger required

Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.

Example:4

Request body

key_type'open_ai' | 'anthropic' | 'gemini' | 'grok' required

Type of the external key e.g. open_ai

key_namestring required

A name to be associated with the key

descriptionstring nullable

Describe the purpose of the key and any added information related to it

secure_keystring required

The key value which will be used in the intended service

model_idstring nullable

The specific LLM model to use with this key e.g. claude-haiku-4-5. Defaults to the provider's recommended model if not specified.

Example request

{
  "key_type": "open_ai",
  "key_name": "My Open AI key",
  "description": null,
  "secure_key": "abcDefGhiJklMnoPqrStuVwxYz1234567890",
  "model_id": "gpt-5.4-mini",
  "model_config_data": null
}

Response

Successful create

idinteger nullable

ID of the external key as saved in the DB

key_type'open_ai' | 'anthropic' | 'gemini' | 'grok' nullable

Type of the external key e.g. open_ai

key_namestring nullable

A name to be associated with the key

descriptionstring nullable

Describe the purpose of the key and any added information related to it

secure_keystring nullable

The key value which will be used in the intended service

is_in_useboolean nullable

Is the key currently in use?

model_idstring nullable

The specific LLM model bound to this key e.g. claude-haiku-4-5

created_by_user_idinteger nullable

ID of the user that created this key

last_used_atstring date-time nullable

When was the key last used at?

last_used_by_used_idinteger nullable

ID of the user who the key in the recent most usage?

created_atstring date-time nullable

When was the key created? Null for keys created before this was recorded.

Changes

No recorded changes to this operation across all 3 revisions of this API.