KlockworkKlockworkAPI
Partner

Customers

List, invite, and end partner customers.

List customers

GET /api/public/partner/customers

Scope: customers:read

{
  "customers": [
    {
      "id": "uuid",
      "companyName": "Northwind",
      "invoiceEmail": "billing@northwind.example",
      "status": "pending",
      "customerClerkOrgId": null,
      "associatedAt": null,
      "inviteUrl": "https://app.klockwork.org/partner-invites/..."
    }
  ]
}

status is pending, active, suspended, or ended. customerClerkOrgId and associatedAt are set after the customer accepts. inviteUrl is present only while the customer is pending and an invite token still exists. Newest customers are first.

A list failure returns 500 with { "error": "Failed to list customers" }.

Create a customer

POST /api/public/partner/customers

Scope: customers:write

{
  "companyName": "Northwind",
  "invoiceEmail": "billing@northwind.example"
}

companyName is required, trimmed, and at most 160 characters. invoiceEmail is a required email, trimmed, and at most 200 characters. A body that fails those checks returns 400 with { "error": "Validation failed", "details": {} }.

A successful create returns 201:

{
  "customer": {
    "id": "uuid",
    "companyName": "Northwind",
    "invoiceEmail": "billing@northwind.example",
    "status": "pending",
    "customerClerkOrgId": null,
    "associatedAt": null,
    "inviteUrl": "https://app.klockwork.org/partner-invites/..."
  },
  "inviteUrl": "https://app.klockwork.org/partner-invites/...",
  "invitationSent": true
}

The customer starts as pending. Klockwork emails the invite link. invitationSent is true when that email was handed to the mailer. The invite URL is still returned when the email is skipped.

If this partner already has a pending, active, or suspended customer with the same email, the response is 409 with { "error": "An invite for this email is already open" }.

End a customer

POST /api/public/partner/customers/{id}/end

Scope: customers:write

id is the customer id from the list. There is no request body. Success is { "ok": true }.

An unknown id for this partner returns 404 with { "error": "Customer not found" }. Ending a relationship that is already ended returns 400 with { "error": "This relationship is already ended" }. A handler failure returns 500 with { "error": "Failed to end relationship" }.

On this page