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",
      "name": "Orders production",
      "url": "https://example.com/webhooks",
      "description": "Production webhook",
      "event_types": "[\"order.created\",\"order.updated\"]",
      "max_payload_bytes": 262144,
      "max_retries": 5,
      "retry_interval_seconds": 60,
      "enabled": true,
      "created_at": 1787736000,
      "updated_at": 1787736000
    }
  ]
}

Create Endpoint

POST /api/v1/endpoints

Request Body

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

Response

HTTP 200 OK
json
{
  "id": "4e2eba24...",
  "secret": "whsec_0f99932b..."
}

The secret is returned only on creation. Store it immediately; the receiving target uses it to verify PromptJang signatures.

Get Endpoint

GET /api/v1/endpoints/:id

Response

Returns { "endpoint": { ... } } with the same endpoint fields shown by the list route. It never returns the signing secret.

Update Endpoint

PATCH /api/v1/endpoints/:id

Request Body

All fields are optional (partial update):

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

Response

json
{
  "endpoint": {
    "id": "4e2eba24...",
    "name": "Orders primary",
    "url": "https://new.example.com/webhooks",
    "description": "Updated description",
    "event_types": "[\"order.created\"]",
    "enabled": false,
    "updated_at": 1787739600
  }
}

Delete Endpoint

DELETE /api/v1/endpoints/:id

Response

HTTP 200 OK
json
{
  "deleted": true
}

Released under the MIT License.