Legalize Webhooks API
The webhooks API from Legalize — 7 operation(s) for webhooks.
The webhooks API from Legalize — 7 operation(s) for webhooks.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/legalize-dev:legalize-dev-webhooks-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Legalize Webhooks API
description: Open legislation API. Every law as structured data, every reform as a diff.
version: 0.18.0
tags:
- name: Webhooks
paths:
/api/v1/webhooks:
get:
tags:
- Webhooks
summary: List Endpoints
description: List all webhook endpoints for the authenticated user.
operationId: list_endpoints_api_v1_webhooks_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
application/xml:
schema: {}
'401':
description: Missing, malformed, or invalid API key
'429':
description: Monthly quota exceeded. Includes Retry-After header.
security:
- ApiKeyAuth: []
post:
tags:
- Webhooks
summary: Create Endpoint
description: Create a webhook endpoint. Returns the signing secret ONCE.
operationId: create_endpoint_api_v1_webhooks_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookEndpointCreate'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
application/xml:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
application/xml:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'401':
description: Missing, malformed, or invalid API key
'429':
description: Monthly quota exceeded. Includes Retry-After header.
security:
- ApiKeyAuth: []
/api/v1/webhooks/preview:
post:
tags:
- Webhooks
summary: Preview Endpoint
description: 'What a rule would have delivered over the last 30 days. Creates nothing.
POST rather than GET because the rule is a document -- arrays and a free
text query -- and because a URL long enough to carry 200 law ids is not a
URL. It is still read-only: no row is written and nothing is sent.
Registered before `/{endpoint_id}` would ever be consulted, so "preview" is
never read as an id; FastAPI matches in declaration order.'
operationId: preview_endpoint_api_v1_webhooks_preview_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookPreview'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
application/xml:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
application/xml:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'401':
description: Missing, malformed, or invalid API key
'429':
description: Monthly quota exceeded. Includes Retry-After header.
security:
- ApiKeyAuth: []
/api/v1/webhooks/{endpoint_id}:
get:
tags:
- Webhooks
summary: Get Endpoint
description: Get details for a specific webhook endpoint.
operationId: get_endpoint_api_v1_webhooks__endpoint_id__get
security:
- ApiKeyAuth: []
parameters:
- name: endpoint_id
in: path
required: true
schema:
type: integer
title: Endpoint Id
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
application/xml:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
application/xml:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'401':
description: Missing, malformed, or invalid API key
'429':
description: Monthly quota exceeded. Includes Retry-After header.
patch:
tags:
- Webhooks
summary: Update Endpoint
description: Update a webhook endpoint. Disabling one needs no plan; anything else does.
operationId: update_endpoint_api_v1_webhooks__endpoint_id__patch
security:
- ApiKeyAuth: []
parameters:
- name: endpoint_id
in: path
required: true
schema:
type: integer
title: Endpoint Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookEndpointUpdate'
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
application/xml:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
application/xml:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'401':
description: Missing, malformed, or invalid API key
'429':
description: Monthly quota exceeded. Includes Retry-After header.
delete:
tags:
- Webhooks
summary: Delete Endpoint
description: Delete a webhook endpoint.
operationId: delete_endpoint_api_v1_webhooks__endpoint_id__delete
security:
- ApiKeyAuth: []
parameters:
- name: endpoint_id
in: path
required: true
schema:
type: integer
title: Endpoint Id
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
application/xml:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
application/xml:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'401':
description: Missing, malformed, or invalid API key
'429':
description: Monthly quota exceeded. Includes Retry-After header.
/api/v1/webhooks/{endpoint_id}/deliveries:
get:
tags:
- Webhooks
summary: List Deliveries
description: 'List delivery attempts for an endpoint. Filter by status: failed, success, pending.'
operationId: list_deliveries_api_v1_webhooks__endpoint_id__deliveries_get
security:
- ApiKeyAuth: []
parameters:
- name: endpoint_id
in: path
required: true
schema:
type: integer
title: Endpoint Id
- name: page
in: query
required: false
schema:
type: integer
default: 1
title: Page
- name: status
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Status
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
application/xml:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
application/xml:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'401':
description: Missing, malformed, or invalid API key
'429':
description: Monthly quota exceeded. Includes Retry-After header.
/api/v1/webhooks/{endpoint_id}/deliveries/{delivery_id}/retry:
post:
tags:
- Webhooks
summary: Retry Failed Delivery
description: Retry a failed webhook delivery. Re-sends the original event payload.
operationId: retry_failed_delivery_api_v1_webhooks__endpoint_id__deliveries__delivery_id__retry_post
security:
- ApiKeyAuth: []
parameters:
- name: endpoint_id
in: path
required: true
schema:
type: integer
title: Endpoint Id
- name: delivery_id
in: path
required: true
schema:
type: integer
title: Delivery Id
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
application/xml:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
application/xml:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'401':
description: Missing, malformed, or invalid API key
'429':
description: Monthly quota exceeded. Includes Retry-After header.
/api/v1/webhooks/{endpoint_id}/rotate:
post:
tags:
- Webhooks
summary: Rotate Secret
description: 'Issue a new signing secret. Returned ONCE, and the old one stops working now.
Two path segments, so no `/{endpoint_id}` route can swallow it whatever the
declaration order -- unlike `/preview`, which is a sibling of the id itself
and has to be declared before it.'
operationId: rotate_secret_api_v1_webhooks__endpoint_id__rotate_post
security:
- ApiKeyAuth: []
parameters:
- name: endpoint_id
in: path
required: true
schema:
type: integer
title: Endpoint Id
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
application/xml:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
application/xml:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'401':
description: Missing, malformed, or invalid API key
'429':
description: Monthly quota exceeded. Includes Retry-After header.
/api/v1/webhooks/{endpoint_id}/test:
post:
tags:
- Webhooks
summary: Send Test Event
description: Send a test.ping event to verify the endpoint is working.
operationId: send_test_event_api_v1_webhooks__endpoint_id__test_post
security:
- ApiKeyAuth: []
parameters:
- name: endpoint_id
in: path
required: true
schema:
type: integer
title: Endpoint Id
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
application/xml:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
application/xml:
schema:
$ref: '#/components/schemas/HTTPValidationError'
'401':
description: Missing, malformed, or invalid API key
'429':
description: Monthly quota exceeded. Includes Retry-After header.
components:
schemas:
WebhookEndpointUpdate:
properties:
url:
anyOf:
- type: string
- type: 'null'
title: Url
event_types:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Event Types
countries:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Countries
law_ids:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Law Ids
match_query:
anyOf:
- type: string
- type: 'null'
title: Match Query
description:
anyOf:
- type: string
- type: 'null'
title: Description
enabled:
anyOf:
- type: boolean
- type: 'null'
title: Enabled
type: object
title: WebhookEndpointUpdate
WebhookPreview:
properties:
event_types:
items:
type: string
type: array
title: Event Types
countries:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Countries
law_ids:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Law Ids
match_query:
anyOf:
- type: string
- type: 'null'
title: Match Query
type: object
required:
- event_types
title: WebhookPreview
description: A rule to try before committing to it. No endpoint, no url, no secret.
WebhookEndpointCreate:
properties:
url:
type: string
title: Url
event_types:
items:
type: string
type: array
title: Event Types
countries:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Countries
law_ids:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Law Ids
match_query:
anyOf:
- type: string
- type: 'null'
title: Match Query
description:
type: string
title: Description
default: ''
type: object
required:
- url
- event_types
title: WebhookEndpointCreate
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: Authorization
description: 'Bearer token. Get one for free at https://legalize.dev/api — no credit card, 2,000 calls/month on Free. Format: `Bearer leg_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`'