Skip to content

Approve or reject a self-service request.

Request

The webhook-mode counterpart of the portal's approve / reject buttons: the tenant's backend posts the decision here after acting on a `self_service.request.submitted` event. Validation, merge, offer or invitation creation, status transition and pub-sub all live in the selfservice package — this handler is a thin auth + scope check (`self_service`).

Security
BearerAuth
Path
requestIdstring, (uuid)required
Headers
X-Org-Idstring, (uuid)required

Organization the call is acting on. The authenticated service user must be a member of this organization in DeepAdmin; otherwise the request returns 404.

X-Environmentstringrequired

Environment the call is scoped to. Resources are isolated per environment.

Enum:"beta""production"
Bodyapplication/json
admin_claimsobject

Optional in the contract because configs with no admin-filled claims approve without one. The server-side coverage check (selfservice package) is what enforces presence when the config does have admin-filled keys — a missing key returns InvalidArgument. Wrapped in Option so the generated OpenAPI spec marks it optional; a plain json.RawMessage gets emitted as required by Encore regardless of json:omitempty.

decisionstringrequired

"approve" or "reject".

reasonstring

Required on reject. Stored as the request's rejection_reason and shown to the end-user in the rejection email.

curl -i -X POST \
  'https://docs.deepcredentials.swiss/_mock/docs/openapi/self-service-v1/b2b/v1/self-service/requests/{requestId}/decision' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'X-Environment: beta' \
  -H 'X-Org-Id: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \
  -d '{
    "decision": "approve",
    "admin_claims": {
      "is_employee": true
    }
  }'

Responses

Success response

Bodyapplication/json
offer_idstring, (uuid)required

UUID v4 identifier.

Example:"550e8400-e29b-41d4-a716-446655440000"
request_idstring, (uuid)required

UUID v4 identifier.

Example:"550e8400-e29b-41d4-a716-446655440000"
statusstringrequired
Response
{ "request_id": "9c9a1f7b-2a3e-4f4a-9d22-1a2b3c4d5e6f", "status": "approved", "offer_id": "d4e5f6a7-b8c9-0123-4567-89abcdef0123" }