# Set Webhook

**POST** `/{phone_number_id}/setwebhook`

Product: [WhatsApp](https://devdocs.pinnacle.in/docs/whatsapp.md)  
Version: [3.0](https://devdocs.pinnacle.in/docs/whatsapp/3-0.md)

This API is used to set a webhook url against the waba using phone number id. The callback payload received from Meta will be relayed to this webhook url along with the custom values as specified in the headers parameter of the request body.

## Request

URL: `https://partnersv1.pinbot.ai/v3/{phone_number_id}/setwebhook`

Authentication location: `header`

Authentication name: `apikey`

### Request schema


```json
{
  "type": "object",
  "properties": {
    "raw_example": {
      "type": "string"
    }
  }
}
```

### Request example


```json
{
  "raw_example": "{\n\"webhook_url\": \"https:\n\"headers\": {\n\"header1\": \"header1_value\",\n\"header2\": \"header2_value\"\n}\n}"
}
```

## Response schema


```json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  }
}
```

## Response examples


```json
{
  "200": {
    "code": "200",
    "status": "Success",
    "message": "Your webhook has been configured successfully"
  }
}
```

## Status codes


```json
[
  {
    "code": 200,
    "description": "The request was successful."
  },
  {
    "code": 400,
    "description": "Bad request or invalid parameters."
  },
  {
    "code": 401,
    "description": "API key is missing or invalid."
  },
  {
    "code": 403,
    "description": "The request is not authorized for this resource."
  },
  {
    "code": 404,
    "description": "The requested resource was not found."
  },
  {
    "code": 500,
    "description": "The server encountered an error."
  }
]
```
