DocsCloud SDK reference

This reference is currently available in English. The Cloud console remains in your selected language.

BEEOS CLOUD / DEVELOPER REFERENCE

Automations

Create, update, pause, resume, and delete automations; start and read runs; create webhook automations.

Overview

The automations domain manages automations: create, list, read, update, pause, resume, and delete them, start and read their runs, and create webhook automations.

11 operations · SDK resource: TypeScript cloud.automations · Python cloud.automations · Go cloud.Automations · API overview

Main objects

ProtoAutomationInput

FieldTypeRequiredDescription
namestringnoDisplay name of the automation, 1 to 256 characters and not blank.
promptstringnoText sent to the agent on every run, up to 65536 bytes and not blank.
targetProtoAutomationTargetnoAgent the prompt is sent to. Required.
scheduleProtoAutomationSchedulenoWhen the automation runs. Required.
sessionProtoAutomationSessionnoNot accepted by this API: a request that includes it fails with 400 invalid_argument. Automations created here open a new conversation for every run.
validFromstringnoEarliest time a run may start, as an RFC 3339 timestamp, inclusive. Omit it for no lower bound. It must not be after validUntil. Constraints: format=date-time.
validUntilstringnoLatest time a run may start, as an RFC 3339 timestamp, inclusive. Omit it for no upper bound. After it the automation becomes expired. Constraints: format=date-time.
createdInConversationIdstringnoID of the conversation the automation is created from, if any. It must be a conversation of the same end user.

Every field, and the methods that use this object: appendix.

ProtoAutomationPatch

FieldTypeRequiredDescription
namestringnoNew display name, 1 to 256 characters and not blank.
promptstringnoNew prompt sent to the agent on every run, up to 65536 bytes and not blank.
targetProtoAutomationTargetnoNew agent the prompt is sent to.
scheduleProtoAutomationSchedulenoNew schedule. It replaces the whole schedule, so send every field the kind needs, including anchorAt for every.
sessionProtoAutomationSessionnoNot accepted by this API: a request that includes it fails with 400 invalid_argument.
validFromstringnoNew earliest time a run may start, as an RFC 3339 timestamp, inclusive. Cannot be combined with clearValidFrom. Constraints: format=date-time.
validUntilstringnoNew latest time a run may start, as an RFC 3339 timestamp, inclusive. Cannot be combined with clearValidUntil. Constraints: format=date-time.
clearValidFrombooleannoSet to true to remove the lower bound of the validity period. Cannot be combined with validFrom.
clearValidUntilbooleannoSet to true to remove the upper bound of the validity period. Cannot be combined with validUntil.

Every field, and the methods that use this object: appendix.

ProtoAutomationRule

FieldTypeRequiredDescription
idstringnoUnique ID of the automation.
namestringnoDisplay name of the automation.
promptstringnoText sent to the agent on every run.
targetProtoAutomationTargetnoAgent the prompt is sent to.
scheduleProtoAutomationSchedulenoWhen the automation runs. Empty (kind unset) for webhook automations.
sessionProtoAutomationSessionnoHow runs choose their conversation. Automations created through this API always use new.
validFromstringnoEarliest time a run may start, as an RFC 3339 timestamp, inclusive. Null when there is no lower bound. Constraints: format=date-time.
validUntilstringnoLatest time a run may start, as an RFC 3339 timestamp, inclusive. Null when there is no upper bound. Constraints: format=date-time.
statusstringnoState of the automation. Allowed values: "enabled" — Active. A schedule automation runs at nextFireAt; a webhook automation reacts to incoming events; "paused" — Paused with the pause operation. No runs are created until it is resumed; "expired" — A schedule automation with no run left, for example a finished at schedule or one past validUntil. (enum table)
nextFireAtstringnoTime of the next scheduled run, as an RFC 3339 timestamp. Null when the automation is paused or expired and for webhook automations. Constraints: format=date-time.
createdInConversationIdstringnoID of the conversation the automation was created from. Empty when it was not created from a conversation.
createdAtstringnoTime the automation was created, as an RFC 3339 timestamp. Constraints: format=date-time.
updatedAtstringnoTime the automation was last changed, as an RFC 3339 timestamp. Constraints: format=date-time.
triggerKindstringnoWhat starts a run. Automations created before webhook triggers existed can report an empty value; treat it as schedule. Allowed values: "schedule" — Runs start on the schedule; "webhook" — Runs start when the event source delivers an event, optionally narrowed by eventFilter. (enum table)
hookIdstringnoID of the endpoint that receives the events of a webhook automation. Empty for schedule automations and for Gmail automations.
sourcestringnoPlatform that sends the events of a webhook automation, for example github or gmail. Empty for schedule automations.
eventFilterstringnoEvent type that starts a run of a webhook automation. Empty when every event starts a run.
mailboxstringnoGmail address a webhook automation watches. Empty for other sources.

