openapi: 3.0.1 info: title: api version: '' paths: /agents: get: description: >- Returns a list of agents that belong to the current project. The agents are returned sorted by creation date, with the most recently created agents appearing first. operationId: agents_list tags: - Agents parameters: [] responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/AgentsList' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: List all agents post: description: Creates a new agent with the given properties. operationId: agents_create tags: - Agents parameters: [] responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/Agent' '400': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '403': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: Create an agent requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AgentCreateParams' /agents/{agent_id}: get: description: Retrieves the agent with the given ID. operationId: agents_get tags: - Agents parameters: - name: agent_id in: path required: true schema: $ref: '#/components/schemas/AgentId' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/Agent' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: Retrieve an agent post: description: >- Updates the properties of the specified agent. Only the provided properties will be updated. Any properties not provided will be left unchanged. operationId: agents_update tags: - Agents parameters: - name: agent_id in: path required: true schema: $ref: '#/components/schemas/AgentId' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/Agent' '400': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '403': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '503': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: Update an agent requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AgentUpdateParams' delete: description: >- Permanently deletes the specified agent and all the interactions associated with it. This cannot be undone. operationId: agents_delete tags: - Agents parameters: - name: agent_id in: path required: true schema: $ref: '#/components/schemas/AgentId' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/Agent' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '503': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: Delete an agent /agents/{agent_id}/config: get: description: Retrieves the current configuration of the specified agent. operationId: agents_getConfig tags: - Agents parameters: - name: agent_id in: path required: true schema: $ref: '#/components/schemas/AgentId' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/AgentConfig' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: Retrieve agent configuration post: description: >- Updates the configuration of the specified agent. Only the provided properties will be updated. Any properties not provided will be left unchanged. operationId: agents_updateConfig tags: - Agents parameters: - name: agent_id in: path required: true schema: $ref: '#/components/schemas/AgentId' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/AgentConfig' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '503': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: Update agent configuration requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AgentConfigUpdateParams' /agents/{agent_id}/activate: post: description: >- Activates the specified agent. New message or interaction requests sent to this agent will not be blocked while the agent is active. This request does not fail if the agent is already active. operationId: agents_activate tags: - Agents parameters: - name: agent_id in: path required: true schema: $ref: '#/components/schemas/AgentId' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/Agent' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '503': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: Activate an agent /agents/{agent_id}/deactivate: post: description: >- Deactivates the specified agent. Any new message or interaction requests sent to this agent will be blocked while the agent is disabled. This request does not fail if the agent is already deactivated. operationId: agents_deactivate tags: - Agents parameters: - name: agent_id in: path required: true schema: $ref: '#/components/schemas/AgentId' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/Agent' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '503': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: Deactivate an agent /users: get: description: >- Returns a list of users that belong to the current project. The users are returned sorted by creation date, with the most recently created users appearing first. operationId: users_list tags: - Users parameters: - name: live_mode in: query description: If set to `"false"`, only test users will be returned. required: false schema: type: string nullable: true responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/UsersList' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: List all users post: description: Creates a new user with the given properties. operationId: users_create tags: - Users parameters: [] responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/User' '400': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '403': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: Create a user requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UserCreateParams' /users/{user_id}: get: description: Retrieves the user with the given ID. operationId: users_get tags: - Users parameters: - name: user_id in: path required: true schema: $ref: '#/components/schemas/UserId' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/User' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: Retrieve a user post: description: >- Updates the properties of the specified user. Only the provided properties will be updated. Any properties not provided will be left unchanged. operationId: users_update tags: - Users parameters: - name: user_id in: path required: true schema: $ref: '#/components/schemas/UserId' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/User' '400': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '403': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '503': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: Update a user requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UserUpdateParams' delete: description: >- Permanently deletes the specified user and all the interactions associated with it. This cannot be undone. operationId: users_delete tags: - Users parameters: - name: user_id in: path required: true schema: $ref: '#/components/schemas/UserId' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/User' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' '503': description: '' content: application/json: schema: $ref: '#/components/schemas/ApiError' summary: Delete a user components: schemas: AgentsList: title: AgentsList type: object properties: data: type: array items: $ref: '#/components/schemas/Agent' required: - data AnthropicConfig: title: AnthropicConfig type: object description: The configuration that is applied to Anthropic models. properties: temperature: $ref: '#/components/schemas/AnthropicConfigTemperature' nullable: true top_k: $ref: '#/components/schemas/AnthropicConfigTopK' nullable: true top_p: $ref: '#/components/schemas/AnthropicConfigTopP' nullable: true AnthropicConfigTemperature: title: AnthropicConfigTemperature type: number format: double description: >-

