Skip to main content

DynamoFL API (3.24.3)

Download OpenAPI specification:Download

Users

Get current user

Get the currently authenticated user

Responses

Create user

Create a new user

Request Body schema: application/json
required
email
required
string

Email address of the user

password
string

Password for the user (optional)

orgLevelRoleNames
required
Array of strings

Array of organization level role names. Valid roles: org:dynamoeval:admin, org:dynamoeval:developer, org:dynamoeval:member, org:dynamoguard:admin, org:dynamoguard:developer, org:dynamoguard:member, org:dynamoguard:extensionUser, org:dynamoguard:extensionAdmin, org:iam:admin, org:iam:editor, org:iam:viewer, org:platform:admin

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "password": "SecurePassword123!",
  • "orgLevelRoleNames": [
    ]
}

Response samples

Content type
application/json
{
  • "email": "user@example.com",
  • "temporaryPassword": "TempPassword123!",
  • "keycloakId": "123e4567-e89b-12d3-a456-426614174000",
  • "dynamoAIId": "507f1f77bcf86cd799439011"
}

Get current user with Keycloak info

Get the currently authenticated user with Keycloak information

Responses

Reset password for non-onboarded user

Reset the password for a user who has not completed onboarding

Request Body schema: application/json
required
email
required
string

Email address of the user

password
string

New password for the user (optional)

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "password": "NewSecurePassword123!"
}

Response samples

Content type
application/json
{
  • "email": "user@example.com",
  • "temporaryPassword": "TempPassword123!"
}

Reset password for onboarded user

Reset the password for a user who has completed onboarding

Request Body schema: application/json
required
email
required
string

Email address of the user

currentPassword
required
string

Current password of the user

newPassword
required
string

New password for the user

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "currentPassword": "CurrentPassword123!",
  • "newPassword": "NewSecurePassword123!"
}

Get all users

Get all users with optional filtering and organization level roles

query Parameters
includeOrgLevelRoles
boolean

Include organization level roles in the response

search
string

Search term to filter users

Responses

Response samples

Content type
application/json
{
  • "total": 100,
  • "users": [
    ]
}

Update organization level role

Update the organization level roles for a user

path Parameters
id
required
string

User ID

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

Array of organization level role names. Valid roles: org:dynamoeval:admin, org:dynamoeval:developer, org:dynamoeval:member, org:dynamoguard:admin, org:dynamoguard:developer, org:dynamoguard:member, org:dynamoguard:extensionUser, org:dynamoguard:extensionAdmin, org:iam:admin, org:iam:editor, org:iam:viewer, org:platform:admin

Responses

Request samples

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

Delete user

Delete a user by ID

path Parameters
id
required
string

User ID to delete

Responses

Get current user organization level scopes

Get the organization level scopes for the currently authenticated user

Responses

Get current user terms consent status

Get the terms and consent status for the currently authenticated user

Responses

Response samples

Content type
application/json
{ }

Update current user terms consent

Update the terms and consent status for the currently authenticated user

Request Body schema: application/json
required

Array of terms consent updates

Array
object (UpdateUserTermsConsentDto)

Responses

Request samples

Content type
application/json
[
  • { }
]

Create API token

Create an API token for the currently authenticated user

Responses

Response samples

Content type
application/json
{
  • "apiKey": "string"
}

TermsConsentController_getAllTermsConsents

Responses

ModerationController_generatePolicyBehaviors

Request Body schema: application/json
required
object (GenerateBehaviorsDto)

Responses

Request samples

Content type
application/json
{ }

PolicyController_getPolicyResourceLevelRoles

Responses

PolicyController_addUseCase

Request Body schema: application/json
required
object (AddUseCaseDto)

Responses

Request samples

Content type
application/json
{ }

PolicyController_getUseCases

Responses

PolicyController_updateUsecase

path Parameters
id
required
string
Request Body schema: application/json
required
object (AddUseCaseDto)

Responses

Request samples

Content type
application/json
{ }

PolicyController_getUsecase

path Parameters
id
required
string

Responses

PolicyController_deleteUsecase

path Parameters
id
required
string

Responses

PolicyController_getAnyUsecase

path Parameters
id
required
string

Responses

InClusterModelController_upsertModel

path Parameters
deploymentId
required
string
Request Body schema: application/json
required
deploymentStatus
required
string
Enum: "COMPLETED" "FAILED" "IN_PROGRESS" "DEPLOYMENT_DOES_NOT_EXIST" "UNKNOWN"

