Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.docinject.com/llms.txt

Use this file to discover all available pages before exploring further.

Use the webhooks API to manage the endpoints DocInject delivers events to. All endpoints require a valid bearer token and a Scale plan subscription. Webhook owners and organization admins can modify or delete a given configuration; any member can trigger a test delivery. Base URL: https://api.docinject.io/api/v1

Webhook config object

Most endpoints return a webhook config object. Its shape is consistent across list, create, and update responses.
{
  "id": "wh-uuid-0001",
  "organization_id": "a1b2c3d4-0000-0000-0000-111122223333",
  "created_by": "user-uuid-0001",
  "name": "Publish notifier",
  "url": "https://hooks.acme.example/docinject",
  "event_types": ["document.published", "document.revised"],
  "is_active": true,
  "created_at": "2024-03-01T08:00:00Z"
}
The secret field is returned only in the response to POST /webhooks. Store it immediately — it cannot be retrieved again.

List webhooks

Retrieve all webhook configurations registered for your organization.
GET /webhooks
Response200 OK: an array of webhook config objects.
curl https://api.docinject.io/api/v1/webhooks \
  -H "Authorization: Bearer <token>"

Register a webhook

Create a new webhook endpoint. Requires the Scale plan.
POST /webhooks
Request body
name
string
required
A human-readable label for this webhook (e.g. "Slack publish alerts").
url
string
required
The HTTPS URL DocInject will POST events to.
event_types
string[]
required
One or more event type strings to subscribe to. Must be values from the event reference. Passing an unrecognized value returns 400.
Response201 Created: a webhook config object with secret included.
id
string
UUID of the new webhook configuration.
organization_id
string
UUID of your organization.
created_by
string
UUID of the user who registered this webhook.
name
string
The name you provided.
url
string
The endpoint URL.
event_types
string[]
The subscribed event types.
is_active
boolean
Always true on creation.
created_at
string
ISO 8601 creation timestamp.
secret
string
HMAC-SHA256 signing secret. Returned once only — store this value immediately. Use it to verify the X-DocInject-Signature header on incoming requests. See the webhooks overview for verification details.
curl -X POST https://api.docinject.io/api/v1/webhooks \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Publish notifier",
    "url": "https://hooks.acme.example/docinject",
    "event_types": ["document.published"]
  }'
Example response
{
  "id": "wh-uuid-0001",
  "organization_id": "a1b2c3d4-0000-0000-0000-111122223333",
  "created_by": "user-uuid-0001",
  "name": "Publish notifier",
  "url": "https://hooks.acme.example/docinject",
  "event_types": ["document.published"],
  "is_active": true,
  "created_at": "2024-03-01T08:00:00Z",
  "secret": "a3f9c2e1b8d7..."
}

Update a webhook

Modify an existing webhook configuration. Send only the fields you want to change. The webhook owner or any org admin can update.
PATCH /webhooks/{config_id}
Path parameters
config_id
string
required
UUID of the webhook configuration to update.
Request body — all fields optional
name
string
New label for the webhook.
url
string
New destination URL.
event_types
string[]
Replacement list of event types. Overwrites the existing list entirely.
Response200 OK: the updated webhook config object (without secret).
curl -X PATCH https://api.docinject.io/api/v1/webhooks/wh-uuid-0001 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "event_types": ["document.published", "document.revised", "member.joined"]
  }'

Delete a webhook

Permanently remove a webhook configuration. The webhook owner or any org admin can delete.
DELETE /webhooks/{config_id}
Path parameters
config_id
string
required
UUID of the webhook configuration to delete.
Response204 No Content.
curl -X DELETE https://api.docinject.io/api/v1/webhooks/wh-uuid-0001 \
  -H "Authorization: Bearer <token>"

Test a webhook

Send a test ping to a registered endpoint to confirm it is reachable. Any org member can trigger a test. DocInject sends a single request with event_type: "webhook.test" and waits up to 10 seconds for a response.
POST /webhooks/{config_id}/test
Path parameters
config_id
string
required
UUID of the webhook configuration to test.
Response200 OK
status
"delivered" | "failed"
"delivered" if the endpoint responded with a 2xx status within 10 seconds; "failed" otherwise.
http_status
integer | null
The HTTP status code returned by your endpoint, or null if no response was received (e.g. connection timeout).
curl -X POST https://api.docinject.io/api/v1/webhooks/wh-uuid-0001/test \
  -H "Authorization: Bearer <token>"
Example responses
Delivered
{ "status": "delivered", "http_status": 200 }
Failed (non-2xx)
{ "status": "failed", "http_status": 500 }
Failed (no response)
{ "status": "failed", "http_status": null }

Get event delivery log

Retrieve the last 100 outbound webhook events for your organization, ordered by most recent first. Use this to inspect delivery status and retry counts.
GET /webhooks/events
Response200 OK: an array of event log objects.
id
string
UUID of the event log entry.
event_type
string
The event type that was dispatched (e.g. "document.published").
direction
"outbound"
Always "outbound" for events in this log.
status
"pending" | "delivered" | "failed"
Current delivery status. "pending" means delivery is still in progress.
attempts
integer
Number of delivery attempts made so far. Maximum is 3.
created_at
string
ISO 8601 timestamp when the event was first enqueued.
curl https://api.docinject.io/api/v1/webhooks/events \
  -H "Authorization: Bearer <token>"
Example response
[
  {
    "id": "evt-uuid-0001",
    "event_type": "document.published",
    "direction": "outbound",
    "status": "delivered",
    "attempts": 1,
    "created_at": "2024-03-10T11:00:05Z"
  },
  {
    "id": "evt-uuid-0002",
    "event_type": "member.invited",
    "direction": "outbound",
    "status": "failed",
    "attempts": 3,
    "created_at": "2024-03-09T14:22:10Z"
  }
]