Determines the level of randomness in the generated output. Can take values between 0 and 1.0, with higher values like 0.8 resulting in more randomness, and lower values like 0.2 making the output more predictable. See original definition.

AnthropicConfigTopK: title: AnthropicConfigTopK type: integer description: >-

Only sample from the top K options for each subsequent token. Used to remove "long tail" low probability responses. Defaults to -1, which disables it. See original definition. See technical details.

AnthropicConfigTopP: title: AnthropicConfigTopP type: number format: double description: >-

An alternative to the temperature option. Uses a method called nucleus sampling, which involves considering only the tokens with the highest probability mass. It specifies the proportion of the probability mass to consider, with a value of 0.1 indicating that only the tokens comprising the top 10% probability mass will be taken into account. In essence, top_p determines the size of the set of tokens to choose from, based on their probabilities. Defaults to -1, which disables it. See original definition.

AgentConfigObjectType: title: AgentConfigObjectType type: string enum: - agent_config description: The type of the `AgentConfig` object GreetingMessage: title: GreetingMessage type: string description: >-

The message sent by the agent to initiate an interaction. This property supports Handlebars template format where you have access to the user and agent parameters. You can use these parameters to add context and personalize the message.

InitialTurn: title: InitialTurn $ref: '#/components/schemas/InteractionParticipant' description: >- Indicates who sends the first message in each interaction. Defaults to `"user"`. Model: title: Model type: string enum: - anthropic.claude-v1 - anthropic.claude-v1-100k - anthropic.claude-instant-v1 - anthropic.claude-instant-v1-100k - openai.gpt-4 - openai.gpt-3.5-turbo - openai.gpt-3.5-turbo-16k description: The underlying model that powers the agent. OpenAIConfig: title: OpenAIConfig type: object description: The configuration that is applied to OpenAI models. properties: frequency_penalty: $ref: '#/components/schemas/OpenAIConfigFrequencyPenalty' nullable: true presence_penalty: $ref: '#/components/schemas/OpenAIConfigPresencePenalty' nullable: true temperature: $ref: '#/components/schemas/OpenAIConfigTemperature' nullable: true top_p: $ref: '#/components/schemas/OpenAIConfigTopP' nullable: true OpenAIConfigFrequencyPenalty: title: OpenAIConfigFrequencyPenalty type: number format: double description: >-

Can take values between -2.0 and 2.0, with positive values penalizing the model for generating new tokens that have already appeared frequently in the generated text so far. This reduces the likelihood of the model repeating the same line or phrase verbatim. In essence, a higher positive value for frequency_penalty encourages the model to use less frequently used tokens in the generated text. See original definition.

OpenAIConfigPresencePenalty: title: OpenAIConfigPresencePenalty type: number format: double description: >-

Can take values between -2.0 and 2.0, with positive values penalizing the model for generating new tokens that have already appeared in the generated text. This encourages the model to generate text about new topics and increases the likelihood of generating more diverse content. In essence, a higher positive value for presence_penalty will lead to more avoidance of repeating previously used tokens in the generated text. See original definition.

OpenAIConfigTemperature: title: OpenAIConfigTemperature type: number format: double description: >-

Determines the level of randomness in the generated output. Can take values between 0 and 2.0, with higher values like 0.8 resulting in more randomness, and lower values like 0.2 making the output more predictable. See original definition.

