OpenRCS API reference · v1 ← Back to console Swagger UI
Accounts

Edit account info (company / phone / billing contact / webhook)

PATCH /account bearer_auth

Partial PATCH of the account-level `account_info` map. Send any subset of the four groups; every sub-field is optional and the map is extensible, so PATCHing one group or sub-field preserves the others (partial merge: `{"company":{"city":"Paris"}}` does not erase a previously-saved `company.name`). Availability: only when the account `status` is `ready`; otherwise the response is `409 account not ready`. Groups: - `company` — invoice-grade company block ("all info necessary to issue an invoice"); every sub-field optional. - `phone_number` — single account-level E.164 string, gated by the server's `ALLOWED_PHONE_PREFIXES` env var (default `+33`); numbers with a disallowed prefix are rejected with `400`. - `billing_contact` — only `name` + `email` (there is intentionally no `phone` sub-field here). - `webhook` — `url` + `api_key`; empty string clears the stored value, omitted sub-field leaves it untouched.

Parameters

NameInTypeRequiredDescription
Authorization header string yes `Bearer <token>` obtained from `POST /login`.

Request body

FieldTypeRequiredDescription
company object no Invoice-grade company block; sub-fields optional, map extensible.
phone_number string no Account-level E.164 phone; prefix-gated by `ALLOWED_PHONE_PREFIXES` (default `+33`).
billing_contact object no Billing contact — only name and email (no phone).
webhook object no Delivery webhook (event receiver) — partial merge like the other groups; empty string clears, omitted sub-field untouched. Non-string sub-values (including JSON null) are rejected with 400.
{
  "company": {
    "name": "Acme SARL",
    "vat_id": "FR12345678901",
    "address": "12 rue Exemple",
    "city": "Paris",
    "postal_code": "75001",
    "country": "FR",
    "registration_number": "123 456 789"
  },
  "phone_number": "+33123456789",
  "billing_contact": {
    "name": "Jane Doe",
    "email": "billing@acme.com"
  },
  "webhook": {
    "url": "https://hook.example/ingest?token=sekret",
    "api_key": ""
  }
}

Responses

StatusDescription
200 The full merged `account_info` object after the partial PATCH was applied.
400 Invalid JSON, bad phone format, disallowed phone prefix, bad email, control characters, field too long, invalid webhook URL, or non-object `company` / `billing_contact` / `webhook`.
401 Missing or invalid credentials.
404 Account not found.
409 Account is not ready yet (`status` is not `ready`).
502 Internal error, please try again.

200 example

{
  "account_info": {
    "company": {
      "name": "Acme SARL",
      "city": "Paris",
      "country": "FR"
    },
    "phone_number": "+33123456789",
    "billing_contact": {
      "name": "Jane Doe",
      "email": "billing@acme.com"
    }
  }
}