New status of the model deployment

reason
string

Reason of the model deployment

Responses

Request samples

Content type
application/json
{
  • "deploymentStatus": "COMPLETED",
  • "reason": "DeploymentReady"
}

InClusterModelController_getAllModels

Responses

InClusterModelController_getModel

path Parameters
deploymentId
required
string

Responses

InClusterModelController_deleteModel

path Parameters
deploymentId
required
string

Responses

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

inheritPolicies
boolean
Default: false

Whether to inherit policies from the modelId passed

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": [
    ],
  • "inheritPolicies": false,
  • "modelId": "string",
  • "clientId": "string",
  • "metadata": { }
}

Response samples

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

ExtensionController_analyzeText

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

inheritPolicies
boolean
Default: false

Whether to inherit policies from the modelId passed

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

domain
required
string

Domain of the chatbot the user is interacting with

Responses

Request samples

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

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" "INPUT_RELEVANCE" "RESPONSE_RELEVANCE" "OOB_HALLUCINATION" "KEYWORD"

The policy type to filter by

actions
Array of strings

List of actions 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

policyTypes
Array of strings

List of policy types 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,
  • "warnings": [
    ]
}

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" "INPUT_RELEVANCE" "RESPONSE_RELEVANCE" "OOB_HALLUCINATION" "KEYWORD"

The policy type to filter by

actions
Array of strings

List of actions 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

policyTypes
Array of strings

List of policy types 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

Get unique metadata fields

Return the complete set of unique metadata fields observed for this model across its lifetime.

path Parameters
modelId
required
string

The AI System (model) id

Responses

Response samples

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

Get Logs by User Email and Time Range

Retrieve logs for a specific user within a given time range. The maximum allowed time range is 1 month (30 Days).

path Parameters
userEmail
required
string
query Parameters
startTime
required
number
endTime
required
number
sortDir
required
string

Responses

Response samples

Content type
application/json
{
  • "presignedUrl": "string",
  • "logCount": 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": {
    },
  • "keyword": {
    },
  • "toxicity": {
    },
  • "alignment": {
    },
  • "hallucination": {
    },
  • "inputRelevance": {
    },
  • "responseRelevance": {
    },
  • "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": [
    ],
  • "usage": {
    },
  • "warnings": [
    ]
}

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" "INPUT_RELEVANCE" "RESPONSE_RELEVANCE" "OOB_HALLUCINATION" "KEYWORD"

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

language
string
Default: "en"
Enum: "en" "ja"

Language of the policy (ISO 639-1 code)

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "description": "string",
  • "isEnabled": true,
  • "method": "PII",
  • "action": "BLOCK",
  • "methodParams": { },
  • "decisionParams": { },
  • "language": "en",
  • "applicableTo": "INPUT",
  • "created_at": "2019-08-24T14:15:22Z",
  • "creatorId": "string",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "usecaseId": "string",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ]
}

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" "INPUT_RELEVANCE" "RESPONSE_RELEVANCE" "OOB_HALLUCINATION" "KEYWORD"

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

inferred
boolean

If true, returns inferred policy fields instead of the original policy

filterDeprecatedPolicies
boolean

If true, filters out deprecated policies

page
required
number
limit
required
number
includeAllowedScopes
required
boolean

Responses

Response samples

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

Check if policy creation limit(s) reached

Responses

Response samples

Content type
application/json
{
  • "alignment": {
    }
}

Update inferred policy

Updates only the inferred policy fields for ALIGNMENT type policies.

path Parameters
id
required
string

Policy id to update

Request Body schema: application/json
required
name
required
string

Name of the policy

description
required
string

Description of the policy

allowedBehaviors
required
Array of strings

List of allowed behaviors for the policy

disallowedBehaviors
required
Array of strings

List of disallowed behaviors for the policy

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "description": "string",
  • "isEnabled": true,
  • "method": "PII",
  • "action": "BLOCK",
  • "methodParams": { },
  • "decisionParams": { },
  • "language": "en",
  • "applicableTo": "INPUT",
  • "created_at": "2019-08-24T14:15:22Z",
  • "creatorId": "string",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "usecaseId": "string",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ]
}

Update policy

Updates the base policy fields for all types of policies. Also updates the inferred policy fields for ALIGNMENT type policies.

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

