# post

Create a new webhook subscription (API-key authentication only).
Registers a URL to receive event callbacks for a given `item_type` and `action`.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "servers": [
    {
      "url": "https://{domain}/api",
      "variables": {
        "domain": {
          "default": "app.loxo.co",
          "description": "domain assigned by Loxo"
        }
      }
    }
  ],
  "security": [
    {
      "loxo_bearer_token": []
    }
  ],
  "info": {
    "title": "Loxo API",
    "description": "API for the Loxo application",
    "version": "1.3.3"
  },
  "components": {
    "securitySchemes": {
      "loxo_bearer_token": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/{agency_slug}/webhooks": {
      "post": {
        "operationId": "webhooks:create",
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "parameters": [
          {
            "name": "agency_slug",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Create a new webhook subscription (API-key authentication only).\nRegisters a URL to receive event callbacks for a given `item_type` and `action`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "webhook": {
                    "type": "object",
                    "properties": {
                      "item_type": {
                        "type": "string",
                        "description": "Can be one of the following:\n- candidate\n- company\n- company_document\n- deal\n- deal_document\n- job\n- job_document\n- person_education_profile\n- person_event\n- person_event_document\n- person_job_profile\n- person\n- person_document\n- placement_split\n- placement\n- resume\n"
                      },
                      "action": {
                        "type": "string",
                        "description": "Can be one of the following:\n- create\n- update\n- destroy\n"
                      },
                      "endpoint_url": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "item_type",
                      "action",
                      "endpoint_url"
                    ]
                  }
                },
                "required": [
                  "webhook"
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "webhook[item_type]": {
                    "type": "string",
                    "description": "Can be one of the following:\n- candidate\n- company\n- company_document\n- deal\n- deal_document\n- job\n- job_document\n- person_education_profile\n- person_event\n- person_event_document\n- person_job_profile\n- person\n- person_document\n- placement_split\n- placement\n- resume\n"
                  },
                  "webhook[action]": {
                    "type": "string",
                    "description": "Can be one of the following:\n- create\n- update\n- destroy\n"
                  },
                  "webhook[endpoint_url]": {
                    "type": "string"
                  }
                },
                "required": [
                  "item_type",
                  "action",
                  "endpoint_url"
                ]
              }
            }
          }
        },
        "x-mcp-annotations": {
          "readOnlyHint": false,
          "openWorldHint": false,
          "destructiveHint": false
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 95,
      "1": 216,
      "2": 44,
      "3": 233,
      "4": 144,
      "5": 80,
      "6": 80,
      "7": 0,
      "8": 108,
      "9": 130,
      "10": 99,
      "11": 166
    }
  }
}
```