Every field, and the methods that use this object: appendix.

ProtoAutomationSchedule

FieldTypeRequiredDescription
kindstringnoType of the schedule. It decides which of the other fields are required. Allowed values: "at" — Runs once, at at; "every" — Runs repeatedly, every intervalSeconds seconds counted from anchorAt; "cron" — Runs on the five-field cron expression, evaluated in the time zone tz. (enum table)
tzstringnoIANA time zone name, for example Asia/Shanghai. Required for every kind; Local is not accepted.
atstringnoTime of the single run, as an RFC 3339 timestamp. Required when kind is at; not allowed for other kinds. Constraints: format=date-time.
intervalSecondsstringnoSeconds between runs, as a decimal string. Required and greater than 0 when kind is every; not allowed for other kinds.
anchorAtstringnoTime the interval is counted from, as an RFC 3339 timestamp: runs fall on anchorAt plus whole multiples of the interval. When creating an every schedule it defaults to the creation time; when replacing a schedule it is required. Not allowed for other kinds. Constraints: format=date-time.
expressionstringnoFive-field cron expression: minute, hour, day of month, month and day of week. Required when kind is cron; not allowed for other kinds.

Every field, and the methods that use this object: appendix.

ProtoAutomationTarget

FieldTypeRequiredDescription
instanceIdstringnoID of the instance the automation runs on.
agentIdstringnoID of the agent that receives the prompt. It must be an active agent of instanceId in your app. Required.

Every field, and the methods that use this object: appendix.

ProtoAutomationRunInput

FieldTypeRequiredDescription
sourceRunIdstringnoID of an earlier run of the same automation to repeat. Send it together with rerunSessionMode, or send neither for a plain manual run.
rerunSessionModestringnoWhich conversation the rerun is delivered into. Required when sourceRunId is sent and not allowed without it. Allowed values: "original" — The conversation the source run was delivered into; "new" — A new conversation. (enum table)

Every field, and the methods that use this object: appendix.

ProtoAutomationRun

FieldTypeRequiredDescription
idstringnoUnique ID of the run.
automationIdstringnoID of the automation the run belongs to.
triggerTypestringnoWhat created the run. Allowed values: "schedule" — The automation's schedule came due; "manual" — A caller started it with the create-run operation; "rerun" — A caller started it with the create-run operation to repeat the earlier run in sourceRunId; "webhook" — An event arrived for a webhook automation. (enum table)
scheduledAtstringnoTime the run was due, as an RFC 3339 timestamp: the scheduled time for scheduled runs, the time of the request or event for the others. Constraints: format=date-time.
createdAtstringnoTime the run was created, as an RFC 3339 timestamp. Constraints: format=date-time.
statusstringnoDelivery state of the run. It tells whether the prompt reached the agent's conversation, not whether the agent finished the work. Allowed values: "scheduled" — Created and waiting to be delivered. A reasonCode of dispatch_unconfirmed means delivery started and its outcome is not confirmed yet; "dispatched" — The prompt was accepted into the conversation named by conversationId; "failed" — Delivery was rejected before the prompt was sent. reasonCode tells why; "skipped" — Not delivered because a condition no longer held when the run was due. reasonCode tells why. (enum table)
targetProtoAutomationTargetnoAgent the run delivers to, copied from the automation when the run was created.
sessionProtoAutomationSessionnoHow the run chooses its conversation, copied from the automation when the run was created. A rerun sets it from rerunSessionMode.
conversationIdstringnoID of the conversation the prompt is delivered into. Empty until the run is bound to a conversation.
wakeMessageIdstringnoID of the conversation message that carries the prompt. It equals the run id.
sourceRunIdstringnoID of the run this run repeats. Set only for reruns.
rerunSessionModestringnoWhich conversation a rerun is delivered into. Empty for runs that are not reruns. Allowed values: "original" — The conversation the source run was delivered into; "new" — A new conversation. (enum table)
reasonCodestringnoWhy a run was skipped or failed, or is unconfirmed. Empty otherwise and after the prompt was accepted. Skip reasons include outside_validity, missed_schedule (the run was not delivered within its window), automation_paused, automation_deleted and preparation_stale (the agent or session of the automation changed after the run was created). A failed run carries an API error code such as target_not_found, permission_denied, conversation_unavailable or dependency_unavailable. dispatch_unconfirmed means delivery started and its outcome is unknown. New codes can be added, so ignore codes you do not know.
dispatchedAtstringnoTime the prompt was accepted, as an RFC 3339 timestamp. Null until status is dispatched. Constraints: format=date-time.

