---
title: "Run a trigger"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Run a trigger

Path: CloudRaker Workspace API › Workspace Triggers

`POST /triggers/{triggerId}/fire`

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `triggerId` (`fireTrigger.path.triggerId`; string, required)
  - maxLength 128; pattern `^trg_[A-Za-z0-9_-]+$`

## Request body

_Required._

- `requestId` (`fireTrigger.requestId`; string, required)
  - minLength 1; maxLength 200
- `input` (`fireTrigger.input`; map<unknown>, optional)

## Example request

```json
{
  "requestId": "string",
  "input": {
    "property1": null,
    "property2": null
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/triggers/<triggerId>/fire' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "requestId": "string",
  "input": {
    "property1": null,
    "property2": null
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/triggers/<triggerId>/fire';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({requestId: 'string', input: {property1: null, property2: null}})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/triggers/<triggerId>/fire"

payload = {
    "requestId": "string",
    "input": {
        "property1": None,
        "property2": None
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

The existing delivery outcome.

#### Example

```json
{
  "data": {
    "status": "queued",
    "sessionId": "string",
    "message": "string",
    "deliveryId": "string"
  }
}
```

- `data` (`fireTrigger.response.200.data`; object, required)
  - `status` (`fireTrigger.response.200.data.status`; string, required)
    - one of `"queued"`, `"opened"`, `"busy"`, `"needs_input"`, `"blocked"`, `"error"`
  - `deliveryId` (`fireTrigger.response.200.data.deliveryId`; string, required)
  - `sessionId` (`fireTrigger.response.200.data.sessionId`; string, optional)
    - minLength 1; maxLength 128
  - `message` (`fireTrigger.response.200.data.message`; string, optional)
    - maxLength 1000

### 202

The queued delivery.

#### Example

```json
{
  "data": {
    "status": "queued",
    "sessionId": "string",
    "message": "string",
    "deliveryId": "string"
  }
}
```

- `data` (`fireTrigger.response.202.data`; object, required)
  - `status` (`fireTrigger.response.202.data.status`; string, required)
    - one of `"queued"`, `"opened"`, `"busy"`, `"needs_input"`, `"blocked"`, `"error"`
  - `deliveryId` (`fireTrigger.response.202.data.deliveryId`; string, required)
  - `sessionId` (`fireTrigger.response.202.data.sessionId`; string, optional)
    - minLength 1; maxLength 128
  - `message` (`fireTrigger.response.202.data.message`; string, optional)
    - maxLength 1000

### 400

`validation_failed`: a request parameter or body field is invalid.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`fireTrigger.response.400.error`; string, required) — The sentence a human reads.
- `error_code` (`fireTrigger.response.400.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`fireTrigger.response.400.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`fireTrigger.response.400.issues.path`; string, required)
  - `code` (`fireTrigger.response.400.issues.code`; string, required)
  - `message` (`fireTrigger.response.400.issues.message`; string, required)

### 402

`credits_exhausted` — the organization has no run credit left.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`fireTrigger.response.402.error`; string, required) — The sentence a human reads.
- `error_code` (`fireTrigger.response.402.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`fireTrigger.response.402.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`fireTrigger.response.402.issues.path`; string, required)
  - `code` (`fireTrigger.response.402.issues.code`; string, required)
  - `message` (`fireTrigger.response.402.issues.message`; string, required)

### 403

`run_as_inactive` — the executing member is not active in this organization.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`fireTrigger.response.403.error`; string, required) — The sentence a human reads.
- `error_code` (`fireTrigger.response.403.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`fireTrigger.response.403.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`fireTrigger.response.403.issues.path`; string, required)
  - `code` (`fireTrigger.response.403.issues.code`; string, required)
  - `message` (`fireTrigger.response.403.issues.message`; string, required)

### 404

`space_not_found` — a named space does not exist or the executing member may not contribute to it; `agent_not_found` — a named agent does not exist.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`fireTrigger.response.404.error`; string, required) — The sentence a human reads.
- `error_code` (`fireTrigger.response.404.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`fireTrigger.response.404.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`fireTrigger.response.404.issues.path`; string, required)
  - `code` (`fireTrigger.response.404.issues.code`; string, required)
  - `message` (`fireTrigger.response.404.issues.message`; string, required)

### 409

`trigger_conflict` — that webhook address or email address is already used in this organization, or a channel key rotation is unsettled; `trigger_limit` — 50 enabled triggers is the maximum; `trigger_migration_in_progress` — a legacy transfer still owns this source.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`fireTrigger.response.409.error`; string, required) — The sentence a human reads.
- `error_code` (`fireTrigger.response.409.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`fireTrigger.response.409.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`fireTrigger.response.409.issues.path`; string, required)
  - `code` (`fireTrigger.response.409.issues.code`; string, required)
  - `message` (`fireTrigger.response.409.issues.message`; string, required)

### 422

`agent_not_published` — a named agent has no published version.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`fireTrigger.response.422.error`; string, required) — The sentence a human reads.
- `error_code` (`fireTrigger.response.422.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`fireTrigger.response.422.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`fireTrigger.response.422.issues.path`; string, required)
  - `code` (`fireTrigger.response.422.issues.code`; string, required)
  - `message` (`fireTrigger.response.422.issues.message`; string, required)


Source: https://docs.cloudraker.com/workspace/api/workspace-triggers/fire-trigger/index.md
