# Test webhook


```
POST 
https://api.apify.com/v2/webhooks/:webhookId/test
```


Tests a webhook. Creates a webhook dispatch with a dummy payload.

## Request

### Path Parameters

* **webhookId** string required

  Webhook ID.

  **Example:** `pVJtoTelgYUq4qJOt`

<!-- -->

### Status 201

**Response Headers**




```
{
  "data": {
    "id": "asdLZtadYvn4mBZmm",
    "userId": "wRsJZtadYvn4mBZmm",
    "webhookId": "asdLZtadYvn4mBZmm",
    "createdAt": "2019-12-12T07:34:14.202Z",
    "status": "ACTIVE",
    "eventType": "ACTOR.BUILD.ABORTED",
    "eventData": "Unknown Type: object,null",
    "calls": [
      {
        "startedAt": "2019-12-12T07:34:14.202Z",
        "finishedAt": "2019-12-12T07:34:14.202Z",
        "errorMessage": "Cannot send request",
        "responseStatus": 200,
        "responseBody": "{\"foo\": \"bar\"}"
      }
    ]
  }
}
```


**Schema**

* **data** object required

  * **id** string required\
    **Example:** `asdLZtadYvn4mBZmm`

  * **userId** string required\
    **Example:** `wRsJZtadYvn4mBZmm`

  * **webhookId** string required\
    **Example:** `asdLZtadYvn4mBZmm`

  * **createdAt** string\<date-time> required\
    **Example:** `2019-12-12T07:34:14.202Z`

  * **status** WebhookDispatchStatus (string) required

    Status of the webhook dispatch indicating whether the HTTP request was successful.

    **Possible values:** \[`ACTIVE`, `SUCCEEDED`, `FAILED`]

  * **eventType** WebhookEventType (string) required

    Type of event that triggers the webhook.

    **Possible values:** \[`ACTOR.BUILD.ABORTED`, `ACTOR.BUILD.CREATED`, `ACTOR.BUILD.FAILED`, `ACTOR.BUILD.SUCCEEDED`, `ACTOR.BUILD.TIMED_OUT`, `ACTOR.RUN.ABORTED`, `ACTOR.RUN.CREATED`, `ACTOR.RUN.FAILED`, `ACTOR.RUN.RESURRECTED`, `ACTOR.RUN.SUCCEEDED`, `ACTOR.RUN.TIMED_OUT`, `TEST`]

  * **eventData** eventData (object,null)

    * **actorId** string required\
      **Example:** `vvE7iMKuMc5qTHHsR`
    * **actorRunId** string required\
      **Example:** `JgwXN9BdwxGcu9MMF`

  * **calls** object\[]

    * **startedAt** string,null\<date-time> nullable\
      **Example:** `2019-12-12T07:34:14.202Z`
    * **finishedAt** string,null\<date-time> nullable\
      **Example:** `2019-12-12T07:34:14.202Z`
    * **errorMessage** string | null nullable\
      **Example:** `Cannot send request`
    * **responseStatus** integer | null nullable\
      **Example:** `200`
    * **responseBody** string | null nullable\
      **Example:** `{"foo": "bar"}`

### Status 400

Bad request - invalid input parameters or request body.


```
{
  "error": {
    "type": "invalid-input",
    "message": "Invalid input: The request body contains invalid data."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 401

Unauthorized - authentication required or invalid token.


```
{
  "error": {
    "type": "token-not-valid",
    "message": "Authentication token is not valid."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 403

Forbidden - insufficient permissions to perform this action.


```
{
  "error": {
    "type": "permission-denied",
    "message": "You do not have permission to perform this action."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 404

Not found - the requested resource does not exist.


```
{
  "error": {
    "type": "record-not-found",
    "message": "The requested resource was not found."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 405

Method not allowed.


```
{
  "error": {
    "type": "method-not-allowed",
    "message": "This API end-point can only be accessed using the following HTTP methods: OPTIONS,GET"
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 429

Too many requests - rate limit exceeded.


```
{
  "error": {
    "type": "rate-limit-exceeded",
    "message": "You have exceeded the rate limit. Please try again later."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`