action
string
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
Enum: "INPUT" "OUTPUT" "ALL"

Which type of message the policy should apply to

language
string
Enum: "en" "ja"

Language of the policy (ISO 639-1 code)

isEnabled
boolean
Default: true

Whether the policy is enabled or disabled

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "action": "BLOCK",
  • "methodParams": { },
  • "decisionParams": { },
  • "applicableTo": "INPUT",
  • "language": "en",
  • "isEnabled": true
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "description": "string",
  • "isEnabled": true,
  • "method": "PII",
  • "action": "BLOCK",
  • "methodParams": { },
  • "decisionParams": { },
  • "language": "en",
  • "applicableTo": "INPUT",
  • "created_at": "2019-08-24T14:15:22Z",
  • "creatorId": "string",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "usecaseId": "string",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ]
}

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

inferred
boolean

If true, returns inferred policy fields instead of the orignal policy

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "description": "string",
  • "isEnabled": true,
  • "method": "PII",
  • "action": "BLOCK",
  • "methodParams": { },
  • "decisionParams": { },
  • "language": "en",
  • "applicableTo": "INPUT",
  • "created_at": "2019-08-24T14:15:22Z",
  • "creatorId": "string",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "usecaseId": "string",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ],
  • "stage": "seed",
  • "feedback": {
    },
  • "trainingStatus": "CREATING",
  • "appliedStatus": "IN_DEVELOPMENT",
  • "resourceDeploymentStatus": "DEPLOYED",
  • "trainingStatusDetails": {
    },
  • "latestJobStat": { },
  • "models": [
    ]
}

Delete policy

path Parameters
id
required
string

Policy id to delete

Responses

Response samples

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

Add behaviors to policy

Appends allowed and disallowed behaviors to an existing alignment policy

path Parameters
id
required
string

Policy id to add behaviors to

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

Additional allowed behaviors to add to the policy

disallowedBehaviors
Array of strings

Additional disallowed behaviors to add to the policy

Responses

Request samples

Content type
application/json
{
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "description": "string",
  • "isEnabled": true,
  • "method": "PII",
  • "action": "BLOCK",
  • "methodParams": { },
  • "decisionParams": { },
  • "language": "en",
  • "applicableTo": "INPUT",
  • "created_at": "2019-08-24T14:15:22Z",
  • "creatorId": "string",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "usecaseId": "string",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ]
}

Generate behaviors for policy

Automatically generates allowed and disallowed behaviors for an alignment policy

path Parameters
id
required
string

Policy id to generate behaviors for

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"
}

Add decision parameters to policy

Adds or updates decision parameters for a policy, starting with threshold configuration

path Parameters
id
required
string

Policy id to update decision parameters

Request Body schema: application/json
required
classification_threshold
required
number [ 0 .. 1 ]

Classification threshold value between 0 and 1

Responses

Request samples

Content type
application/json
{
  • "classification_threshold": 1
}

Guardrail Dataset

Update guardrail dataset

Updates the configuration of a guardrail dataset

path Parameters
policyId
required
string

ID of the policy to update dataset for

Request Body schema: application/json
required
stage
string

Stage of the guardrail dataset

Array of objects (UpdateGuardrailDatapointDto)

Array of datapoints for the guardrail dataset

bestTemperature
number

Best temperature determined so far

bestInstruction
string

Best instruction determined so far

Responses

Request samples

Content type
application/json
{
  • "stage": "REVIEW",
  • "dataset": [
    ],
  • "bestTemperature": 0.7,
  • "bestInstruction": "You are an expert in providing helpful responses..."
}

Get guardrail dataset

Retrieves a guardrail dataset and all its metadata by policy ID

path Parameters
policyId
required
string

ID of the policy to get dataset for

query Parameters
page
number
Default: 1

Page number for pagination (starting from 1)

limit
number
Default: 300

Number of items per page. Takes default value of 300 if not specified. Maximum limit is 500

includeDataset
boolean
Default: true

Whether to include the dataset in the response

populateCreatorEmails
boolean
Default: true

Whether to populate creator emails in the response

Responses

Response samples

Content type
application/json
{
  • "policyId": "policy_12345",
  • "creator": "admin",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ],
  • "stage": "seed",
  • "currentRound": 2,
  • "dataset": [
    ],
  • "datasetPageDetails": {
    },
  • "feedback": [
    ],
  • "version": 3,
  • "bestTemperature": 0.8,
  • "bestInstruction": "You are an expert in providing helpful responses...",
  • "created_at": "2024-03-14T12:00:00Z",
  • "updated_at": "2024-03-14T12:00:00Z"
}

