# runWebhook

```graphql
mutation RunWebhook($input: RunWebhookInput!) {
  runWebhook(input: $input) {
    id
    webhookId
    projectId
    conversationId
    messageId
    runId
    canonicalRunId
    latestEventId
    status
    duplicate
    payload
    errorCode
    errorMessage
    invokedBy
    manualInvokedByUserId
    receivedAt
    completedAt
  }
}
```

Send a test payload to a webhook as an external sender posts it, to check its target and filter, also when the webhook is a draft or disabled; returns the webhook event that the call created.

## Arguments

| Name                     | Type             | Required | Description                                                                                                                                                                                                                                                                                        |
| ------------------------ | ---------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input`                  | RunWebhookInput! | Yes      |                                                                                                                                                                                                                                                                                                    |
| `input.projectReference` | String           |          |                                                                                                                                                                                                                                                                                                    |
| `input.id`               | ID!              | Yes      | Webhook definition ID. Task and workflow targets accept a project-execution credential that carries native source authority from project.runs.write instead of project.agents.write. Agent targets require project.agents.write, plus project.conversations.write for conversation-backed targets. |
| `input.payload`          | JSON             |          |                                                                                                                                                                                                                                                                                                    |

## Variables

```json
{
  "input": {
    "id": "string"
  }
}
```

## Responses

| Status | Description                               |
| ------ | ----------------------------------------- |
| 200    | The WebhookRunResult! in data.runWebhook. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation RunWebhook($input: RunWebhookInput!) {\n  runWebhook(input: $input) {\n    id\n    webhookId\n    projectId\n    conversationId\n    messageId\n    runId\n    canonicalRunId\n    latestEventId\n    status\n    duplicate\n    payload\n    errorCode\n    errorMessage\n    invokedBy\n    manualInvokedByUserId\n    receivedAt\n    completedAt\n  }\n}",
  "variables": {
    "input": {
      "id": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "runWebhook": {
      "id": "string",
      "webhookId": "string",
      "projectId": "string",
      "conversationId": "string",
      "messageId": "string",
      "runId": "string",
      "canonicalRunId": "string",
      "latestEventId": 0,
      "status": "string",
      "duplicate": false,
      "payload": {},
      "errorCode": "string",
      "errorMessage": "string",
      "invokedBy": "string",
      "manualInvokedByUserId": "string",
      "receivedAt": "string",
      "completedAt": "string"
    }
  }
}
```