Every field, and the methods that use this object: appendix.

ProtoAutomationWebhookInput

FieldTypeRequiredDescription
namestringnoDisplay name of the automation, 1 to 256 characters and not blank.
promptstringnoText sent to the agent on every run, up to 65536 bytes and not blank.
targetProtoAutomationTargetnoAgent the prompt is sent to. Required.
sessionProtoAutomationSessionnoNot accepted by this API: a request that includes it fails with 400 invalid_argument. Automations created here open a new conversation for every run.
validFromstringnoEarliest time a run may start, as an RFC 3339 timestamp, inclusive. Omit it for no lower bound. Constraints: format=date-time.
validUntilstringnoLatest time a run may start, as an RFC 3339 timestamp, inclusive. Omit it for no upper bound. Constraints: format=date-time.
createdInConversationIdstringnoID of the conversation the automation is created from, if any. It must be a conversation of the same end user.
sourcestringnoPlatform that sends the events, for example github or gmail, at most 64 characters without whitespace. The agent must have the matching connector set up. Required.
eventsarray<string>noNames of the events to subscribe to at the source, for example the GitHub event types the repository should deliver.
repoOwnerstringnoOwner of the repository to watch. Required when source is github.
repoNamestringnoName of the repository to watch. Required when source is github.
eventFilterstringnoEvent type that starts a run. When set, only events of exactly this type start a run; others are skipped. Empty accepts every event.
mailboxstringnoGmail address to watch. Required when source is gmail; leave empty for other sources.

Every field, and the methods that use this object: appendix.

ProtoAutomationSession

FieldTypeRequiredDescription
modestringnoHow a run chooses the conversation it is delivered into. Allowed values: "new" — Every run opens a new conversation with the agent. Automations created through this API always use it; "bound" — Every run is delivered into the conversation named by boundConversationId. (enum table)
boundConversationIdstringnoID of the conversation runs are delivered into. Set only when mode is bound; empty otherwise.

Every field, and the methods that use this object: appendix.

Typical flow

  1. Create an automation with automations.create, or a webhook automation with automations.createWebhook.
  2. Read or list with automations.get and automations.list; change with automations.update.
  3. Stop and restart it with automations.pause and automations.resume.
  4. Start a run with automations.createRun and follow it with automations.getRun and automations.listRuns.
  5. Remove it with automations.delete.

Methods

MethodHTTPSummary
automations.listGET /v1/automationsList automations
automations.createPOST /v1/automationsCreate an automation
automations.getGET /v1/automations/{automationId}Get an automation
automations.updatePATCH /v1/automations/{automationId}Update an automation
automations.deleteDELETE /v1/automations/{automationId}Delete an automation
automations.pausePOST /v1/automations/{automationId}/pausePause an automation
automations.resumePOST /v1/automations/{automationId}/resumeResume an automation
automations.listRunsGET /v1/automations/{automationId}/runsList automation runs
automations.createRunPOST /v1/automations/{automationId}/runsStart an automation run
automations.getRunGET /v1/automations/{automationId}/runs/{runId}Get an automation run
automations.createWebhookPOST /v1/automations/webhooksCreate a webhook automation

automations.list

GET /v1/automations · Operation ID listAutomations

List automations

SDK methods

LanguageMethodSignature
TypeScriptcloud.automations.listlist(query?: Models.ListAutomationsQuery): Promise<Models.ListAutomationsResponse>
Pythoncloud.automations.listdef list(self, options: ListAutomationsOptions | None = None) -> ListAutomationsResponse
Gocloud.Automations.Listfunc (r *AutomationsResource) List(ctx context.Context, options ListAutomationsOptions) (ListAutomationsResponse, error)

Parameters

