# replayWebhookEvent

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

Send the stored payload of a webhook event to the current target of the webhook again, for example after a failed run; returns the new webhook event that the replay created.

## Arguments

| Name                     | Type                     | Required | Description                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------ | ------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `input`                  | ReplayWebhookEventInput! | 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.webhookEventId`   | ID!                      | Yes      | Stored delivery to replay: a new webhook event is created from its payload and run through the webhook target. 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. |

## Variables

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

## Responses

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

## 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 ReplayWebhookEvent($input: ReplayWebhookEventInput!) {\n  replayWebhookEvent(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",
      "webhookEventId": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "replayWebhookEvent": {
      "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"
    }
  }
}
```
