Skip to main content

DynamoFL API (1.0.0)

Download OpenAPI specification:Download

Organization

Create Organization

Creates an organization. User must be a Platform Admin

Request Body schema: application/json
required
name
required
string

Organization name. The names of the organization must be unique

description
required
string

Organization description

isDefault
boolean

Whether the organization is the default organization of the platform

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "isDefault": true
}

Response samples

Content type
application/json
{
  • "admin": { },
  • "organization": {
    }
}

All Organizations

Get all organizations. User must me platform admin

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update Organization metadata

Update organization's name and description. User must be a Platform Admin

path Parameters
_id
required
string

Organization to update

Request Body schema: application/json
required
name
string

New name of the organization

description
string

New description of the organization

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string"
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "isDefault": true,
  • "id": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "publicLevelPermissions": "CreateOrganization",
  • "collaborators": [
    ]
}

Get Organization

Get organization. User must have GetOrganization permission on the organization

path Parameters
_id
required
string

Organization to get details of

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "isDefault": true,
  • "id": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "publicLevelPermissions": "CreateOrganization",
  • "collaborators": [
    ]
}

Mark as Default

Keep this as the default organization of the platform. User must me platform admin

path Parameters
_id
required
string

Organization to mark as default

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "isDefault": true,
  • "id": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "publicLevelPermissions": "CreateOrganization",
  • "collaborators": [
    ]
}

Update Org Permissions

Update Organization organization. User must have UpdateOrganization permission on the organization

path Parameters
_id
required
string

Organization to update permissions of

Request Body schema: application/json
required
publicLevelPermissions
required
string
Enum: "CreateOrganization" "GetOrganization" "GetAllOrganizations" "UpdateOrganization" "DeleteOrganization" "MakeOrganizationDefault" "AddUserToOrganization" "RemoveUserFromOrganization" "UpdateOrganizationUserPermissions"

Public level permissions on org for all the users in the org. Must be of OrganizationPermission enum

required
Array of objects (OrganizationCollaborator)

List of collaborators with the permissions to the organization

Responses

Request samples

Content type
application/json
{
  • "publicLevelPermissions": "CreateOrganization",
  • "collaborators": [
    ]
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "isDefault": true,
  • "id": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "publicLevelPermissions": "CreateOrganization",
  • "collaborators": [
    ]
}

Organization Users

Organization Users

Get Organization Users. User must have GetOrganization permission on the organization

path Parameters
_id
required
string

Organization to get users of

Responses

Add User

Add user to the organization with the permissions defined. User must have AddUserToOrganization permission on the organization

path Parameters
_id
required
string

Organization to add user to

userId
required
string

User to add

Request Body schema: application/json
required
permissions
required
Array of strings

List of permissions to assign to the user

Responses

Request samples

Content type
application/json
{
  • "permissions": [
    ]
}

Remove User

Remove user from the organization. Calling user must have RemoveUserFromOrganization permission on the organization

path Parameters
_id
required
string

Organization to remove user from

userId
required
string

User to remove

Responses

Update user permission

Update permission of the user in the organization. Calling user must have UpdateOrganizationUserPermissions permission on the organization

path Parameters
_id
required
string

Organization to update permissions of user in

userId
required
string

User to update permissions of

Request Body schema: application/json
required
permissions
required
Array of strings

List of permissions to assign to the user

Responses

Request samples

Content type
application/json
{
  • "permissions": [
    ]
}

DynamoGuard Analyze

Apply policies on messages

header Parameters
X-Num-Tokens
string

Number of tokens analyzed by policies

Warning
string

Warning displayed about tokens being not analyzed due to length

Request Body schema: application/json
required
required
Array of objects (AnalyzeMessage)

OpenAI style messages with optional RAG context to analyze

textType
required
string
Enum: "MODEL_INPUT" "MODEL_RESPONSE"

Whether last message is a prompt or response

policyIds
required
Array of strings

List of policies to apply

modelId
string

The model id of the LLM to associate inference with

clientId
string

The client id of the sender

metadata
object

Metadata to be attached to the request

Responses

Request samples

Content type
application/json
{
  • "messages": [
    ],
  • "textType": "MODEL_INPUT",
  • "policyIds": [
    ],
  • "modelId": "string",
  • "clientId": "string",
  • "metadata": { }
}

Response samples

Content type
application/json
{
  • "text": "string",
  • "textType": "MODEL_INPUT",
  • "finalAction": "BLOCK",
  • "appliedPolicies": [
    ],
  • "error": "string"
}

DynamoGuard Logs

Get Logs

Retrieve logs from chat and analyze interactions. Narrow search down by using the query filters.

path Parameters
modelId
required
string
query Parameters
startTime
number

