> For the complete documentation index, see [llms.txt](https://help.autify.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.autify.com/nocode-web/autify-university/integrations/creating-webhooks.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# Webhookを作成する

## Webhookとは

Webhookを設定することで、特定のイベントが完了したときにその内容を受け取ることができます。そして受け取った内容を元にテスト結果の通知内容をカスタマイズしたり他のサービスと連携することが可能です。Webhookを簡単に試すための[レポジトリ](https://github.com/autifyhq/autify-demo-outgoing-webhook/)を用意したのでぜひお試しください。

## Webhookの設定

Webhookは以下の方法で設定します。

1. ワークスペース設定ページに遷移
2. Webhookセクションで **追加** を押下
3. Webhook URLとWebhookシークレット（任意）を設定

## Webhook URL

Autifyはイベント発生後に指定されたWebhook URLに`POST`リクエストを送ります。またその際のContent-Typeは`application/json`です。

## Webhookシークレット

Webhookシークレットを設定することで、Webhook URLに送られるリクエストがAutifyからのものであることを確認できます。また、シークレットを設定すると、Autifyからのリクエストヘッダに`X-Autify-Signature`が含まれます。詳細は"[Webhookをより安全に利用する](https://help.autify.com/nocode-web/autify-university/integrations/securing-your-webhooks.md)"を参照してください。

## Webhookで受け取れるイベント

### テストプラン結果

テストプランの終了時にイベントを送ります。

**Webhookペイロードの例**

```json
{
    "action":"finished",
    "id":1,
    "test_plan": {
        "id": 2,
        "name": "New Test Plan"
    },
    "started_at":"2020-07-14T06:37:39.598Z",
    "finished_at":"2020-07-14T06:37:59.456Z",
    "status":"passed",
    "review_needed": false,
    "url":"https://app.autify.com/projects/1/results/1",
    "scenarios":[{
        "action":"finished",
        "id":1,
        "started_at":"2020-07-14T06:37:39.598Z",
        "finished_at":"2020-07-14T06:37:59.456Z",
        "status":"passed",
        "url":"https://app.autify.com/projects/1/results/1/capabilities/1/scenarios/1",
        "scenario_id":1,
        "scenario_name":"New Scenario",
        "review_needed":false,
        "test_plan_id":1,
        "capability":{
            "os":"Linux",
            "os_version":null,
            "browser":"Chrome",
            "browser_version":"83.0",
            "device":null,
            "resolution":"1280x1024"
        }
    }]
}
```

### テストケース結果

テストケースの終了時にイベントを送ります。

**Webhookペイロードの例**

```json
{
    "action":"finished",
    "id":1,
    "started_at":"2020-07-14T06:37:39.598Z",
    "finished_at":"2020-07-14T06:37:59.456Z",
    "status":"passed",
    "url":"https://app.autify.com/projects/1/results/1/capabilities/1/scenarios/1",
    "scenario_id":1,
    "scenario_name":"New Scenario",
    "review_needed":false,
    "test_plan_id":1,
    "capability":{
        "os":"Linux",
        "os_version":null,
        "browser":"Chrome",
        "browser_version":"83.0",
        "device":null,
        "resolution":"1280x1024"
    }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.autify.com/nocode-web/autify-university/integrations/creating-webhooks.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
