TradesAPI Webhooks API
The webhooks API from TradesAPI — 8 operation(s) for webhooks.
The webhooks API from TradesAPI — 8 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/tradesapi-com:tradesapi-com-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: Trades Webhooks API
description: Real-time contractor license verification across all 50 US states + DC, plus 16 metro areas. Send a license number + state + trade, get back a normalized JSON result with status, expiration, and disciplinary history.
version: 1.0.0
tags:
- name: Webhooks
paths:
/webhooks/subscriptions:
post:
tags:
- Webhooks
summary: Create Subscription
description: 'Create a new webhook subscription.
Returns 201 on a brand-new row, 200 on reactivation of a
previously soft-deleted same-URL row, 409 when an active duplicate
URL exists (with ``existing_id`` so the client can PATCH instead),
and 429 when the active-subscription quota is exhausted.
Entitlement (#1388): when ``webhook_require_active_monitor`` is on,
a subscription''s ``event_filter`` selects candidate events but does
NOT by itself entitle delivery — the event is delivered only if this
API key also holds an active monitor for the event''s
``(jurisdiction_code, license_number)``. Provision monitors for the
licenses you want change events on.'
operationId: create_subscription_webhooks_subscriptions_post
parameters:
- name: x-api-key
in: header
required: false
schema:
type: string
description: API key for authentication
default: ''
title: X-Api-Key
description: API key for authentication
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookCreateRequest'
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookCreateResponse'
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookCreateResponse'
description: OK
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
get:
tags:
- Webhooks
summary: List Subscriptions
description: List the caller's subscriptions, newest first.
operationId: list_subscriptions_webhooks_subscriptions_get
parameters:
- name: limit
in: query
required: false
schema:
type: integer
maximum: 100
minimum: 1
default: 50
title: Limit
- name: offset
in: query
required: false
schema:
type: integer
maximum: 10000
minimum: 0
default: 0
title: Offset
- name: include_inactive
in: query
required: false
schema:
type: boolean
default: false
title: Include Inactive
- name: x-api-key
in: header
required: false
schema:
type: string
description: API key for authentication
default: ''
title: X-Api-Key
description: API key for authentication
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookListResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/webhooks/subscriptions/{sub_id}:
get:
tags:
- Webhooks
summary: Get Subscription
description: Get a single subscription. 404 cross-tenant.
operationId: get_subscription_webhooks_subscriptions__sub_id__get
parameters:
- name: sub_id
in: path
required: true
schema:
type: integer
minimum: 1
title: Sub Id
- name: x-api-key
in: header
required: false
schema:
type: string
description: API key for authentication
default: ''
title: X-Api-Key
description: API key for authentication
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookSubscriptionPublic'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
patch:
tags:
- Webhooks
summary: Update Subscription
description: 'Update url / event_filter / active / description.
URL changes re-run validation. Setting ``active=true`` on a
soft-deleted row reactivates it (mirrors POST-soft-deleted-URL
semantics). PATCH never resets the signing secret — see
``/rotate-secret`` for that.
Entitlement (#1388): editing ``event_filter`` changes which events
are candidates but does not grant delivery entitlement. When
``webhook_require_active_monitor`` is on, delivery still requires an
active monitor owned by this API key for the event''s
``(jurisdiction_code, license_number)``.'
operationId: update_subscription_webhooks_subscriptions__sub_id__patch
parameters:
- name: sub_id
in: path
required: true
schema:
type: integer
minimum: 1
title: Sub Id
- name: x-api-key
in: header
required: false
schema:
type: string
description: API key for authentication
default: ''
title: X-Api-Key
description: API key for authentication
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookUpdateRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookSubscriptionPublic'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Webhooks
summary: Delete Subscription
description: 'Soft-delete: ``active=false``. The row stays for audit history.'
operationId: delete_subscription_webhooks_subscriptions__sub_id__delete
parameters:
- name: sub_id
in: path
required: true
schema:
type: integer
minimum: 1
title: Sub Id
- name: x-api-key
in: header
required: false
schema:
type: string
description: API key for authentication
default: ''
title: X-Api-Key
description: API key for authentication
responses:
'204':
description: Successful Response
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/webhooks/subscriptions/{sub_id}/rotate-secret:
post:
tags:
- Webhooks
summary: Rotate Secret
description: 'Rotate the signing secret. Old secret valid for the grace window.
1. Generate new plaintext + new hash
2. Move current ``signing_secret_hash`` to
``signing_secret_hash_prev``
3. Set new hash + ``secret_rotated_at = now()``
4. Return plaintext ONCE'
operationId: rotate_secret_webhooks_subscriptions__sub_id__rotate_secret_post
parameters:
- name: sub_id
in: path
required: true
schema:
type: integer
minimum: 1
title: Sub Id
- name: x-api-key
in: header
required: false
schema:
type: string
description: API key for authentication
default: ''
title: X-Api-Key
description: API key for authentication
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookRotateSecretResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/webhooks/subscriptions/{sub_id}/test:
post:
tags:
- Webhooks
summary: Test Subscription
description: 'Fire a synthetic test event to the subscription''s URL.
Idempotent (no row created). The customer-side endpoint sees a
real signed POST so they can validate their integration end-to-end
without needing a real license-status change.'
operationId: test_subscription_webhooks_subscriptions__sub_id__test_post
parameters:
- name: sub_id
in: path
required: true
schema:
type: integer
minimum: 1
title: Sub Id
- name: x-api-key
in: header
required: false
schema:
type: string
description: API key for authentication
default: ''
title: X-Api-Key
description: API key for authentication
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookTestResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/webhooks/deliveries:
get:
tags:
- Webhooks
summary: List Deliveries
description: 'List delivery attempts for one of the caller''s subscriptions.
Ownership-scoped: 404 if the subscription belongs to another tenant
(matches the rest of /webhooks). Newest attempts first.'
operationId: list_deliveries_webhooks_deliveries_get
parameters:
- name: subscription_id
in: query
required: true
schema:
type: integer
minimum: 1
title: Subscription Id
- name: limit
in: query
required: false
schema:
type: integer
maximum: 100
minimum: 1
default: 50
title: Limit
- name: offset
in: query
required: false
schema:
type: integer
maximum: 10000
minimum: 0
default: 0
title: Offset
- name: x-api-key
in: header
required: false
schema:
type: string
description: API key for authentication
default: ''
title: X-Api-Key
description: API key for authentication
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookDeliveryListResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/webhooks/deliveries/{attempt_id}/replay:
post:
tags:
- Webhooks
summary: Replay Delivery
description: 'Manually re-enqueue a delivery attempt.
Rate-limited at 5/hour/subscription (Important #8). Useful for
customer-side debugging — replay a DLQ row after fixing the
receiving endpoint.'
operationId: replay_delivery_webhooks_deliveries__attempt_id__replay_post
parameters:
- name: attempt_id
in: path
required: true
schema:
type: integer
minimum: 1
title: Attempt Id
- name: x-api-key
in: header
required: false
schema:
type: string
description: API key for authentication
default: ''
title: X-Api-Key
description: API key for authentication
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookReplayResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/webhooks/sink:
post:
tags:
- Webhooks
summary: Mint Sink
description: 'Mint a fresh sink token. Point a webhook subscription at
``{base_url}/webhooks/sink/{token}`` and read deliveries back with GET.
Deliveries are kept 24h, newest first, at most 25.'
operationId: mint_sink_webhooks_sink_post
responses:
'201':
description: Successful Response
content:
application/json:
schema: {}
/webhooks/sink/{token}:
post:
tags:
- Webhooks
summary: Receive
description: 'Receiver endpoint. Accepts any POST body and stores it with the
signature headers so the caller can verify it out of band.'
operationId: receive_webhooks_sink__token__post
parameters:
- name: token
in: path
required: true
schema:
type: string
minLength: 24
maxLength: 128
description: Sink token (the bearer)
title: Token
description: Sink token (the bearer)
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
get:
tags:
- Webhooks
summary: Read
operationId: read_webhooks_sink__token__get
parameters:
- name: token
in: path
required: true
schema:
type: string
minLength: 24
maxLength: 128
description: Sink token (the bearer)
title: Token
description: Sink token (the bearer)
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Webhooks
summary: Clear
operationId: clear_webhooks_sink__token__delete
parameters:
- name: token
in: path
required: true
schema:
type: string
minLength: 24
maxLength: 128
description: Sink token (the bearer)
title: Token
description: Sink token (the bearer)
responses:
'204':
description: Successful Response
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
WebhookSubscriptionPublic:
properties:
id:
type: integer
title: Id
url:
type: string
title: Url
active:
type: boolean
title: Active
event_filter:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Event Filter
description:
anyOf:
- type: string
- type: 'null'
title: Description
signing_secret_prefix:
type: string
title: Signing Secret Prefix
secret_rotated_at:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Secret Rotated At
last_success_at:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Last Success At
last_failure_at:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Last Failure At
consecutive_failures:
type: integer
title: Consecutive Failures
created_at:
type: string
format: date-time
title: Created At
updated_at:
type: string
format: date-time
title: Updated At
type: object
required:
- id
- url
- active
- event_filter
- description
- signing_secret_prefix
- secret_rotated_at
- last_success_at
- last_failure_at
- consecutive_failures
- created_at
- updated_at
title: WebhookSubscriptionPublic
description: 'Subscription representation visible on GET / list endpoints.
Notably absent: ``signing_secret``. Plaintext is returned exactly
once (in the create / rotate-secret responses below) and never
re-fetchable.'
WebhookReplayResponse:
properties:
new_attempt_id:
type: integer
title: New Attempt Id
type: object
required:
- new_attempt_id
title: WebhookReplayResponse
EventFilter:
properties:
jurisdictions:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Jurisdictions
field_names:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Field Names
license_numbers:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: License Numbers
type: object
title: EventFilter
description: 'Customer-supplied event filter.
``None`` and ``{}`` both mean "match every event". Each list field
is independently optional — ``jurisdictions=["TX"]`` with
``field_names=None`` matches every TX event regardless of which
field changed. ``license_numbers`` is a literal list (case-
insensitive comparison happens server-side at fan-out time).'
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
WebhookTestResponse:
properties:
delivered:
type: boolean
title: Delivered
http_status:
anyOf:
- type: integer
- type: 'null'
title: Http Status
latency_ms:
anyOf:
- type: integer
- type: 'null'
title: Latency Ms
error:
anyOf:
- type: string
- type: 'null'
title: Error
sent_payload_summary:
additionalProperties: true
type: object
title: Sent Payload Summary
type: object
required:
- delivered
- http_status
- latency_ms
- error
- sent_payload_summary
title: WebhookTestResponse
description: 'Response from a synthetic ``POST /test`` invocation.
No ``WebhookDeliveryAttempt`` row is created — the synthetic payload
is built and POSTed (or attempted) in the request lifecycle and the
outcome is returned inline. The customer''s endpoint logs WILL show
a request; our own delivery log won''t.'
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
WebhookDeliveryAttemptPublic:
properties:
id:
type: integer
title: Id
subscription_id:
type: integer
title: Subscription Id
event_id:
type: integer
title: Event Id
attempt_number:
type: integer
title: Attempt Number
attempted_at:
type: string
format: date-time
title: Attempted At
status:
type: string
title: Status
http_status:
anyOf:
- type: integer
- type: 'null'
title: Http Status
response_body_truncated:
anyOf:
- type: string
- type: 'null'
title: Response Body Truncated
latency_ms:
anyOf:
- type: integer
- type: 'null'
title: Latency Ms
next_retry_at:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Next Retry At
type: object
required:
- id
- subscription_id
- event_id
- attempt_number
- attempted_at
- status
- http_status
- response_body_truncated
- latency_ms
- next_retry_at
title: WebhookDeliveryAttemptPublic
description: 'Public projection of a delivery attempt row for /deliveries.
The full row contains operational fields the customer doesn''t need
(subscription_id is implicit when filtering by it; latency_ms is
surfaced for transparency).'
WebhookRotateSecretResponse:
properties:
id:
type: integer
title: Id
signing_secret:
type: string
title: Signing Secret
signing_secret_prefix:
type: string
title: Signing Secret Prefix
secret_rotated_at:
type: string
format: date-time
title: Secret Rotated At
previous_secret_valid_until:
type: string
format: date-time
title: Previous Secret Valid Until
type: object
required:
- id
- signing_secret
- signing_secret_prefix
- secret_rotated_at
- previous_secret_valid_until
title: WebhookRotateSecretResponse
description: Rotate-secret response — plaintext secret returned ONCE.
WebhookCreateRequest:
properties:
url:
type: string
maxLength: 2048
minLength: 1
title: Url
event_filter:
anyOf:
- $ref: '#/components/schemas/EventFilter'
- type: 'null'
description:
anyOf:
- type: string
maxLength: 500
- type: 'null'
title: Description
type: object
required:
- url
title: WebhookCreateRequest
WebhookCreateResponse:
properties:
id:
type: integer
title: Id
url:
type: string
title: Url
active:
type: boolean
title: Active
event_filter:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Event Filter
description:
anyOf:
- type: string
- type: 'null'
title: Description
signing_secret_prefix:
type: string
title: Signing Secret Prefix
secret_rotated_at:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Secret Rotated At
last_success_at:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Last Success At
last_failure_at:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Last Failure At
consecutive_failures:
type: integer
title: Consecutive Failures
created_at:
type: string
format: date-time
title: Created At
updated_at:
type: string
format: date-time
title: Updated At
signing_secret:
type: string
title: Signing Secret
type: object
required:
- id
- url
- active
- event_filter
- description
- signing_secret_prefix
- secret_rotated_at
- last_success_at
- last_failure_at
- consecutive_failures
- created_at
- updated_at
- signing_secret
title: WebhookCreateResponse
description: Create / reactivate response — plaintext secret returned ONCE.
WebhookDeliveryListResponse:
properties:
items:
items:
$ref: '#/components/schemas/WebhookDeliveryAttemptPublic'
type: array
title: Items
limit:
type: integer
title: Limit
offset:
type: integer
title: Offset
type: object
required:
- items
- limit
- offset
title: WebhookDeliveryListResponse
WebhookListResponse:
properties:
items:
items:
$ref: '#/components/schemas/WebhookSubscriptionPublic'
type: array
title: Items
total_active:
type: integer
title: Total Active
limit:
type: integer
title: Limit
offset:
type: integer
title: Offset
type: object
required:
- items
- total_active
- limit
- offset
title: WebhookListResponse
WebhookUpdateRequest:
properties:
url:
anyOf:
- type: string
maxLength: 2048
minLength: 1
- type: 'null'
title: Url
event_filter:
anyOf:
- $ref: '#/components/schemas/EventFilter'
- type: 'null'
active:
anyOf:
- type: boolean
- type: 'null'
title: Active
description:
anyOf:
- type: string
maxLength: 500
- type: 'null'
title: Description
type: object
title: WebhookUpdateRequest
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key
description: API key for authenticated endpoints. Sign up at /auth/login to get one. Every successful verification consumes one credit.