/api/v1/asset-events/{event}
Update an asset event definition
Update an asset event definition in the organization attached to your public API key.
Last updated
Request
PATCH /api/v1/asset-events/{event}
Requires asset-events:update and an active token creator who remains an administrator of the token’s organization. Event setup and permissions.
Send Authorization: Bearer YOUR_API_TOKEN and Accept: application/json.
Path parameters
-
eventinteger Required - Definition ID from list definitions. Use the returned replacement ID after customizing a shared default.
Query parameters
This endpoint does not use query parameters.
Request body
Send JSON with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | No | Display name, 3–255 characters. |
icon |
string | No | Available icon name, up to 100 lowercase letters, numbers, or hyphens. Use setup options; defaults to box when creating. |
color |
string | No | Color from setup options; defaults to gray when creating. |
visible |
boolean | No | Whether this definition is offered for new events; defaults to true when creating. |
limit_to_categories |
integer array | No | Distinct asset category IDs in this organization. An empty list means no category restriction and is the creation default. |
cost_category_id |
integer or null | No | Organization cost category ID for lifecycle events. Defaults to null. Send null to clear it; other groups always store null. |
fields |
object array | No | Complete replacement field list. See field definitions below. Omit to preserve fields on PATCH; creation uses the selected group’s defaults. |
Field definitions
A supplied fields array replaces the complete list, with at most 100 entries. Each entry accepts only the following properties. Preserve every existing field you want to keep and strip read-only response properties before sending it.
| Field | Type | Required | Description |
|---|---|---|---|
id |
integer or null | Yes | Existing field ID from this definition, or null for a new field. Existing IDs must be distinct. |
slug |
string or null | Yes | Existing immutable slug, an available built-in slug from options, or null for a new custom field. Built-in slugs must be unique within the list. |
name |
string | Yes | Display label, 2–255 characters. |
datatype |
string | Yes | text, number, date, boolean, yesno, phone, or editor. New built-ins use their server-defined datatype. System fields and fields with saved values cannot change datatype. |
size |
string | Yes | Display width: full or half. |
is_required |
boolean | Yes | Whether a value is required. Always normalized to false for boolean fields and acquisition fields. |
visible |
boolean | Yes | Whether the field is shown. Set false to hide a field while retaining its history. |
Acquisition definitions accept only built-in fields. Other groups also accept custom fields with a null slug. Use setup options to discover each group’s built-ins. is_system, has_values, and position are read-only; omit them from field payloads. The array order determines field position. Adding required fields does not backfill historical values.
Retry protection
Requires Idempotency-Key: 8–128 letters, numbers, dots, underscores, colons, or hyphens. Reuse the same method, path, body, and key for retries. Successful responses are remembered for 24 hours per token. Conflicting key reuse returns 409. Idempotency and retries.
Example
Replace the example ID with an ID from your organization. Set ASSETCENTER_API_TOKEN as described in the quick start.
curl --request PATCH "https://my.assetcenter.app/api/v1/asset-events/42" \
--header "Authorization: Bearer $ASSETCENTER_API_TOKEN" \
--header "Accept: application/json" \
--header "Idempotency-Key: $(uuidgen)" \
--header "Content-Type: application/json" \
--data '{"visible":false}'
For retries, reuse the original key instead of generating another UUID.
Response
200 OK. Illustrative values; IDs and positions will differ.
{
"data": {
"id": 42,
"group": "lifecycle",
"name": "Inspection",
"icon": "box",
"color": "gray",
"visible": false,
"is_system": false,
"is_global": false,
"parent_id": null,
"position": 3,
"limit_to_categories": [],
"cost_category_id": null,
"can_delete": true,
"fields": []
}
}
Behavior and constraints
PATCH changes only supplied fields and requires at least one writable property. Omitting fields preserves all existing fields and their IDs. A supplied array replaces the complete list and sets its order; fields with saved values cannot be omitted or change datatype. Send visible: false to hide a definition or field. Group, slug, tenant, parent, system identity, and direct position changes are rejected. Updating a shared default creates new event and field IDs; use the returned IDs. The shared original and historical values remain unchanged. Retry with the same key to replay the original response after localization.
Errors
401 means the customer token is missing, invalid, expired, or revoked, or its creator is inactive. 403 means the required permission or administrator membership is missing. 404 means the definition is unavailable in the token’s organization, including a shared ID already overridden. 422 means invalid or unsupported input. 429 means the rate limit was reached. Errors and limits. 409 means conflicting idempotency-key reuse or a protected deletion.