Create input guardrail dataset

Creates a new input guardrail dataset for a policy

path Parameters
policyId
required
string

ID of the policy to create dataset for

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

An array of allowed behaviors

disallowedBehaviors
Array of strings

An array of disallowed behaviors

manualCreation
required
boolean

Indicates whether this dataset was manually created

Responses

Request samples

Content type
application/json
{
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ],
  • "manualCreation": false
}

Response samples

Content type
application/json
{
  • "policyId": "policy_12345",
  • "creator": "admin",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ],
  • "stage": "seed",
  • "currentRound": 2,
  • "dataset": [
    ],
  • "datasetPageDetails": {
    },
  • "feedback": [
    ],
  • "version": 3,
  • "bestTemperature": 0.8,
  • "bestInstruction": "You are an expert in providing helpful responses...",
  • "created_at": "2024-03-14T12:00:00Z",
  • "updated_at": "2024-03-14T12:00:00Z"
}

Create output guardrail dataset

Creates a new output guardrail dataset for a policy

path Parameters
policyId
required
string

ID of the policy to create dataset for

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

An array of allowed behaviors

disallowedBehaviors
Array of strings

An array of disallowed behaviors

manualCreation
required
boolean

Indicates whether this dataset was manually created

Responses

Request samples

Content type
application/json
{
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ],
  • "manualCreation": false
}

Response samples

Content type
application/json
{
  • "policyId": "policy_12345",
  • "creator": "admin",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ],
  • "stage": "seed",
  • "currentRound": 2,
  • "dataset": [
    ],
  • "datasetPageDetails": {
    },
  • "feedback": [
    ],
  • "version": 3,
  • "bestTemperature": 0.8,
  • "bestInstruction": "You are an expert in providing helpful responses...",
  • "created_at": "2024-03-14T12:00:00Z",
  • "updated_at": "2024-03-14T12:00:00Z"
}

Review input guardrail dataset

Reviews and updates an input guardrail dataset

path Parameters
policyId
required
string

ID of the policy to review dataset for

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

Array of reviewed guardrail datapoints for input

Array
isAccepted
required
boolean

Whether the datapoint is accepted by the user. False means it was discarded.

prompt
string

The prompt string of the datapoint

isCompliant
boolean

Indicates if the prompt is compliant with the policy

feedback
string

Any user feedback on the prompt

id
required
string

Unique identifier for the datapoint

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "policyId": "policy_12345",
  • "creator": "admin",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ],
  • "stage": "seed",
  • "currentRound": 2,
  • "dataset": [
    ],
  • "datasetPageDetails": {
    },
  • "feedback": [
    ],
  • "version": 3,
  • "bestTemperature": 0.8,
  • "bestInstruction": "You are an expert in providing helpful responses...",
  • "created_at": "2024-03-14T12:00:00Z",
  • "updated_at": "2024-03-14T12:00:00Z"
}

Review output guardrail dataset

Reviews and updates an output guardrail dataset

path Parameters
policyId
required
string

ID of the policy to review dataset for

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

Array of reviewed guardrail datapoints for output

Array
isAccepted
required
boolean

Whether the datapoint is accepted by the user. False means it was discarded.

prompt
string

The prompt string of the datapoint

isCompliant
boolean

Indicates if the prompt is compliant with the policy

feedback
string

Any user feedback on the prompt

id
required
string

Unique identifier for the datapoint

response
string

The response string of the datapoint

userName
string

Name of the user who reviewed the datapoint

userId
string

User ID of the reviewer

updateTime
string

Timestamp of the review update (string format)

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "policyId": "policy_12345",
  • "creator": "admin",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ],
  • "stage": "seed",
  • "currentRound": 2,
  • "dataset": [
    ],
  • "datasetPageDetails": {
    },
  • "feedback": [
    ],
  • "version": 3,
  • "bestTemperature": 0.8,
  • "bestInstruction": "You are an expert in providing helpful responses...",
  • "created_at": "2024-03-14T12:00:00Z",
  • "updated_at": "2024-03-14T12:00:00Z"
}

Feedback guardrail dataset

Provides feedback on a guardrail dataset

path Parameters
policyId
required
string

ID of the policy to provide feedback for

Responses

Response samples