OpenAIConfigTopP: title: OpenAIConfigTopP type: number format: double description: >-

An alternative to the temperature option. Uses a method called nucleus sampling, which involves considering only the tokens with the highest probability mass. It specifies the proportion of the probability mass to consider, with a value of 0.1 indicating that only the tokens comprising the top 10% probability mass will be taken into account. In essence, top_p determines the size of the set of tokens to choose from, based on their probabilities. See original definition.

SystemMessage: title: SystemMessage type: string description: >-

The system prompt that will be injected at the beginning of each interaction. This property supports Handlebars template format where you have access to the user and agent parameters. You can use these parameters to provide rich context to the agent and steer it in a specific direction.

AgentConfigUpdateParams: title: AgentConfigUpdateParams type: object description: The data with which an `AgentConfig` is updated. properties: anthropic: $ref: '#/components/schemas/AnthropicConfig' nullable: true greeting_message: $ref: '#/components/schemas/GreetingMessage' nullable: true initial_turn: $ref: '#/components/schemas/InitialTurn' nullable: true model: $ref: '#/components/schemas/Model' nullable: true openai: $ref: '#/components/schemas/OpenAIConfig' nullable: true system_message: $ref: '#/components/schemas/SystemMessage' nullable: true AgentConfig: title: AgentConfig type: object description: >- Represents the current configuration of the agent. This is an admin-level resource that is not exposed to the users. properties: object: $ref: '#/components/schemas/AgentConfigObjectType' anthropic: $ref: '#/components/schemas/AnthropicConfig' agent_id: $ref: '#/components/schemas/AgentId' greeting_message: $ref: '#/components/schemas/GreetingMessage' initial_turn: $ref: '#/components/schemas/InitialTurn' model: $ref: '#/components/schemas/Model' openai: $ref: '#/components/schemas/OpenAIConfig' system_message: $ref: '#/components/schemas/SystemMessage' required: - object - anthropic - agent_id - greeting_message - initial_turn - model - openai - system_message AgentId: title: AgentId type: string description: The unique identifier of the agent AgentObjectType: title: AgentObjectType type: string enum: - agent description: The type of the `Agent` object AgentActiveStatus: title: AgentActiveStatus type: boolean description: >- Whether the agent is currently active. If not, users will not be able to interact with the agent. AgentDescription: title: AgentDescription type: string description: The description of the agent, intended for developers' reference. AgentDisplayDescription: title: AgentDisplayDescription type: string description: >- The agent's public-facing description, meant to be visible to your users. AgentDisplayName: title: AgentDisplayName type: string description: >- The agent's display name, intended to serve as the public-facing name visible to your users. AgentName: title: AgentName type: string description: >- The name of the agent, designed to be visible to developers for internal reference purposes. AgentCreateParams: title: AgentCreateParams type: object description: The data with which an agent is created. properties: description: $ref: '#/components/schemas/AgentDescription' nullable: true display_description: $ref: '#/components/schemas/AgentDisplayDescription' nullable: true display_name: $ref: '#/components/schemas/AgentDisplayName' nullable: true greeting_message: $ref: '#/components/schemas/GreetingMessage' nullable: true initial_turn: $ref: '#/components/schemas/InitialTurn' nullable: true model: $ref: '#/components/schemas/Model' name: $ref: '#/components/schemas/AgentName' nullable: true openai: $ref: '#/components/schemas/OpenAIConfig' nullable: true system_message: $ref: '#/components/schemas/SystemMessage' nullable: true required: - model AgentUpdateParams: title: AgentUpdateParams type: object description: The data with which an agent is updated. properties: description: $ref: '#/components/schemas/AgentDescription' nullable: true display_description: $ref: '#/components/schemas/AgentDisplayDescription' nullable: true display_name: $ref: '#/components/schemas/AgentDisplayName' nullable: true name: $ref: '#/components/schemas/AgentName' nullable: true Agent: title: Agent type: object description: >-

