Skip to content

Endpoints

Endpoints represent the target URLs where PromptJang delivers your events.

List Endpoints

GET /api/v1/endpoints

Response

json
{
  "endpoints": [
    {
      "id": "4e2eba24818c6a8bbbdab486cfad9785",
      "url": "https://example.com/webhooks",
      "description": "Production webhook",
      "event_types": ["order.created", "order.updated"],
      "enabled": true,
      "created_at": "2026-05-26T12:00:00Z"
    }
  ]
}

Create Endpoint

POST /api/v1/endpoints

Request Body

FieldRequiredDescription
urlYesTarget URL (HTTPS recommended). Validated for SSRF.
descriptionNoHuman-readable description
event_typesNoArray of event types to filter (empty = all events)
json
{
  "url": "https://example.com/webhooks",
  "description": "Production webhook",
  "event_types": ["order.created", "order.updated"]
}

Response

HTTP 201 Created
json
{
  "id": "4e2eba24...",
  "url": "https://example.com/webhooks",
  "secret": "whsec_0f99932b...",
  "description": "Production webhook",
  "event_types": ["order.created", "order.updated"],
  "enabled": true,
  "created_at": "2026-05-26T12:00:00Z"
}

The secret is returned only on creation. Use it to sign events.

Get Endpoint

GET /api/v1/endpoints/:id

Response

Same as create, minus secret (secrets are not stored in plaintext).

Update Endpoint

PATCH /api/v1/endpoints/:id

Request Body

All fields are optional (partial update):

json
{
  "url": "https://new.example.com/webhooks",
  "description": "Updated description",
  "event_types": ["order.created"],
  "enabled": false
}

Response

json
{
  "id": "4e2eba24...",
  "url": "https://new.example.com/webhooks",
  "description": "Updated description",
  "event_types": ["order.created"],
  "enabled": false,
  "updated_at": "2026-05-26T13:00:00Z"
}

Delete Endpoint

DELETE /api/v1/endpoints/:id

Response

HTTP 200 OK
json
{
  "message": "Endpoint deleted"
}

Released under the MIT License.