/api/v1/asset-events
Create an asset event definition
Create an asset event definition in the organization attached to your public API key.
Last updated
Request
POST /api/v1/asset-events
Requires asset-events:create 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.
Query parameters
This endpoint does not use query parameters.
Request body
Send JSON with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
group |
string | Yes | One of acquisition, lifecycle, condition, or decommission. Cannot change after creation. |
name |
string | Yes | 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 POST "https://my.assetcenter.app/api/v1/asset-events" \
--header "Authorization: Bearer $ASSETCENTER_API_TOKEN" \
--header "Accept: application/json" \
--header "Idempotency-Key: $(uuidgen)" \
--header "Content-Type: application/json" \
--data '{"group":"lifecycle","name":"Inspection","fields":[]}'
For retries, reuse the original key instead of generating another UUID.
Response
201 Created. Illustrative values; IDs and positions will differ.
{
"data": {
"id": 42,
"group": "lifecycle",
"name": "Inspection",
"icon": "box",
"color": "gray",
"visible": true,
"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
Only group and name are required. The definition is created in the token’s organization as a custom event and appended to its group. Omitted fields use group defaults; send an empty list for no fields. The returned definition includes fields and can_delete, as described in get a definition. Protected IDs, system flags, timestamps, position, and unknown input return 422.
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.