ParameterInTypeRequiredDescription
statusquerystringnoReturn only automations in this state: enabled, paused or expired.
cursorquerystringnoCursor from nextCursor of the previous page. Omit it to get the first page.
limitqueryintegernoMaximum number of automations to return in one page, 1 or more, up to the server maximum (at most 1000). Larger values are rejected with 400 invalid_argument. Defaults to 20.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataProtoListAutomationsResponseyes—

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.automations.list();
console.log(result);

automations.create

POST /v1/automations · Operation ID createAutomation

Create an automation

SDK methods

LanguageMethodSignature
TypeScriptcloud.automations.createcreate(input: Models.ProtoAutomationInput): Promise<Models.CreateAutomationResponse>
Pythoncloud.automations.createdef create(self, input: ProtoAutomationInput) -> CreateAutomationResponse
Gocloud.Automations.Createfunc (r *AutomationsResource) Create(ctx context.Context, input ProtoAutomationInput) (CreateAutomationResponse, error)

Request body

application/json · required · Schema: ProtoAutomationInput

FieldTypeRequiredDescription
namestringnoDisplay name of the automation, 1 to 256 characters and not blank.
promptstringnoText sent to the agent on every run, up to 65536 bytes and not blank.
targetProtoAutomationTargetnoAgent the prompt is sent to. Required.
scheduleProtoAutomationSchedulenoWhen the automation runs. Required.
sessionProtoAutomationSessionnoNot accepted by this API: a request that includes it fails with 400 invalid_argument. Automations created here open a new conversation for every run.
validFromstringnoEarliest time a run may start, as an RFC 3339 timestamp, inclusive. Omit it for no lower bound. It must not be after validUntil. Constraints: format=date-time.
validUntilstringnoLatest time a run may start, as an RFC 3339 timestamp, inclusive. Omit it for no upper bound. After it the automation becomes expired. Constraints: format=date-time.
createdInConversationIdstringnoID of the conversation the automation is created from, if any. It must be a conversation of the same end user.

Response

201 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataProtoAutomationRuleyes—

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.automations.create({});
console.log(result);

automations.get

GET /v1/automations/{automationId} · Operation ID getAutomation

Get an automation

SDK methods

LanguageMethodSignature
TypeScriptcloud.automations.getget(automationId: string): Promise<Models.GetAutomationResponse>
Pythoncloud.automations.getdef get(self, automation_id: str) -> GetAutomationResponse
Gocloud.Automations.Getfunc (r *AutomationsResource) Get(ctx context.Context, automationId string) (GetAutomationResponse, error)

Parameters

ParameterInTypeRequiredDescription
automationIdpathstringyesID of the automation, the id returned when it was created.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataJSONValueyesA genuinely open JSON value (provider/plugin parameters or arbitrary metadata). Nullable.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.automations.get("automation_123");
console.log(result);

automations.update

PATCH /v1/automations/{automationId} · Operation ID updateAutomation

Update an automation

SDK methods

LanguageMethodSignature
TypeScriptcloud.automations.updateupdate(automationId: string, input: Models.ProtoAutomationPatch): Promise<Models.UpdateAutomationResponse>
Pythoncloud.automations.updatedef update(self, automation_id: str, input: ProtoAutomationPatch) -> UpdateAutomationResponse
Gocloud.Automations.Updatefunc (r *AutomationsResource) Update(ctx context.Context, automationId string, input ProtoAutomationPatch) (UpdateAutomationResponse, error)

Parameters

ParameterInTypeRequiredDescription
automationIdpathstringyesID of the automation, the id returned when it was created.

Request body

application/json · required · Schema: ProtoAutomationPatch

FieldTypeRequiredDescription
namestringnoNew display name, 1 to 256 characters and not blank.
promptstringnoNew prompt sent to the agent on every run, up to 65536 bytes and not blank.
targetProtoAutomationTargetnoNew agent the prompt is sent to.
scheduleProtoAutomationSchedulenoNew schedule. It replaces the whole schedule, so send every field the kind needs, including anchorAt for every.
sessionProtoAutomationSessionnoNot accepted by this API: a request that includes it fails with 400 invalid_argument.
validFromstringnoNew earliest time a run may start, as an RFC 3339 timestamp, inclusive. Cannot be combined with clearValidFrom. Constraints: format=date-time.
validUntilstringnoNew latest time a run may start, as an RFC 3339 timestamp, inclusive. Cannot be combined with clearValidUntil. Constraints: format=date-time.
clearValidFrombooleannoSet to true to remove the lower bound of the validity period. Cannot be combined with validFrom.
clearValidUntilbooleannoSet to true to remove the upper bound of the validity period. Cannot be combined with validUntil.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataProtoAutomationRuleyes—

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.automations.update("automation_123", {});
console.log(result);

