# Create a webhook service; the webhook URL is returned once

POST /api/agent/services. Required scopes: services:write.

HTML: https://notify.belweave.ai/docs/api/postServices

Required scopes: `services:write`

```http
POST /api/agent/services
Authorization: Bearer ntf_your_token
```

## Operation schema

```json
{
  "summary": "Create a webhook service; the webhook URL is returned once",
  "operationId": "postServices",
  "security": [
    {
      "bearer": [
        "services:write"
      ]
    }
  ],
  "x-notify-scopes": [
    "services:write"
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "defaultReplyWebhookId": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^whk_[A-Za-z0-9_-]{1,100}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "title": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            },
            "imageUrl": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 2048,
                  "format": "uri"
                },
                {
                  "type": "null"
                }
              ]
            },
            "url": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 2048,
                  "format": "uri"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "title"
          ]
        }
      }
    }
  },
  "responses": {
    "201": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ServiceCreated"
          }
        }
      }
    },
    "400": {
      "description": "Invalid request",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Missing, unknown, revoked, or expired token",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "The token lacks a required scope or the account lacks permission",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "404": {
      "description": "Not found for this account",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
```

Resolve schema references against [OpenAPI](https://notify.belweave.ai/openapi.json).
