Skip to main content
POST
/
custom_fields
Create a custom field
curl --request POST \
  --url https://app.supercycle.com/api/v1/custom_fields \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "owner_id": 123,
  "value": "<string>",
  "definition_id": 123,
  "key": "<string>",
  "owner_type": "item"
}
'
{
  "id": 123,
  "ownerId": 123,
  "ownerType": "Item",
  "definitionId": 123,
  "key": "<string>",
  "value": "<string>",
  "valueJson": "<unknown>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
owner_id
integer<int64>
required

ID of the item or rental to attach the custom field to.

value
string
required

Value of the custom field.

definition_id
integer<int64>

ID of the custom field definition. Required if key/owner_type not provided.

key
string

Key of the custom field definition. Required with owner_type if definition_id not provided.

owner_type
enum<string>

Type of owner resource. Required with key if definition_id not provided.

Available options:
item,
rental

Response

Custom field created successfully

id
integer<int64>
required

Numeric ID of the custom field.

ownerId
integer<int64>
required

ID of the item or rental that owns this custom field.

ownerType
enum<string>
required

Type of the owner resource.

Available options:
Item,
Rental
definitionId
integer<int64>
required

ID of the custom field definition.

key
string
required

Key of the custom field definition.

value
string
required

Raw stored value of the custom field.

valueJson
any

Typed JSON value of the custom field (format depends on definition type).