The start time (in UTC seconds) to filter by

endTime
number

The end time (in UTC seconds) to filter by

pageNum
number
Default: 1

The page number

perPage
number
Default: 50

The number of results per page

sortDir
string
Default: "desc"
Enum: "asc" "desc"

The direction to sort results by.

policyId
string

The policy id to filter by

policyType
string
Enum: "PII" "TOXICITY" "ALIGNMENT" "HALLUCINATION" "RAG_HALLUCINATION"

The policy type to filter by

textType
string
Enum: "MODEL_INPUT" "MODEL_RESPONSE"

The text type to filter by

action
string
Enum: "BLOCK" "WARN" "REDACT" "SANITIZE" "NONE"

The policy action to filter by

clientId
string

The client id to filter by

userId
string

The user id to filter by

metadata
string
Example: metadata={origin: {platform: "chatgpt.com", browser: "Chrome"}, version: "3.16"}

User-defined log metadata to filter by. Should be a json string

Responses

Response samples

Content type
application/json
{
  • "logs": [
    ],
  • "totalCount": 0
}

Get Count of Logs

Retrieve number of log entries from chat and analyze interactions. Narrow search down by using the query filters.

path Parameters
modelId
required
string
query Parameters
startTime
number

The start time (in UTC seconds) to filter by

endTime
number

The end time (in UTC seconds) to filter by

policyId
string

The policy id to filter by

policyType
string
Enum: "PII" "TOXICITY" "ALIGNMENT" "HALLUCINATION" "RAG_HALLUCINATION"

The policy type to filter by

textType
string
Enum: "MODEL_INPUT" "MODEL_RESPONSE"

The text type to filter by

action
string
Enum: "BLOCK" "WARN" "REDACT" "SANITIZE" "NONE"

The policy action to filter by

clientId
string

The client id to filter by

userId
string

The user id to filter by

metadata
string
Example: metadata={origin: {platform: "chatgpt.com", browser: "Chrome"}, version: "3.16"}

User-defined log metadata to filter by. Should be a json string

Responses

Response samples

Content type
application/json
0
0

DynamoGuard Stats

Get stats

Retrieve dashboard metrics. Narrow search down by using the query filters. At least one of modelId, clientId, or userId must be specified.

path Parameters
modelId
required
string
query Parameters
startTime
number

The start time to filter by

endTime
number

The end time to filter by

numDataPoints
number
Default: 2

Number of data points to discretize time period. Must be greater than 1.

clientId
string

The client id to filter by

Responses

Response samples

Content type
application/json
{
  • "overview": {
    },
  • "privacy": {
    },
  • "toxicity": {
    },
  • "alignment": {
    },
  • "hallucination": {
    },
  • "ragHallucination": {
    },
  • "latency": {
    },
  • "timestamps": [
    ],
  • "rules": {
    }
}

DynamoGuard Chat

Guardrailed Chat

Apply policies to messages and send non-violating prompts to LLM. Routes messages to the LLM behind modelId. Blocks/modifies prompt/response as policies dictate

path Parameters
modelId
required
string
session_id
required
string

Session id to link chat messages to

header Parameters
X-Num-Tokens
string

Number of tokens analyzed by policies

Warning
string

Warning displayed about tokens being not analyzed due to length

Request Body schema: application/json
required
clientId
string

The client id of the sender

required
Array of objects (ChatMessage)

OpenAI style messages to send to the LLM

metadata
object

Metadata to be attached to the request

overridePolicyIds
Array of strings

Explicit list of policies to apply instead of the ones attached to the model

Responses

Request samples

Content type
application/json
{
  • "clientId": "string",
  • "messages": [
    ],
  • "metadata": { },
  • "overridePolicyIds": [
    ]
}

Response samples

Content type
application/json
{
  • "source": {
    },
  • "chat": {
    },
  • "metadata": { },
  • "analyses": [
    ]
}

DynamoGuard Policy

Update policies applied to a model

path Parameters
id
required
string
Request Body schema: application/json
required
policyIds
required
Array of strings

List of policy ids to activate on the model

action
required
string
Enum: "ADD" "REMOVE" "REPLACE"

Operation to perform on models

Responses

Request samples

Content type
application/json
{
  • "policyIds": [
    ],
  • "action": "ADD"
}

Create policy

Creates a policy on DynamoGuard. Each policy uses methodParams as arguments for the underlying policy and decisionParams to determine the action to take based on the policy result.

Request Body schema: application/json
required
name
required
string

Name of the policy

description
string

Description of the policy

method
required
string
Enum: "PII" "TOXICITY" "ALIGNMENT" "HALLUCINATION" "RAG_HALLUCINATION"

Type of policy

