# Retrieve a trigger

`GET https://api.cademi.com.br/api/v3/automations/diamond/{diamond_id}/triggers/{trigger_id}`

Operation ID: `diamonds.triggers.get` · API v3

Retrieves a trigger of the Diamond. The destination is masked in the response.

The response includes an `ETag` representing the current revision. Send this value in the `If-Match` header when updating the trigger to avoid overwriting a newer version.

Only triggers that belong to the Diamond in the path can be retrieved.

Required permissions: `diamonds.read`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `diamond_id` | path | string | yes |  |
| `trigger_id` | path | string | yes |  |

## Responses

### 200

Returns the requested trigger.

Body: `data`: Trigger.

Fields of Trigger:

| Field | Type | Required | Description |
|---|---|---|---|
| `channel` | string, one of `http`, `whatsapp`, `sms`, `email` | yes |  |
| `created_at` | string (date-time) | yes |  |
| `destination` | object or null | yes | Masked destination: the URL host or the last digits of the phone number. |
| `diamond_id` | string | yes | Public ID of the Diamond, with the dmd_ prefix. |
| `enabled` | boolean | yes |  |
| `event_type` | string | yes | Event type delivered to automations, in the form spyhub.diamond.{stage}. |
| `id` | string | yes | Public ID, with the trg_ prefix. |
| `object` | string, one of `trigger` | yes |  |
| `revision` | string | yes |  |
| `stage_id` | string | yes | Stage of the trigger. |
| `updated_at` | string (date-time) | yes |  |

### 401

The credential is missing, malformed, expired, or revoked.

Body: Error.

### 403

The current credentials do not have the permission required by this operation.

Body: Error.

### 404

The trigger was not found in this Diamond or is not accessible with the current credentials.

Body: Error.

### 409

Diamond automations are not enabled for the current account.

Body: Error.

Full schema: https://cademi.dev/openapi/v3.json
