Submit an API trigger
const url = 'https://api.gopromptless.ai/triggers';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"instructions":"Document the new rate limiting feature added in v2.5","context":{"jira_ticket":"DOC-456","release":"v2.5.0"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.gopromptless.ai/triggers \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "instructions": "Document the new rate limiting feature added in v2.5", "context": { "jira_ticket": "DOC-456", "release": "v2.5.0" } }'Request a documentation update. Authenticate with your organization’s API key as a bearer token. A successful request returns the identifier of the trigger event.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”JSON request body for API-triggered task intake.
object
What you want Promptless to document. Be specific about which docs to update and what changes to make.
Optional arbitrary metadata to attach to the request. Appears in trigger history for reference and is passed through to the workflow as additional context.
object
Responses
Section titled “Responses”The trigger was accepted and enqueued for processing.
Response body returned when an API trigger is accepted for processing.
object
Identifier of the trigger event. Use it to correlate with trigger history.
Example
{ "trigger_event_id": "550e8400-e29b-41d4-a716-446655440000"}The API key is missing, invalid, or revoked.
Error body returned when an API trigger request is rejected.
object
Stable machine-readable error code.
Human-readable explanation of the error.
Example
{ "error": "authentication_failed", "message": "Authentication failed."}The organization has not finished setting up Promptless (org_not_configured), or the requested doc collection is not configured or not ready (no_eligible_doc_collection).
Error body returned when an API trigger request is rejected.
object
Stable machine-readable error code.
Human-readable explanation of the error.
Example
{ "error": "authentication_failed", "message": "Authentication failed."}The request body is invalid (e.g. empty instructions or a malformed UUID).
Validation error body returned when the request fails schema validation.
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}The trigger could not be enqueued for processing (enqueue_failed).
Error body returned when an API trigger request is rejected.
object
Stable machine-readable error code.
Human-readable explanation of the error.
Example
{ "error": "authentication_failed", "message": "Authentication failed."}Trigger intake is temporarily unavailable (runtime_store_unavailable).
Error body returned when an API trigger request is rejected.
object
Stable machine-readable error code.
Human-readable explanation of the error.
Example
{ "error": "authentication_failed", "message": "Authentication failed."}