Content type
application/json
{
  • "policyId": "policy_12345",
  • "creator": "admin",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ],
  • "stage": "seed",
  • "currentRound": 2,
  • "dataset": [
    ],
  • "datasetPageDetails": {
    },
  • "feedback": [
    ],
  • "version": 3,
  • "bestTemperature": 0.8,
  • "bestInstruction": "You are an expert in providing helpful responses...",
  • "created_at": "2024-03-14T12:00:00Z",
  • "updated_at": "2024-03-14T12:00:00Z"
}

Get feedback guardrail dataset

Retrieves feedback on a guardrail dataset

path Parameters
policyId
required
string

ID of the policy to get feedback for

Responses

Response samples

Content type
application/json
{
  • "_id": "507f1f77bcf86cd799439011",
  • "promptId": "prompt_123",
  • "generated": {
    },
  • "review": {
    },
  • "creatorType": "user",
  • "creator": "507f1f77bcf86cd799439012",
  • "createdAt": "2024-03-14T12:00:00Z",
  • "updatedAt": "2024-03-14T12:00:00Z"
}

Apply guardrail feedback

Applies feedback on a guardrail dataset

path Parameters
policyId
required
string

ID of the policy to apply feedback for

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

Array of feedback item IDs to apply

Responses

Request samples

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

Get guardrail dataset

Retrieves a guardrail dataset by policy ID

path Parameters
policyId
required
string

ID of the policy to get dataset for

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

Array of feedback item IDs to reject

Responses

Request samples

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

Get latest finetuned model info

Retrieves the latest finetuned model info for a policy

path Parameters
policyId
required
string

ID of the policy to get latest finetuned model info for

Responses

Response samples

Content type
application/json
{
  • "status": "COMPLETED",
  • "deploymentId": "no-political-advice-09809a0c098efb0",
  • "creator": "user_123",
  • "policyIds": [
    ],
  • "modelType": "input_mini",
  • "fineTunedModelZipS3Path": "s3://my-bucket/models/model.zip",
  • "isModelEncrypted": true,
  • "trainingJobId": "job_123",
  • "errorMessage": "string"
}

Get fine-tuned model info

Retrieves fine-tuned model info by model ID

path Parameters
modelId
required
string

ID of the fine-tuned model to get info for

Responses

Response samples

Content type
application/json
{
  • "status": "COMPLETED",
  • "modelId": "finetuned_model_abc",
  • "policyIds": [
    ],
  • "deploymentId": "no-political-advice-09809a0c098efb0"
}

Update fine-tuned model info

Updates the fine-tuned model info by model ID (also deploys the model if needed)

path Parameters
modelId
required
string

ID of the fine-tuned model to update info for

Request Body schema: application/json
required
status
required
string
Enum: "QUEUED" "TRAINING" "TRAINED" "DEPLOYING" "COMPLETED" "DEPLOYMENT_FAILED" "FAILED" "CANCELLED"

Status of the fine-tuning process

datasetS3Path
string

Path to the dataset in S3

fineTunedModelZipS3Path
string

Path to the fine-tuned model zip in S3

isModelEncrypted
boolean

Is the model encrypted

error
string

Error message if training fails

Responses

Request samples

Content type
application/json
{
  • "status": "QUEUED",
  • "datasetS3Path": "s3://my-bucket/datasets/dataset.csv",
  • "fineTunedModelZipS3Path": "s3://my-bucket/models/model.zip",
  • "isModelEncrypted": true,
  • "error": "Out of memory error"
}

Response samples

Content type
application/json
{
  • "status": "COMPLETED",
  • "modelId": "finetuned_model_abc",
  • "policyIds": [
    ],
  • "deploymentId": "no-political-advice-09809a0c098efb0"
}

Get deployment status of a fine-tuned model

Retrieves the deployment status of a fine-tuned model

path Parameters
modelId
required
string

ID of the fine-tuned model to get deployment status for

Responses

Response samples

Content type
application/json
{
  • "status": "COMPLETED",
  • "reason": "DeploymentReady",
  • "message": "string",
  • "readyReplicas": 0,
  • "observedGeneration": 0,
  • "modelPhase": "string"
}

Redeploy a policy

Attempts to redeploy a policy

path Parameters
policyId
required
string

ID of the policy to be redeployed

Responses

Response samples

