NylorunDocsBeta
Runtime APIAgentsTriggers

Put a trigger on an Agent

PUT
/v1/agents/{agentId}/triggers/{triggerId}

Creates or replaces the Agent's trigger triggerId of origin api: a Trigger exactly as a definition's runtime.triggers entry holds it (one of schedule with timezone, at or webhook; session; prompt), and an optional title. A new one is active with its next time; a replaced one gets its next time again and keeps its status, so a paused one stays paused. The same body again changes nothing and records no event. The checks and limits are a definition's; runtime.limits.triggers.count covers the triggers the Agent's agents made and those put here. Upgrades never touch it; DELETE removes it. Records agent.trigger_created or agent.trigger_updated (with changed) on the Agent's events. Host feature api-triggers.

Authorization

headerAuthorizationBearer <token>

An application key of the Tenant (PUT /v1/tenant/keys/{keyId}), or Studio's key, derived from the admin key. With Nylorun-Subject and Nylorun-Scopes, it acts for that person, narrowed to those scopes. Never accepted from a browser (Origin).

Path Parameters

agentId*string

The Agent id, percent-encoded

triggerId*string

The trigger's id: in the manifest's runtime.triggers, or the one its agent gave it

Header Parameters

Nylorun-Protocol*string

The protocol version, 18

Nylorun-Subject?string

The person an application key acts for

Nylorun-Scopes?string

The subject's space-separated scopes; required with a subject

Request Body

application/json
  1. body
schedule?string
Match^\S+(\s+\S+){4}$
timezone?string
Length1 <= length
at?string
Formatdate-time
webhook?"standard-webhooks"
Value in"standard-webhooks"
session*string
Length1 <= length <= 200
prompt*string
Length1 <= length
title?string
Length1 <= length <= 80

Response Body

The trigger, as the list shows it

application/json
  1. response
id*string
kind*string
Value in"schedule""at""webhook""wake"
origin*string
Value in"manifest""agent""api""wake"
title*string|null
createdSessionId*string|null
principal?string|null
status*string
Value in"active""paused""completed"
pausedReason*string|null
schedule?string
timezone?string
at?string
session*string
nextRunAt*string|null
lastRunAt*string|null
webhookUrl?string
secretSet?boolean
prompt?string
curl -X PUT "https://example.com/v1/agents/string/triggers/string" \  -H "Nylorun-Protocol: string" \  -H "Content-Type: application/json" \  -d '{    "session": "string",    "prompt": "string"  }'
{  "id": "string",  "kind": "schedule",  "origin": "manifest",  "title": "string",  "createdSessionId": "string",  "principal": "string",  "status": "active",  "pausedReason": "string",  "schedule": "string",  "timezone": "string",  "at": "string",  "session": "string",  "nextRunAt": "string",  "lastRunAt": "string",  "webhookUrl": "string",  "secretSet": true,  "prompt": "string"}