Skip to content

PUT   /lookup/{table}/{field}/id/{id}

Update a lookup value by ID

Updates an existing lookup value identified by its ID for a specific table and field. Only account administrators can update lookup values.

Authentication Required

Authorization: Bearer {token}   header string

This header is required to access this endpoint

Required Parameters

x-account-id   header string

Account ID for the request

table   path string

The table name containing the lookup value

field   path string

The field name containing the lookup value

id   path integer

The ID of the lookup option to update

Request Body

{}

Try it out

Loading...

Output:

Responses

Description

Lookup value updated successfully

{
"message": "Lookup value updated successfully",
"lookupValue": {
"id": 0,
"text": "string",
"value": "string",
"displayOrder": 0,
"metadata": {},
"parent_id": 0,
"custom_sort_index": 0,
"group_name": "string",
"locale": "string",
"description": "string",
"is_active": false,
"expires_at": "string"
}
}

References

#/components/parameters/xAccountIdHeader

in: header
name: x-account-id
schema:
type: string
description: Account ID for the request
required: true
example: "2311"

#/components/schemas/UpdateLookupValue

type: object
description: Input for updating a lookup value
properties:
text:
type: string
description: Display text for the lookup option
value:
type: string
description: Internal value for the lookup option
parent_id:
type: integer
nullable: true
description: ID of the parent lookup option if this is a child option
custom_sort_index:
type: integer
nullable: true
description: Custom index for sorting the lookup options
displayOrder:
type: integer
description: Order in which the option should be displayed
group_name:
type: string
nullable: true
description: Group name for organizing lookup options
locale:
type: string
nullable: true
description: Locale code for internationalization
description:
type: string
nullable: true
description: Detailed description of the lookup option
is_active:
type: boolean
description: Whether the lookup option is active
metadata:
type: object
nullable: true
description: Additional data to store with the lookup option
expires_at:
type: string
format: date-time
nullable: true
description: Expiration date and time for the lookup option

#/components/schemas/LookupOption

type: object
description: Lookup option for a specific table/field combination
properties:
id:
type: integer
description: Unique identifier for the lookup option
text:
type: string
description: Display text for the lookup option
value:
type: string
description: Internal value of the lookup option
displayOrder:
type: integer
description: Order in which the option should be displayed
metadata:
type: object
description: Additional data associated with the lookup option
parent_id:
type: integer
description: ID of the parent lookup option if this is a child option
custom_sort_index:
type: integer
description: Custom index for sorting the lookup options
group_name:
type: string
description: Group name for organizing lookup options
locale:
type: string
description: Locale code for internationalization
description:
type: string
description: Detailed description of the lookup option
is_active:
type: boolean
description: Whether the lookup option is active
expires_at:
type: string
format: date-time
description: Expiration date and time for the lookup option
required:
- id
- value

#/components/schemas/Error

type: object
properties:
error:
type: string
description: Error message
status:
type: integer
description: HTTP status code
message:
type: string
description: Detailed error message
description: Error response object
required:
- error

Route Source Code

Check out the source code for this route entrypoint here: /lookup/[table]/[field]/id/[id]/route.ts

Or the swagger.yaml spec this documentation was generated from: /lookup/swagger.yaml