> For the complete documentation index, see [llms.txt](https://docs.ibexa.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ibexa.ai/developers/rest-api/triggers/create-trigger.md).

# Create Trigger

Create a new trigger bound to an agent.

The agent must exist within the caller's organisation. Scheduler-type triggers are automatically registered with Celery Beat.

`config` is validated against the definition's `config_schema`, available from `GET /triggers/definitions`. Note that a scheduler `day_of_month` is NOT checked against the target month: a day the month is too short for means "that month's last day", so 31 is how you say "the last day", and `month=2, day_of_month=31` is accepted and runs on 28/29 February rather than being rejected.

```json
{"openapi":"3.1.0","info":{"title":"Ibexa Agentic Marketing Platform","version":"0.1.0"},"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/v1/login/access-token"}}}},"schemas":{"CreateTriggerPayloadSchema":{"properties":{"agent_id":{"type":"integer","title":"Agent Id"},"definition_id":{"type":"string","format":"uuid","title":"Definition Id"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"agent_args":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Agent Args"}},"type":"object","required":["agent_id","definition_id","config"],"title":"CreateTriggerPayloadSchema","description":"Request schema for creating a trigger."},"TriggerResponseSchema":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organisation_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Organisation Id"},"agent_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agent Id"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"definition_id":{"type":"string","format":"uuid","title":"Definition Id"},"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["id","organisation_id","agent_id","created_by","definition_id","config"],"title":"TriggerResponseSchema","description":"Response schema for a trigger."}}},"paths":{"/api/v1/triggers/":{"post":{"tags":["triggers","public"],"summary":"Create Trigger","description":"Create a new trigger bound to an agent.\n\nThe agent must exist within the caller's organisation. Scheduler-type\ntriggers are automatically registered with Celery Beat.\n\n`config` is validated against the definition's `config_schema`, available\nfrom `GET /triggers/definitions`. Note that a scheduler `day_of_month` is\nNOT checked against the target month: a day the month is too short for\nmeans \"that month's last day\", so 31 is how you say \"the last day\", and\n`month=2, day_of_month=31` is accepted and runs on 28/29 February rather\nthan being rejected.","operationId":"triggers-create_trigger","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTriggerPayloadSchema"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerResponseSchema"}}}},"400":{"description":"Invalid request payload or parameters","content":{"application/json":{}}},"401":{"description":"User not authenticated","content":{"application/json":{}}},"403":{"description":"User lacks permission","content":{"application/json":{}}},"404":{"description":"Resource not found or user has no permission to access it","content":{"application/json":{}}}}}}}}
```
