Update a fee operator
Changes the fields you send and leaves the rest untouched.
PUT /fee-operators/{op_id}
Changes the fields you send and leaves the rest untouched. A new name or value is saved as a new revision; is_searchable alone only changes sharing. Only the owner can update a fee operator.
- Send the
sequenceyou last read asexpected_sequence: if the record changed since, the update is refused with 409 (details.expected/details.actual). operatorandcurrency_codecannot be changed (422); create a new fee operator instead. Adivoperator cannot get a zerovalue(422).- 404: the fee operator does not exist or is not visible to you.
- 409: it is visible but not yours (an official record or another user's shared record). Fork it to get an editable copy.
[!warning] Calculation chains reference operators by ID and use their current revision, so the change applies immediately to every chain that uses this fee operator, including other users' chains if you have shared it.
Usage
| Name | Description |
|---|---|
| Authentication | API key required |
| Credit cost | Free |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
op_id | path | integer | Yes | ID of the fee operator. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | New display name. Default: ``. |
operator | string or null | No | Not updatable. Sending this field is rejected with 422; create a new fee operator instead. Values: add, sub, mul, div. |
currency_code | string or null | No | Not updatable. Sending this field is rejected with 422; create a new fee operator instead. |
value | number or string | No | New operand, as an exact decimal with at most 12 decimal places. Must not be zero for a div fee. Default: 0. |
is_searchable | boolean | No | Share or stop sharing the fee operator. Unsharing hides it from search and new references; existing references keep working. Default: false. |
expected_sequence | integer or null | No | The sequence you last read. If the record changed since, the request is rejected with 409 conflict (details.expected / details.actual) and nothing is saved. Omit it to skip the check. |
reason | string | No | Optional note saved with the new revision, shown in its history. Default: ``. |
Responses
| Status | Description | Schema |
|---|---|---|
200 | Successful Response | Envelope_FeeOperatorOut_ |
400 | The request references a resource that does not exist, or carries an invalid cursor | ErrorEnvelope |
401 | Authentication is missing or invalid | ErrorEnvelope |
403 | The credential is valid but not allowed to call this operation | ErrorEnvelope |
404 | The requested resource does not exist | ErrorEnvelope |
409 | The request conflicts with the current state of a resource | ErrorEnvelope |
422 | A parameter or the request body is invalid | ErrorEnvelope |
429 | Too many requests to this endpoint; retry later | ErrorEnvelope |
503 | The service is temporarily unavailable; retry later | ErrorEnvelope |
Models
CreditMeta
Credit accounting for a billable request.
| Field | Type | Required | Description |
|---|---|---|---|
cost | integer | Yes | Credits this request costs. |
remaining | integer | Yes | Estimated credit balance left after this request. A hint rather than a ledger: concurrent requests can make it slightly off. |
Envelope_FeeOperatorOut_
| Field | Type | Required | Description |
|---|---|---|---|
data | FeeOperatorOut | Yes | The endpoint payload. |
meta | Meta | Yes | Request metadata. |
ErrorBody
Details of a failed request.
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Stable machine-readable error code. Branch on this value, not on message. |
message | string | Yes | Human-readable explanation. The wording may change. |
details | object or null | No | Optional structured context, such as the list of validation errors or, for credit_insufficient, the required and remaining credits. |
ErrorEnvelope
Error response: the error in error plus request metadata in meta.
FeeOperatorOut
A fee operator: one arithmetic step applied to the running amount.
| Field | Type | Required | Description |
|---|---|---|---|
kind | "fee" | Yes | Record type: always fee. |
id | integer or null | Yes | Unique ID of the fee operator. |
name | string | Yes | Display name. |
operator | string | Yes | Arithmetic applied to the running amount: add, sub, mul or div. Values: add, sub, mul, div. |
value | string | Yes | Operand of the arithmetic, as a decimal string. |
currency_code | string or null | Yes | Currency of the amount for add and sub; null for mul and div. |
owner_user_id | string or null | Yes | ID of the owning user; null for platform-owned records, which include every official record. |
is_official | boolean | Yes | Whether this is an official fee operator published by the platform. Official records are read-only for users. |
is_searchable | boolean | Yes | Whether the owner shares this fee operator, so other users can find, reference and fork it. |
ref_count | integer | Yes | How many times this fee operator is referenced (by calculation chain steps) or has been forked. Informational only. |
forked_from | integer or null | Yes | ID of the fee operator this one was forked from; null if it was created from scratch. |
is_deleted | boolean | Yes | Whether the fee operator is deleted. Deleted records are never returned again, so this is true only in a delete response. |
revision | integer or null | Yes | Current revision of the fee operator: 1 when created, one more with every saved change. null only for an inline record. |
sequence | integer or null | Yes | Change counter of the fee operator: rises with every saved revision and every change of sharing or lifecycle. Send it back as expected_sequence to detect concurrent changes. |
Meta
Request metadata included in every enveloped response.
| Field | Type | Required | Description |
|---|---|---|---|
request_id | string | Yes | Unique identifier of this request, identical to the X-Request-ID response header. Quote it when contacting support. |
billable | boolean or null | No | Whether the request is billed in credits. Present only on metered endpoints; false means the request is free, for example because it costs nothing or your subscription covers it. |
credit | CreditMeta or null | No | Cost of the request and your estimated remaining balance. Present only when billable is true. |
page | PageMeta or null | No | Paging state. Present only on a response that lists a page. |
PageMeta
Where a paged list stands after this page.
| Field | Type | Required | Description |
|---|---|---|---|
limit | integer | Yes | Page size actually applied to this request. |
has_next | boolean | Yes | Whether another page follows. |
next_cursor | string or null | Yes | Pass it back unchanged as cursor to get the next page; null once the list is complete. |