action
required
string
Default: "NONE"
Enum: "BLOCK" "WARN" "REDACT" "SANITIZE" "NONE"

The action to take if the policy is violated

methodParams
required
object

The arguments for the policy. These differ depending on the policy type

decisionParams
required
object

The parameters for determining the policy action from outputs. These differ depending on the policy type

applicableTo
required
string
Default: "ALL"
Enum: "INPUT" "OUTPUT" "ALL"

Which type of message the policy should apply to

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "method": "PII",
  • "action": "BLOCK",
  • "methodParams": { },
  • "decisionParams": { },
  • "applicableTo": "INPUT"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "description": "string",
  • "method": "PII",
  • "action": "BLOCK",
  • "methodParams": { },
  • "decisionParams": { },
  • "applicableTo": "INPUT",
  • "created_at": "2019-08-24T14:15:22Z",
  • "creatorId": "string"
}

Get all policies

Retrieves all policies a user made. If modelId is specified, attaches policy statuses as well

query Parameters
policyType
string
Enum: "PII" "TOXICITY" "ALIGNMENT" "HALLUCINATION" "RAG_HALLUCINATION"

Policy type to filter on

modelId
string

If specified, attaches policy status in relation to the modelId

expand
boolean

If true, attaches dataset info. Only available for content policies

attachModels
boolean

If specified, attaches models policy is applied to

page
required
number
limit
required
number
includeAllowedScopes
required
boolean

Responses

Response samples

Content type
application/json
{
  • "total": 0,
  • "policies": [
    ]
}

Update policy

Same description as policy creation

path Parameters
id
required
string

Policy id to update

Request Body schema: application/json
required
name
string

Name of the policy

description
string

Description of the policy

method
string
Enum: "PII" "TOXICITY" "ALIGNMENT" "HALLUCINATION" "RAG_HALLUCINATION"

Type of policy

action
string
Default: "NONE"
Enum: "BLOCK" "WARN" "REDACT" "SANITIZE" "NONE"

The action to take if the policy is violated

methodParams
object

The arguments for the policy. These differ depending on the policy type

decisionParams
object

The parameters for determining the policy action from outputs. These differ depending on the policy type

applicableTo
string
Default: "ALL"
Enum: "INPUT" "OUTPUT" "ALL"

Which type of message the policy should apply to

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "method": "PII",
  • "action": "BLOCK",
  • "methodParams": { },
  • "decisionParams": { },
  • "applicableTo": "INPUT"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "description": "string",
  • "method": "PII",
  • "action": "BLOCK",
  • "methodParams": { },
  • "decisionParams": { },
  • "applicableTo": "INPUT",
  • "created_at": "2019-08-24T14:15:22Z",
  • "creatorId": "string"
}

Get policy

Use query params to add additional information

path Parameters
id
required
string

Policy id to retrieve

query Parameters
expand
boolean

If true, attaches dataset info. Only available for content policies

modelId
string

If specified, attaches policy status in reference to the given model. Also filters policy stats.

promptId
string

If specified, attaches feedback for the prompt

attachModels
boolean

If specified, attaches models policy is applied to

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "description": "string",
  • "method": "PII",
  • "action": "BLOCK",
  • "methodParams": { },
  • "decisionParams": { },
  • "applicableTo": "INPUT",
  • "created_at": "2019-08-24T14:15:22Z",
  • "creatorId": "string",
  • "stage": "seed",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ],
  • "feedback": {
    },
  • "status": "string",
  • "models": [
    ]
}

Delete policy

path Parameters
id
required
string

Policy id to delete

Responses

Add/remove policy to/from models

path Parameters
id
required
string
Request Body schema: application/json
required
modelIds
required
Array of strings

List of model ids to add/remove policy to

action
required
string
Enum: "ADD" "REMOVE" "REPLACE"

Operation to perform on models

Responses

Request samples

Content type
application/json
{
  • "modelIds": [
    ],
  • "action": "ADD"
}

Health

API Health Endpoint

To check if the api is healthy

Responses

Models

Create Remote Model

Creates a remote model configuration. User must have CreateModel permission

Request Body schema: application/json
required
name
required
string

Display name for the model

key
required
string

Unique identifier for the model (usually UUID)

type
required
string
Enum: "REMOTE" "LOCAL" "THIRD_PARTY" "LOCAL_GUARDRAIL"

Type of model

useCase
required
string

Intended use case for the model

required
object

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "key": "string",
  • "type": "REMOTE",
  • "useCase": "chat",
  • "config": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "key": "string",
  • "type": "string",
  • "useCase": "string",
  • "config": {
    },
  • "metadata": {
    },
  • "created_at": "2019-08-24T14:15:22Z"
}