AskUI agents API
The agents API from AskUI — 3 operation(s) for agents.
The agents API from AskUI — 3 operation(s) for agents.
openapi: 3.1.0
info:
title: AskUI Workspaces access-tokens agents API
version: 0.2.15
tags:
- name: agents
paths:
/api/v1/agents:
get:
tags:
- agents
summary: List Agents
description: List all agents matching the query parameters sorted anti-chronologically by when they were last updated (`updated_at`).
operationId: list_agents_api_v1_agents_get
security:
- Bearer: []
- Basic: []
parameters:
- name: agent_id
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
format: uuid4
- type: 'null'
title: Agent Id
- name: workspace_id
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
format: uuid4
- type: 'null'
title: Workspace Id
- name: status
in: query
required: false
schema:
anyOf:
- type: array
items:
enum:
- ACTIVE
- ARCHIVED
type: string
- type: 'null'
title: Status
- name: skip
in: query
required: false
schema:
type: integer
minimum: 0
default: 0
title: Skip
- name: limit
in: query
required: false
schema:
type: integer
maximum: 100
minimum: 1
default: 100
title: Limit
- name: expand
in: query
required: false
schema:
anyOf:
- type: array
items:
const: total_count
type: string
- type: 'null'
description: 'total_count: Include the total number of agents that match the query, only accurate up to 100.'
title: Expand
description: 'total_count: Include the total number of agents that match the query, only accurate up to 100.'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/AgentsListResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
post:
tags:
- agents
summary: Create Agent
operationId: create_agent_api_v1_agents_post
security:
- Bearer: []
- Basic: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AgentCreateCommand'
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Agent'
'409':
description: Conflict
'500':
description: Internal server error
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/agents/{agent_id}:
patch:
tags:
- agents
summary: Update Agent
operationId: update_agent_api_v1_agents__agent_id__patch
security:
- Bearer: []
- Basic: []
parameters:
- name: agent_id
in: path
required: true
schema:
type: string
format: uuid4
title: Agent Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AgentUpdateCommand'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Agent'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/agents/templates:
get:
tags:
- agents
summary: List Agent Templates
description: List all available agent templates.
operationId: list_agent_templates_api_v1_agents_templates_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ListAgentTemplatesResponse'
'500':
description: Internal server error
security:
- Bearer: []
- Basic: []
components:
schemas:
ListAgentTemplatesResponse:
properties:
data:
items:
$ref: '#/components/schemas/AgentTemplate'
type: array
title: Data
type: object
required:
- data
title: ListAgentTemplatesResponse
DataDestinationWebhook:
properties:
type:
type: string
const: WEBHOOK
title: Type
default: WEBHOOK
url:
type: string
maxLength: 2083
minLength: 1
format: uri
title: Url
headers:
additionalProperties:
type: string
type: object
title: Headers
type: object
required:
- url
- headers
title: DataDestinationWebhook
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
type: object
required:
- loc
- msg
- type
title: ValidationError
AgentsListResponse:
properties:
data:
items:
$ref: '#/components/schemas/Agent'
type: array
title: Data
hasMore:
type: boolean
title: Hasmore
description: Whether there are more agents that match the query that were not included in this response.
default: false
totalCount:
anyOf:
- type: integer
- type: 'null'
title: Totalcount
description: The total number of agents that match the query, only accurate up to 100.
type: object
required:
- data
title: AgentsListResponse
AgentTemplate:
properties:
id:
type: string
maxLength: 64
minLength: 1
pattern: ^[a-zA-Z0-9-_.]{0,64}$
title: Id
name:
type: string
pattern: ^[a-zA-Z0-9]([a-zA-Z0-9-_. ]{0,62}[a-zA-Z0-9])?$
title: Name
description: 'The name of the agent. The name must only contain the following characters: a-z, A-Z, 0-9, -, _, and space. The name must not be empty. The name must start and end with a letter or a number. The name must not be longer than 64 characters.'
description:
type: string
maxLength: 1024
title: Description
default: ''
url:
type: string
maxLength: 2083
minLength: 1
format: uri
title: Url
lastModified:
type: string
format: date-time
title: Lastmodified
type: object
required:
- id
- name
- url
- lastModified
title: AgentTemplate
JsonSchema:
properties:
title:
type: string
pattern: ^[a-zA-Z0-9_-]+$
title: Title
default: DataToExtract
description:
type: string
title: Description
default: ''
type:
type: string
const: object
title: Type
default: object
properties:
additionalProperties:
additionalProperties: true
type: object
type: object
minProperties: 1
title: Properties
required:
items:
type: string
type: array
title: Required
type: object
required:
- properties
title: JsonSchema
EmailAgentTriggerUpdate:
properties:
active:
anyOf:
- type: boolean
- type: 'null'
title: Active
allowedSenders:
anyOf:
- items:
type: string
type: array
uniqueItems: true
- type: 'null'
title: Allowedsenders
localPart:
anyOf:
- type: string
pattern: ^[a-zA-Z0-9-_.+]+$
- type: 'null'
title: Localpart
type: object
title: EmailAgentTriggerUpdate
DataDestinationAskUiWorkflow:
properties:
type:
type: string
const: ASKUI_WORKFLOW
title: Type
default: ASKUI_WORKFLOW
host:
$ref: '#/components/schemas/AskUiRunnerHost'
runnerTags:
items:
type: string
type: array
title: Runnertags
workflows:
items:
type: string
type: array
minItems: 1
title: Workflows
type: object
required:
- host
- runnerTags
- workflows
title: DataDestinationAskUiWorkflow
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
DataDestinationWebhookCreate:
properties:
type:
type: string
const: WEBHOOK
title: Type
default: WEBHOOK
url:
type: string
maxLength: 2083
minLength: 1
format: uri
title: Url
headers:
additionalProperties:
type: string
type: object
title: Headers
type: object
required:
- url
title: DataDestinationWebhookCreate
AgentUpdateCommand:
properties:
name:
anyOf:
- type: string
pattern: ^[a-zA-Z0-9]([a-zA-Z0-9-_. ]{0,62}[a-zA-Z0-9])?$
description: 'The name of the agent. The name must only contain the following characters: a-z, A-Z, 0-9, -, _, and space. The name must not be empty. The name must start and end with a letter or a number. The name must not be longer than 64 characters.'
- type: 'null'
title: Name
description:
anyOf:
- type: string
maxLength: 1024
default: ''
- type: 'null'
title: Description
status:
anyOf:
- type: string
enum:
- ACTIVE
- ARCHIVED
- type: 'null'
title: Status
emailTrigger:
anyOf:
- $ref: '#/components/schemas/EmailAgentTriggerUpdate'
- type: 'null'
autoConfirm:
anyOf:
- type: boolean
- type: 'null'
title: Autoconfirm
type: object
title: AgentUpdateCommand
EmailAgentTriggerCreate:
properties:
active:
type: boolean
title: Active
description: If false, no emails can be send to trigger agent.
default: true
allowedSenders:
items:
type: string
type: array
uniqueItems: true
title: Allowedsenders
description: The email addresses that are allowed to send emails to trigger the agent. If empty, no emails can be send to trigger agent.
localPart:
anyOf:
- type: string
pattern: ^[a-zA-Z0-9-_.+]+$
- type: 'null'
title: Localpart
description: Defaults to a unique email string if not provided.
type: object
title: EmailAgentTriggerCreate
AskUiRunnerHost:
type: string
enum:
- SELF
- ASKUI
title: AskUiRunnerHost
EmailAgentTrigger:
properties:
active:
type: boolean
title: Active
description: If false, no emails can be send to trigger agent.
default: true
allowedSenders:
items:
type: string
type: array
uniqueItems: true
title: Allowedsenders
description: The email addresses that are allowed to send emails to trigger the agent. If empty, no emails can be send to trigger agent.
email:
type: string
pattern: ^[a-zA-Z0-9-_.+]+@.*$
title: Email
description: 'The email address of the agent to send emails to to trigger the agent. The email address must be unique for each agent. The domain of the email address is fixed. The local part of the email address must be between 1 and 64 characters long and can only contain the following characters: a-z, A-Z, 0-9, -, _, . and +.'
type: object
required:
- email
title: EmailAgentTrigger
AgentCreateCommand:
properties:
name:
type: string
pattern: ^[a-zA-Z0-9]([a-zA-Z0-9-_. ]{0,62}[a-zA-Z0-9])?$
title: Name
description: 'The name of the agent. The name must only contain the following characters: a-z, A-Z, 0-9, -, _, and space. The name must not be empty. The name must start and end with a letter or a number. The name must not be longer than 64 characters.'
description:
type: string
maxLength: 1024
title: Description
default: ''
dataSchema:
anyOf:
- $ref: '#/components/schemas/JsonSchema'
- type: 'null'
description: The JSON schema of the data that the agent is going to extract from documents uploaded. The schema must comply with Draft 2020-12. The schema (root) must be an object with at least one property. The size of the schema must not exceed 15 MB.
autoConfirm:
type: boolean
title: Autoconfirm
description: If true, the agent will automatically confirm the data extracted, i.e., no review is necessary.
default: false
dataDestinations:
items:
oneOf:
- $ref: '#/components/schemas/DataDestinationAskUiWorkflowCreate'
- $ref: '#/components/schemas/DataDestinationWebhookCreate'
discriminator:
propertyName: type
mapping:
ASKUI_WORKFLOW: '#/components/schemas/DataDestinationAskUiWorkflowCreate'
WEBHOOK: '#/components/schemas/DataDestinationWebhookCreate'
type: array
title: Datadestinations
parentId:
anyOf:
- type: string
format: uuid4
- type: 'null'
title: Parentid
description: The ID of an agent that this agent is created from, i.e., of the previous version of this agent. Parent is going to be archived as part of the creation of the new (active) agent.
emailTrigger:
$ref: '#/components/schemas/EmailAgentTriggerCreate'
workspaceId:
type: string
format: uuid4
title: Workspaceid
templateId:
type: string
pattern: ^[a-zA-Z0-9-_.]{1,64}$
title: Templateid
description: The ID of the template to copy files from.
type: object
required:
- name
- workspaceId
- templateId
title: AgentCreateCommand
Agent:
properties:
id:
type: string
format: uuid4
title: Id
createdAt:
type: string
format: date-time
title: Createdat
updatedAt:
type: string
format: date-time
title: Updatedat
name:
type: string
pattern: ^[a-zA-Z0-9]([a-zA-Z0-9-_. ]{0,62}[a-zA-Z0-9])?$
title: Name
description: 'The name of the agent. The name must only contain the following characters: a-z, A-Z, 0-9, -, _, and space. The name must not be empty. The name must start and end with a letter or a number. The name must not be longer than 64 characters.'
status:
type: string
enum:
- ACTIVE
- ARCHIVED
title: Status
autoConfirm:
type: boolean
title: Autoconfirm
description: If true, the agent will automatically confirm the data extracted, i.e., no review is necessary.
description:
type: string
maxLength: 1024
title: Description
default: ''
emailTrigger:
$ref: '#/components/schemas/EmailAgentTrigger'
dataSchema:
anyOf:
- $ref: '#/components/schemas/JsonSchema'
- type: 'null'
description: "\n The data schema describes the data to extract in form of a [JSON schema draft 2020-12](https://json-schema.org/draft/2020-12/release-notes). Use the [\"description\" keyword](https://json-schema.org/understanding-json-schema/reference/annotations) of each property to provide additional information about the field, e.g., the prompt for extraction from sources. \n "
dataDestinations:
items:
oneOf:
- $ref: '#/components/schemas/DataDestinationAskUiWorkflow'
- $ref: '#/components/schemas/DataDestinationWebhook'
discriminator:
propertyName: type
mapping:
ASKUI_WORKFLOW: '#/components/schemas/DataDestinationAskUiWorkflow'
WEBHOOK: '#/components/schemas/DataDestinationWebhook'
type: array
title: Datadestinations
workspaceId:
type: string
format: uuid4
title: Workspaceid
folderPath:
anyOf:
- type: string
- type: 'null'
title: Folderpath
type: object
required:
- name
- status
- autoConfirm
- emailTrigger
- dataDestinations
- workspaceId
title: Agent
DataDestinationAskUiWorkflowCreate:
properties:
type:
type: string
const: ASKUI_WORKFLOW
title: Type
default: ASKUI_WORKFLOW
host:
$ref: '#/components/schemas/AskUiRunnerHost'
default: ASKUI
runnerTags:
items:
type: string
type: array
title: Runnertags
workflows:
items:
type: string
type: array
minItems: 1
title: Workflows
type: object
title: DataDestinationAskUiWorkflowCreate
securitySchemes:
Bearer:
type: http
scheme: bearer
Basic:
type: apiKey
in: header
name: Authorization