> ## Documentation Index
> Fetch the complete documentation index at: https://cobalt-55-abhishek.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Trigger Event

> Fire a custom event for a linked account to start workflows.

Fire a custom event for a linked account. Refold validates the event exists on your default custom app, optionally validates auth on a named app slug, then enqueues the event for asynchronous workflow execution. The call returns synchronously once the event is queued.

## Authentication

This endpoint fires for a specific linked account, so it accepts **either** authentication method.

**Option 1 — API key**

<ParamField header="x-api-key" type="string">
  Your Refold API key.
</ParamField>

<ParamField header="linked_account_id" type="string">
  The linked account the event fires for.
</ParamField>

**Option 2 — Session token**

<ParamField header="Authorization" type="string">
  Session token for the linked account.

  **Format:** `Bearer YOUR_SESSION_TOKEN`
</ParamField>

## Headers

<ParamField header="slug" type="string">
  Optional app slug to validate auth against before firing.
</ParamField>

<ParamField header="config_id" type="string">
  Optional config to scope the trigger to.
</ParamField>

<ParamField header="instance_tag" type="string">
  Optional tag to label the resulting execution.
</ParamField>

## Body Parameters

<ParamField body="event" type="string" required>
  The event name to fire. (Either `event` or `trigger` must be provided.)
</ParamField>

<ParamField body="trigger" type="string">
  Alias for `event`.
</ParamField>

<ParamField body="payload" type="object">
  Arbitrary JSON payload passed to the workflow.
</ParamField>

## Response

<Tabs>
  <Tab title="200 OK">
    <ResponseField name="message" type="string">Confirmation that the event was queued.</ResponseField>
  </Tab>

  <Tab title="404 Not Found">
    Returned when the named event does not exist on the default app.
    <ResponseField name="status_code" type="integer">HTTP status code.</ResponseField>
    <ResponseField name="http_error_type" type="string">Error category.</ResponseField>
    <ResponseField name="error_code" type="string">Internal error code, e.g. `INVALID_EVENT`.</ResponseField>
    <ResponseField name="message" type="string">Human-readable error description.</ResponseField>
  </Tab>
</Tabs>

<ResponseExample>
  ```json 200 theme={null}
  {
    "message": "Webhook Fired Success"
  }
  ```

  ```json 404 theme={null}
  {
    "status_code": 404,
    "http_error_type": "NOT_FOUND",
    "error_code": "INVALID_EVENT",
    "message": "Trigger not found"
  }
  ```
</ResponseExample>

<RequestExample>
  ```bash cURL (API key) theme={null}
  curl -X POST "https://app.refold.ai/api/v2/public/event/trigger" \
    -H "x-api-key: YOUR_API_KEY" \
    -H "linked_account_id: YOUR_LINKED_ACCOUNT_ID" \
    -H "Content-Type: application/json" \
    -d '{
      "event": "candidate_created",
      "payload": { "jobid": "123", "email": "jane@example.com" }
    }'
  ```

  ```bash cURL (session token) theme={null}
  curl -X POST "https://app.refold.ai/api/v2/public/event/trigger" \
    -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "event": "candidate_created",
      "payload": { "jobid": "123" }
    }'
  ```
</RequestExample>