Content type
application/json
{
  • "status": "COMPLETED",
  • "modelId": "finetuned_model_abc",
  • "policyIds": [
    ],
  • "deploymentId": "no-political-advice-09809a0c098efb0"
}

Update guardrail config

Updates the configuration of a guardrail policy

path Parameters
policyId
required
string

ID of the policy to update config for

Request Body schema: application/json
required
name
string

Name of the guardrail config

description
string

Description of the guardrail config

allowedBehaviors
Array of strings

List of allowed behaviors

disallowedBehaviors
Array of strings

List of disallowed behaviors

Responses

Request samples

Content type
application/json
{
  • "name": "No tax/investment advise",
  • "description": "This guardrail prevents tax and investment advise.",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ]
}

Response samples

Content type
application/json
{
  • "name": "No tax/investment advise",
  • "description": "This guardrail prevents tax and investment advise.",
  • "allowedBehaviors": [
    ],
  • "disallowedBehaviors": [
    ],
  • "_id": "507f1f77bcf86cd799439011",
  • "policyId": "507f1f77bcf86cd799439012",
  • "version": 1,
  • "created_at": "2024-03-14T12:00:00Z",
  • "updated_at": "2024-03-14T12:00:00Z"
}

Add generated guardrail dataset points

Adds generated guardrail dataset points for a given policy

path Parameters
policyId
required
string

ID of the policy to add dataset points for

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

An array of datapoints to add to the guardrail dataset

Array
id
required
string

Unique identifier for the datapoint

round
required
number

Round number for the datapoint

required
object

Generated data for this datapoint

object

Optional review data for this datapoint

creatorType
string
Enum: "user" "model" "file-upload" "generated" "feedback"

Type of creator for this datapoint

creatorId
string

MongoDB ObjectId of the creator

Responses

Request samples

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

Update guardrail dataset point

Updates a single guardrail dataset point for a given policy

path Parameters
policyId
required
string

ID of the policy to update dataset point for

Request Body schema: application/json
required
id
required
string

Unique identifier for the dataset point

prompt
required
string

The prompt text for the dataset point

response
string

In case of output guard-rails, response for the dataset point

isAccepted
boolean

Indicates if the datapoint is accepted

isCompliant
boolean

Indicates if the datapoint is compliant

Responses

Request samples

Content type
application/json
{
  • "id": "xyz789",
  • "prompt": "Can you please tell me what factory design pattern is?",
  • "response": "Factory design pattern is a creational pattern... ",
  • "isAccepted": true,
  • "isCompliant": true
}

Delete guardrail dataset points

Deletes guardrail dataset points for a given policy

path Parameters
policyId
required
string

ID of the policy to delete dataset points for

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

Array of IDs to delete

Responses

Request samples

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

Add user-defined guardrail dataset point

Adds a single user-defined guardrail dataset point for a given policy

path Parameters
policyId
required
string

ID of the policy to add dataset point for

Request Body schema: application/json
required
prompt
required
string

Prompt text for the user-defined dataset point

response
string

In case of output guard-rails, the response for the prompt

isCompliant
required
boolean

Indicates if the datapoint is compliant

Responses

Request samples

Content type
application/json
{
  • "prompt": "Can you please tell me what factory design pattern is?",
  • "response": "Factory design pattern is a creational pattern... ",
  • "isCompliant": true
}

Get pending changes

Retrieves pending changes for a guardrail dataset, which are the diffs that aren't yet trained.

path Parameters
policyId
required
string

Responses

Response samples

Content type
application/json
{
  • "diffs": [
    ],
  • "shouldRegenerate": true
}

Start training

Starts training for a guardrail dataset

path Parameters
policyId
required
string

ID of the policy to train

Request Body schema: application/json
required
title
string

Optional title for the current model training session

description
required
string

Description of the training session

Responses

Request samples

Content type
application/json
{
  • "title": "Training session 1",
  • "description": "This training focuses on moderate content response behaviors."
}

Response samples

Content type
application/json
{
  • "diffs": [
    ],
  • "shouldRegenerate": true
}

Restart training

Restarts training for a guardrail dataset, marking all AWAITING_TRAINING diffs as IN_TRAINING and restarting the training job

path Parameters
policyId
required
string

ID of the policy to restart training

Responses

Response samples

Content type
application/json
{
  • "diffs": [
    ],
  • "shouldRegenerate": true
}

Cancel training

Cancels training for a guardrail dataset

path Parameters
policyId
required
string

ID of the policy to cancel training

