loops
loops

Create a loop

API for managing loops — named, cloud-executed agent automations triggered by schedule, GitHub events or authenticated API calls.

post/api/projects/{project_id}/loops/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/loops/
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request body

namestring required

Display name for the loop.

descriptionstring

Free-form description of what this loop does.

take_ownershipboolean

On a team loop, claim ownership as part of this update so you can edit identity-bearing config (instructions, model, triggers, ...) that only the owner may change. Ignored on personal loops and on create.

visibility'personal' | 'team'
  • personal - personal
  • team - team
instructionsstring required

The prompt delivered to the agent on every run.

runtime_adapter'claude' | 'codex' required
  • claude - claude
  • codex - codex
modelstring

LLM model identifier, validated against runtime_adapter's catalog. Leave blank to let PostHog pick a sensible default at run time.

sandbox_environmentstring uuid nullable

Sandbox environment carrying encrypted env vars and the network allowlist into every run.

enabledboolean

Whether the loop's triggers are active. Pausing disables all triggers.

overlap_policy'skip' | 'allow' | 'cancel_previous'
  • skip - skip
  • allow - allow
  • cancel_previous - cancel_previous

Response

idstring uuid required
team_idinteger required
created_by_idinteger nullable required
namestring required
descriptionstring required
visibilitystring required
instructionsstring required
runtime_adapterstring required
modelstring required
reasoning_effortstring nullable required
sandbox_environment_idstring uuid nullable required
enabledboolean required
disabled_reasonstring nullable required
overlap_policystring required
internalboolean required
origin_productstring required
last_run_atstring date-time nullable required
last_run_statusstring nullable required
last_errorstring nullable required
consecutive_failuresinteger required
created_atstring date-time required
updated_atstring date-time required

Changes

No recorded changes to this operation across all 1 revision of this API.