automations.delete

DELETE /v1/automations/{automationId} · Operation ID deleteAutomation

Delete an automation

SDK methods

LanguageMethodSignature
TypeScriptcloud.automations.deletedelete(automationId: string): Promise<Models.DeleteAutomationResponse>
Pythoncloud.automations.deletedef delete(self, automation_id: str) -> None
Gocloud.Automations.Deletefunc (r *AutomationsResource) Delete(ctx context.Context, automationId string) error

Parameters

ParameterInTypeRequiredDescription
automationIdpathstringyesID of the automation, the id returned when it was created.

Response

204

No response body.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.automations.delete("automation_123");
console.log(result);

automations.pause

POST /v1/automations/{automationId}/pause · Operation ID pauseAutomation

Pause an automation

SDK methods

LanguageMethodSignature
TypeScriptcloud.automations.pausepause(automationId: string): Promise<Models.PauseAutomationResponse>
Pythoncloud.automations.pausedef pause(self, automation_id: str) -> PauseAutomationResponse
Gocloud.Automations.Pausefunc (r *AutomationsResource) Pause(ctx context.Context, automationId string) (PauseAutomationResponse, error)

Parameters

ParameterInTypeRequiredDescription
automationIdpathstringyesID of the automation, the id returned when it was created.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataJSONValueyesA genuinely open JSON value (provider/plugin parameters or arbitrary metadata). Nullable.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.automations.pause("automation_123");
console.log(result);

automations.resume

POST /v1/automations/{automationId}/resume · Operation ID resumeAutomation

Resume an automation

SDK methods

LanguageMethodSignature
TypeScriptcloud.automations.resumeresume(automationId: string): Promise<Models.ResumeAutomationResponse>
Pythoncloud.automations.resumedef resume(self, automation_id: str) -> ResumeAutomationResponse
Gocloud.Automations.Resumefunc (r *AutomationsResource) Resume(ctx context.Context, automationId string) (ResumeAutomationResponse, error)

Parameters

ParameterInTypeRequiredDescription
automationIdpathstringyesID of the automation, the id returned when it was created.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataJSONValueyesA genuinely open JSON value (provider/plugin parameters or arbitrary metadata). Nullable.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.automations.resume("automation_123");
console.log(result);

automations.listRuns

GET /v1/automations/{automationId}/runs · Operation ID listAutomationRuns

List automation runs

SDK methods

LanguageMethodSignature
TypeScriptcloud.automations.listRunslistRuns(automationId: string, query?: Models.ListAutomationRunsQuery): Promise<Models.ListAutomationRunsResponse>
Pythoncloud.automations.list_runsdef list_runs(self, automation_id: str, options: ListAutomationRunsOptions | None = None) -> ListAutomationRunsResponse
Gocloud.Automations.ListRunsfunc (r *AutomationsResource) ListRuns(ctx context.Context, automationId string, options ListAutomationRunsOptions) (ListAutomationRunsResponse, error)

Parameters

ParameterInTypeRequiredDescription
automationIdpathstringyesID of the automation, the id returned when it was created.
statusquerystringnoReturn only runs in this state: scheduled, dispatched, failed or skipped.
cursorquerystringnoCursor from nextCursor of the previous page. Omit it to get the first page.
limitqueryintegernoMaximum number of runs to return in one page, 1 or more, up to the server maximum (at most 1000). Larger values are rejected with 400 invalid_argument. Defaults to 20.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataProtoListAutomationRunsResponseyes—

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.automations.listRuns("automation_123");
console.log(result);

automations.createRun

POST /v1/automations/{automationId}/runs · Operation ID createAutomationRun

Start an automation run

SDK methods

LanguageMethodSignature
TypeScriptcloud.automations.createRuncreateRun(automationId: string, input: Models.ProtoAutomationRunInput, idempotencyKey: string): Promise<Models.CreateAutomationRunResponse>
Pythoncloud.automations.create_rundef create_run(self, automation_id: str, input: ProtoAutomationRunInput, options: CreateAutomationRunOptions) -> CreateAutomationRunResponse
Gocloud.Automations.CreateRunfunc (r *AutomationsResource) CreateRun(ctx context.Context, automationId string, input ProtoAutomationRunInput, options CreateAutomationRunOptions) (CreateAutomationRunResponse, error)