Responses

Response samples

Content type
application/json
{
  • "diffs": [
    ],
  • "shouldRegenerate": true
}

Cancel data generation

Cancels data generation for a guardrail dataset

path Parameters
policyId
required
string

ID of the policy to cancel data generation for

Responses

Restart data generation

Restarts data generation for a guardrail dataset from scratch, discarding all non-user reviewed datapoints

path Parameters
policyId
required
string

ID of the policy to restart data generation for

Responses

Resume data generation

Resumes data generation for a guardrail dataset from where it was previously cancelled, failed, or timed out

path Parameters
policyId
required
string

ID of the policy to resume data generation for

Responses

Update training status

Updates the training status for a guardrail dataset

path Parameters
policyId
required
string

ID of the policy to update training status

Request Body schema: application/json
required
fineTunedModeId
required
string

ID of the fine-tuned model

isSuccess
required
boolean

Indicates if the training was successful

bestInstruction
string

Best instruction found during training

bestTemperature
number

Best temperature found during training

Responses

Request samples

Content type
application/json
{
  • "fineTunedModeId": "finetuned_007",
  • "isSuccess": true,
  • "bestInstruction": "You are an expert in providing helpful responses...",
  • "bestTemperature": 0.7
}

Get versioning info

Retrieves versioning info for a guardrail dataset

path Parameters
policyId
required
string

ID of the policy to get versioning info

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Restore version

Restores a guardrail dataset to a specific version

path Parameters
policyId
required
string

ID of the policy to revert

Request Body schema: application/json
required
versionId
required
string

ID of the version to revert to

Responses

Request samples

Content type
application/json
{
  • "versionId": "version_123"
}

Regenerate guardrail dataset

Regenerates the guardrail dataset for a policy

path Parameters
policyId
required
string

ID of the policy to regenerate dataset

Responses

Upload CSV dataset

Upload a CSV file to populate the guardrail dataset

path Parameters
policyId
required
string

ID of the policy to upload dataset

Request Body schema: multipart/form-data
required
file
string <binary>
replaceDuplicates
boolean

Responses

Health

API Health Endpoint

To check if the api is healthy

Responses

Version

API Version Endpoint

To return the api version

Responses

DynamoGuard Extension Get Domains

ExtensionController_getDomains

Responses

Response samples

Content type
application/json
[
  • "string"
]

Application

Create a new application

Create a new application with optional AI systems

Request Body schema: application/json
required
name
required
string

Name of the application

tag
string

Tag/description of the application

aiSystems
Array of strings

IDs of AI systems to associate with the application

Responses

Request samples

Content type
application/json
{
  • "name": "Chat Application",
  • "tag": "AI-powered chat application for customer support",
  • "aiSystems": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "123",
  • "name": "My Awesome App",
  • "tag": "v1.0",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": { },
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "metadata": { }
}

List applications with pagination

query Parameters
page
required
number
limit
required
number
includeAllowedScopes
required
boolean
includeModerationPolicies
required
boolean
includePolicyCreator
required
boolean
includeApplicationCreator
required
boolean
includePolicyStatus
required
boolean

Responses

Response samples

Content type
application/json
{ }

Share application with collaborator

Share a application with a collaborator and assign specific roles

path Parameters
_id
required
string
Request Body schema: application/json
required
userEmail
required
string

Email of the collaborator

resourceLevelRoles
required
Array of strings

Role of the collaborator at which this resource is being shared

Responses

Request samples

Content type
application/json
{
  • "userEmail": "string",
  • "resourceLevelRoles": [
    ]
}

Remove collaborator from application

Remove a collaborator and their associated roles from the application

path Parameters
_id
required
string
Request Body schema: application/json
required
userEmail
required
string

Email of the collaborator

Responses

Request samples

Content type
application/json
{
  • "userEmail": "string"
}

Update application public access

Update the public access settings and roles for the application

path Parameters
_id
required
string
Request Body schema: application/json
required
isPublic
required
boolean

Whether the resource is shared with public

publicResourceLevelRoles
Array of strings

The role at which the public is allowed to access this resource

Responses

Request samples

Content type
application/json
{
  • "isPublic": true,
  • "publicResourceLevelRoles": [
    ]
}

Get application access information

Get the resource level access information for the application

path Parameters
_id
required
string

Responses

Get application resource level roles

Get the resource level roles associated with the application

Responses

Get application resource level scopes

