Skip to main content

Prefix

Prefixes define the numbering scheme for items within an organisation. Each prefix has a description, number format, and sequence counter.

Prefix Object​

FieldTypeDescription
idsnowflakethe prefix's unique identifier
organisation_idsnowflakethe prefix's organisation id
descriptionstringa description of the prefix
number_formatstringthe prefix number format template
number_digitsinteger?the number of digits to pad the number with zeros
last_numberintegerthe last assigned number in this prefix sequence
unique_numberbooleanwhether unique numbering is enforced
enabledbooleanwhether the prefix is enabled

Get Prefix​

GET /api/prefixes/{prefix.id}

Returns the prefix object for the given prefix id. Requires membership in the organisation that owns the prefix.

Error Responses​
Status CodeDescription
400The prefix or organisation was not found
403The user is not a member of the organisation

Update Prefix​

PATCH /api/prefixes/{prefix.id}

Updates a prefix. Requires the MANAGE_ORGANISATION permission for the organisation.

All parameters for this method are optional. Only the fields provided will be updated.

Parameters​
FieldTypeDescription
descriptionstring?a description of the prefix
last_numberinteger?the last assigned number; only increases are allowed
enabledboolean?whether the prefix is enabled
Notes​
  • number_format and unique_number are read-only and cannot be updated. Create a new prefix if a different number format is required.
  • last_number can only be increased, never decreased, to avoid number conflicts.
Error Responses​
Status CodeDescription
400The prefix or organisation was not found
403The user lacks the MANAGE_ORGANISATION permission

Delete Prefix​

DELETE /api/prefixes/{prefix.id}

Deletes a prefix. Requires the MANAGE_ORGANISATION permission for the organisation. The prefix must be disabled and have not been used (i.e., enabled is false and last_number is 0).

Error Responses​
Status CodeDescription
400The prefix or organisation was not found
400The prefix is enabled or has been used
403The user lacks the MANAGE_ORGANISATION permission