Skip to content

Latest commit

 

History

History
90 lines (60 loc) · 3.84 KB

File metadata and controls

90 lines (60 loc) · 3.84 KB

AgentTasks

Overview

Available Operations

create

Create an agent task on behalf of a user. The response contains a URL that, when visited, creates a session for the user. The agent_id is stable per agent_name within an instance. The agent_task_id is unique per call.

Example Usage

require 'clerk_sdk_ruby'

Models = ::Clerk::Models
s = ::Clerk::OpenAPIClient.new(
  bearer_auth: '<YOUR_BEARER_TOKEN_HERE>'
)

req = nil
res = s.agent_tasks.create(request: req)

unless res.agent_task.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request Models::Operations::CreateAgentTaskRequest ✔️ The request object to use for the request.

Response

Crystalline::Nilable.new(Models::Operations::CreateAgentTaskResponse)

Errors

Error Type Status Code Content Type
Models::Errors::ClerkErrors 400, 404, 422 application/json
Errors::APIError 4XX, 5XX */*

revoke

Revokes a pending agent task.

Example Usage

require 'clerk_sdk_ruby'

Models = ::Clerk::Models
s = ::Clerk::OpenAPIClient.new(
  bearer_auth: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.agent_tasks.revoke(agent_task_id: '<id>')

unless res.agent_task.nil?
  # handle response
end

Parameters

Parameter Type Required Description
agent_task_id ::String ✔️ The ID of the agent task to be revoked.

Response

Crystalline::Nilable.new(Models::Operations::RevokeAgentTaskResponse)

Errors

Error Type Status Code Content Type
Models::Errors::ClerkErrors 400, 404 application/json
Errors::APIError 4XX, 5XX */*