Get the resource level scopes associated with the application for the current user

path Parameters
_id
required
string

Responses

Get a specific application by its ID

path Parameters
id
required
number

The ID of the application to retrieve

query Parameters
includeAllowedScopes
required
boolean
includeModerationPolicies
required
boolean
includePolicyCreator
required
boolean
includePolicyStatus
required
boolean

Responses

Response samples

Content type
application/json
{ }

Update an existing application

Updates specified fields of an existing application.

path Parameters
id
required
integer

Application ID

Request Body schema: application/json
required
name
string [ 1 .. 255 ] characters

The updated name of the application.

tag
string

The updated tag or short description for the application.

metadata
object

Optional metadata for the application, as a JSON object.

Responses

Request samples

Content type
application/json
{
  • "name": "Enhanced Chat Application",
  • "tag": "Updated customer support chat interface",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "id": "123",
  • "name": "My Awesome App",
  • "tag": "v1.0",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": { },
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "metadata": { }
}

Delete an existing application

Deletes an existing application by its ID.

path Parameters
id
required
integer

Application ID

Responses

Response samples

Content type
application/json
{
  • "deletedApplicationId": "6078f9b8b328f40068b9fd2a"
}

Get all AI systems for application (active + removed)

Retrieves all AI systems that were ever linked to the application for logs filtering UI

path Parameters
id
required
number

The ID of the application to retrieve AI systems for

Responses

Response samples

Content type
application/json
{ }

Get application logs

Retrieve logs for a specific application with enhanced AI system information and filtering capabilities.

path Parameters
id
required
number

The ID of the application

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" "INPUT_RELEVANCE" "RESPONSE_RELEVANCE" "OOB_HALLUCINATION" "KEYWORD"

The policy type to filter by

actions
Array of strings

List of actions 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

policyTypes
Array of strings

List of policy types 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

aiSystemIds
Array of strings
Example: aiSystemIds=507f1f77bcf86cd799439011&aiSystemIds=507f1f77bcf86cd799439012

Array of specific AI System IDs to filter logs

includeRemovedAiSystems
boolean
Default: true
Example: includeRemovedAiSystems=true

Whether to include logs from AI systems that have been removed from the application

Responses

Response samples

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

Get application logs count

Retrieve the count of logs for a specific application with the same filtering capabilities as the main logs endpoint.

path Parameters
id
required
number

The ID of the application

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" "INPUT_RELEVANCE" "RESPONSE_RELEVANCE" "OOB_HALLUCINATION" "KEYWORD"

The policy type to filter by

actions
Array of strings

List of actions 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

policyTypes
Array of strings

List of policy types 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

aiSystemIds
Array of strings
Example: aiSystemIds=507f1f77bcf86cd799439011&aiSystemIds=507f1f77bcf86cd799439012

Array of specific AI System IDs to filter logs

includeRemovedAiSystems
boolean
Default: true
Example: includeRemovedAiSystems=true

Whether to include logs from AI systems that have been removed from the application

Responses

Response samples

Content type
application/json
0
0

Assign (add/remove) AI Systems to/from an Application

Adds and/or removes AI Systems from an application and synchronizes moderation policies.

path Parameters
id
required
number

The ID of the application

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

Array of MongoDB MLModel IDs to add to the application.

removeAiSystems
Array of strings

Array of MongoDB MLModel IDs to remove from the application.

Responses

Request samples

Content type
application/json
{
  • "addAiSystems": [
    ],
  • "removeAiSystems": [
    ]
}

Response samples

Content type
application/json
{
  • "applicationId": "123",
  • "processedResults": [
    ]
}

Assign (add/remove) Policies to/from an Application

Adds and/or removes Policies from an application and synchronizes them with all existing AI systems.

path Parameters
id
required
number

The ID of the application

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

Array of MongoDB Policy IDs to add to the application.

removePolicies
Array of strings

Array of MongoDB Policy IDs to remove from the application.

Responses

Request samples

Content type
application/json
{
  • "addPolicies": [
    ],
  • "removePolicies": [
    ]
}

Response samples

Content type
application/json
{
  • "applicationId": "123",
  • "processedResults": [
    ]
}

Manage Policies for an Application

Replace existing policies with specific sets of policies for individual AI systems within the application.

path Parameters
id
required
number

The ID of the application

Request Body schema: application/json
required
object (ManagePoliciesDto)

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{ }