An _agent_ is an AI entity that exists to serve your project's users. Agents are intelligent, configurable and context-aware and can interact with your users via a messaging system enabled by the Proficient API.

properties: id: $ref: '#/components/schemas/AgentId' object: $ref: '#/components/schemas/AgentObjectType' active: $ref: '#/components/schemas/AgentActiveStatus' description: $ref: '#/components/schemas/AgentDescription' display_description: $ref: '#/components/schemas/AgentDisplayDescription' display_name: $ref: '#/components/schemas/AgentDisplayName' name: $ref: '#/components/schemas/AgentName' created_at: $ref: '#/components/schemas/CreatedAt' updated_at: $ref: '#/components/schemas/UpdatedAt' required: - id - object - active - description - display_description - display_name - name - created_at - updated_at InteractionParticipant: title: InteractionParticipant type: string enum: - user - agent description: >- Represents the type of the participant in a given interaction. As an example, message are created by interaction participants so the `sent_by` property of a `Message` object must be an `InteractionParticipant`. UserId: title: UserId type: string description: The unique identifier of the user UserObjectType: title: UserObjectType type: string enum: - user description: The type of the `User` object UserExternalId: title: UserExternalId type: string description: >- A string that uniquely identifies the user within your project. Ensure that this is the ID that you use to identify the user in your system e.g. database ID, Firebase Auth ID etc. Failing to do so may cause unexpected bugs and errors in your application. UserFirstName: title: UserFirstName type: string description: The first name of the user. UserLastName: title: UserLastName type: string description: The last name of the user. UserLiveMode: title: UserLiveMode type: boolean description: >- Whether the user exists in live mode. This will be `false` if the user is a test user. UserCreateParams: title: UserCreateParams type: object description: The data with which a user is created. properties: external_id: $ref: '#/components/schemas/UserExternalId' first_name: $ref: '#/components/schemas/UserFirstName' nullable: true last_name: $ref: '#/components/schemas/UserLastName' nullable: true live_mode: $ref: '#/components/schemas/UserLiveMode' nullable: true required: - external_id UserUpdateParams: title: UserUpdateParams type: object description: The data with which a user is updated. properties: first_name: $ref: '#/components/schemas/UserFirstName' nullable: true last_name: $ref: '#/components/schemas/UserLastName' nullable: true User: title: User type: object description:

Represents a user of your project.

properties: id: $ref: '#/components/schemas/UserId' object: $ref: '#/components/schemas/UserObjectType' created_at: $ref: '#/components/schemas/CreatedAt' external_id: $ref: '#/components/schemas/UserExternalId' first_name: $ref: '#/components/schemas/UserFirstName' last_name: $ref: '#/components/schemas/UserLastName' live_mode: $ref: '#/components/schemas/UserLiveMode' updated_at: $ref: '#/components/schemas/UpdatedAt' required: - id - object - created_at - external_id - first_name - last_name - live_mode - updated_at ApiErrorCode: title: ApiErrorCode type: string enum: - invalid_request - invalid_credentials - forbidden - resource_not_found - conflict - unavailable - unknown ApiErrorBody: title: ApiErrorBody type: object properties: code: $ref: '#/components/schemas/ApiErrorCode' message: type: string required: - code - message ApiError: title: ApiError type: object description: >- Represents the general interface of an API error. The body of every error returned by the API contains `code` and `message` fields. properties: error: $ref: '#/components/schemas/ApiErrorBody' required: - error CreatedAt: title: CreatedAt type: integer description: >- The time at which the object was created, measured in milliseconds since the Unix epoch UpdatedAt: title: UpdatedAt type: integer description: >- The time at which the object was last updated, measured in milliseconds since the Unix epoch UsersList: title: UsersList type: object properties: data: type: array items: $ref: '#/components/schemas/User' required: - data securitySchemes: SecretKeyAuth: type: apiKey in: header name: Authorization servers: - url: https://api.proficientai.com description: Production (The production environment) - url: https://main-64bxvpctea-uc.a.run.app description: Staging (The staging environment) - url: http://localhost:8080 description: Development (The local environment)