Parameters

ParameterInTypeRequiredDescription
automationIdpathstringyesID of the automation, the id returned when it was created.
Idempotency-KeyheaderstringyesKey that makes the request safe to retry, 1 to 128 bytes and not blank. Repeating a request with the same key and body returns the original run; reusing the key for a different request returns 409 idempotency_conflict.

Request body

application/json · required · Schema: ProtoAutomationRunInput

FieldTypeRequiredDescription
sourceRunIdstringnoID of an earlier run of the same automation to repeat. Send it together with rerunSessionMode, or send neither for a plain manual run.
rerunSessionModestringnoWhich conversation the rerun is delivered into. Required when sourceRunId is sent and not allowed without it. Allowed values: "original" — The conversation the source run was delivered into; "new" — A new conversation. (enum table)

Response

202 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataProtoAutomationRunyes—

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.automations.createRun("automation_123", {}, "YOUR_IDEMPOTENCY_KEY");
console.log(result);

automations.getRun

GET /v1/automations/{automationId}/runs/{runId} · Operation ID getAutomationRun

Get an automation run

SDK methods

LanguageMethodSignature
TypeScriptcloud.automations.getRungetRun(automationId: string, runId: string): Promise<Models.GetAutomationRunResponse>
Pythoncloud.automations.get_rundef get_run(self, automation_id: str, run_id: str) -> GetAutomationRunResponse
Gocloud.Automations.GetRunfunc (r *AutomationsResource) GetRun(ctx context.Context, automationId string, runId string) (GetAutomationRunResponse, error)

Parameters

ParameterInTypeRequiredDescription
automationIdpathstringyesID of the automation, the id returned when it was created.
runIdpathstringyesID of the run, the id returned when the run was created or listed.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataProtoAutomationRunyes—

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.automations.getRun("automation_123", "run_123");
console.log(result);

automations.createWebhook

POST /v1/automations/webhooks · Operation ID createWebhookAutomation

Create a webhook automation

SDK methods

LanguageMethodSignature
TypeScriptcloud.automations.createWebhookcreateWebhook(input: Models.ProtoAutomationWebhookInput): Promise<Models.CreateWebhookAutomationResponse>
Pythoncloud.automations.create_webhookdef create_webhook(self, input: ProtoAutomationWebhookInput) -> CreateWebhookAutomationResponse
Gocloud.Automations.CreateWebhookfunc (r *AutomationsResource) CreateWebhook(ctx context.Context, input ProtoAutomationWebhookInput) (CreateWebhookAutomationResponse, error)

Request body

application/json · required · Schema: ProtoAutomationWebhookInput

FieldTypeRequiredDescription
namestringnoDisplay name of the automation, 1 to 256 characters and not blank.
promptstringnoText sent to the agent on every run, up to 65536 bytes and not blank.
targetProtoAutomationTargetnoAgent the prompt is sent to. Required.
sessionProtoAutomationSessionnoNot accepted by this API: a request that includes it fails with 400 invalid_argument. Automations created here open a new conversation for every run.
validFromstringnoEarliest time a run may start, as an RFC 3339 timestamp, inclusive. Omit it for no lower bound. Constraints: format=date-time.
validUntilstringnoLatest time a run may start, as an RFC 3339 timestamp, inclusive. Omit it for no upper bound. Constraints: format=date-time.
createdInConversationIdstringnoID of the conversation the automation is created from, if any. It must be a conversation of the same end user.
sourcestringnoPlatform that sends the events, for example github or gmail, at most 64 characters without whitespace. The agent must have the matching connector set up. Required.
eventsarray<string>noNames of the events to subscribe to at the source, for example the GitHub event types the repository should deliver.
repoOwnerstringnoOwner of the repository to watch. Required when source is github.
repoNamestringnoName of the repository to watch. Required when source is github.
eventFilterstringnoEvent type that starts a run. When set, only events of exactly this type start a run; others are skipped. Empty accepts every event.
mailboxstringnoGmail address to watch. Required when source is gmail; leave empty for other sources.

Response

201 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataProtoAutomationRuleyes—

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.automations.createWebhook({});
console.log(result);