Unique ID field
- cURL
- JSON
curl -X POST https://api.tapeapp.com/v1/app/ \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"workspace_id": 1,
"name": "Deals",
"item_name": "Deal",
"fields": [
{
"field_type": "single_text",
"config": {
"label": "Deal Name",
"description": "The name of the deal.",
"required": true
}
},
{
"field_type": "unique_id",
"config": {
"label": "Deal ID",
"description": "The ID of the deal.",
"settings": {
"prefix": "DEAL-",
"min_digits": 4
}
}
}
]
}'
{
"workspace_id": 1,
"name": "Deals",
"item_name": "Deal",
"fields": [
{
"field_type": "single_text",
"config": {
"label": "Deal Name",
"description": "The name of the deal.",
"required": true
}
},
{
"field_type": "unique_id",
"config": {
"label": "Deal ID",
"description": "The ID of the deal.",
"settings": {
"prefix": "DEAL-",
"min_digits": 4
}
}
}
]
}
{
"app_id": 1,
"workspace_id": 1,
"slug": "deals",
"external_id": "deals",
"name": "Deals",
"record_name": "Deal",
"item_name": "Deal",
"type": "database",
"config": {
"item_name": "Deal",
"name": "Deals"
},
"fields": [
{
"field_id": 1,
"external_id": "deal_name",
"slug": "deal_name",
"label": "Deal Name",
"type": "text",
"field_type": "single_text",
"config": {
"label": "Deal Name",
"slug": "deal_name",
"external_id": "deal_name",
"description": "The name of the deal.",
"show_description": true,
"required": true,
"always_hidden": false,
"hidden_if_empty": false,
"primary": true,
"settings": {
"formatted": false,
"format": "plain"
}
}
},
{
"field_id": 2,
"external_id": "deal_id",
"slug": "deal_id",
"label": "Deal ID",
"type": "unique_id",
"field_type": "unique_id",
"config": {
"label": "Deal ID",
"slug": "deal_id",
"external_id": "deal_id",
"description": "The ID of the deal.",
"show_description": false,
"required": false,
"always_hidden": false,
"hidden_if_empty": false,
"primary": false,
"settings": {
"prefix": "DEAL-",
"min_digits": 4,
"unit_location": "prefix",
"unit_label": "DEAL-",
"unit": "DEAL-"
}
}
}
]
}
- cURL
- JSON
curl -X PUT https://api.tapeapp.com/v1/app/1 \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"fields": [
{
"field_id": 2,
"config": {
"label": "Deal ID",
"description": "The ID of the deal.",
"settings": {
"prefix": "DEAL-",
"suffix": "-EU",
"min_digits": 5
}
}
}
]
}'
{
"fields": [
{
"field_id": 2,
"config": {
"label": "Deal ID",
"description": "The ID of the deal.",
"settings": {
"prefix": "DEAL-",
"suffix": "-EU",
"min_digits": 5
}
}
}
]
}
{
"app_id": 1,
"workspace_id": 1,
"slug": "deals",
"external_id": "deals",
"name": "Deals",
"record_name": "Deal",
"item_name": "Deal",
"type": "database",
"config": {
"item_name": "Deal",
"name": "Deals"
},
"fields": [
{
"field_id": 1,
"external_id": "deal_name",
"slug": "deal_name",
"label": "Deal Name",
"type": "text",
"field_type": "single_text",
"config": {
"label": "Deal Name",
"slug": "deal_name",
"external_id": "deal_name",
"description": "The name of the deal.",
"show_description": true,
"required": true,
"always_hidden": false,
"hidden_if_empty": false,
"primary": true,
"settings": {
"formatted": false,
"format": "plain"
}
}
},
{
"field_id": 2,
"external_id": "deal_id",
"slug": "deal_id",
"label": "Deal ID",
"type": "unique_id",
"field_type": "unique_id",
"config": {
"label": "Deal ID",
"slug": "deal_id",
"external_id": "deal_id",
"description": "The ID of the deal.",
"show_description": true,
"required": false,
"always_hidden": false,
"hidden_if_empty": false,
"primary": false,
"settings": {
"prefix": "DEAL-",
"suffix": "-EU",
"min_digits": 5,
"unit_location": "prefix_and_suffix",
"unit_label": "DEAL-",
"unit": "DEAL-"
}
}
}
]
}
Use a unique ID field to give every record of a database app a readable ID, like DEAL-0012.
Tape has one unique ID field type: unique_id is the Unique ID field. Tape fills it and counts up per database app: the first record gets 1, the second 2, and so on. You can't set the value yourself.
The number is the record's app_record_id, which every record returns, with or without a Unique ID field. The field adds a prefix, a suffix and leading zeros to it.
A unique ID field has the common field properties and the settings below. To read the unique ID of a record, see Field value.
{
"field_id": 2,
"external_id": "deal_id",
"slug": "deal_id",
"label": "Deal ID",
"type": "unique_id",
"field_type": "unique_id",
"config": {
"label": "Deal ID",
"slug": "deal_id",
"external_id": "deal_id",
"description": "The ID of the deal.",
"show_description": true,
"required": false,
"always_hidden": false,
"hidden_if_empty": false,
"primary": false,
"settings": {
"prefix": "DEAL-",
"min_digits": 4,
"unit_location": "prefix",
"unit_label": "DEAL-",
"unit": "DEAL-"
}
}
}
typestring
"unique_id".
field_typestring
"unique_id".
config.settings.min_digitsnumber
Minimum number of digits, from 1 to 12. Tape fills shorter numbers with leading zeros. A new field without min_digits gets 1.
config.settings.prefixstring
Text in front of the number, for example "DEAL-" for deals or "TASK-" for tasks.
config.settings.suffixstring
Text after the number.
config.settings.unit_locationstring
Which labels Tape shows: "prefix", "suffix" or "prefix_and_suffix".
config.settings.unitstring
The prefix, or the suffix if unit_location is "suffix". Kept for compatibility with number fields.
config.settings.unit_label (read-only)string
Same as unit, kept for backwards compatibility.
| Property | Type | Description | Example value |
|---|---|---|---|
type | string | "unique_id". | "unique_id" |
field_type | string | "unique_id". | "unique_id" |
config.settings.min_digits | number | Minimum number of digits, from 1 to 12. Tape fills shorter numbers with leading zeros. A new field without min_digits gets 1. | 4 |
config.settings.prefix | string | Text in front of the number, for example "DEAL-" for deals or "TASK-" for tasks. | "DEAL-" |
config.settings.suffix | string | Text after the number. | "-EU" |
config.settings.unit_location | string | Which labels Tape shows: "prefix", "suffix" or "prefix_and_suffix". | "prefix" |
config.settings.unit | string | The prefix, or the suffix if unit_location is "suffix". Kept for compatibility with number fields. | "DEAL-" |
config.settings.unit_label (read-only) | string | Same as unit, kept for backwards compatibility. | "DEAL-" |
Record responses return the value of a unique ID field like other field values, for example { "value": 12, "formatted": "DEAL-0012" }. value is the number without prefix and suffix, formatted is the ID as Tape shows it.
App creation
Use the create app endpoint to create unique ID fields together with a new app.
/v1/appapi.tapeapp.com- cURL
- JSON
curl -X POST https://api.tapeapp.com/v1/app/ \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"workspace_id": 1,
"name": "Deals",
"item_name": "Deal",
"fields": [
{
"field_type": "single_text",
"config": {
"label": "Deal Name",
"description": "The name of the deal.",
"required": true
}
},
{
"field_type": "unique_id",
"config": {
"label": "Deal ID",
"description": "The ID of the deal.",
"settings": {
"prefix": "DEAL-",
"min_digits": 4
}
}
}
]
}'
{
"workspace_id": 1,
"name": "Deals",
"item_name": "Deal",
"fields": [
{
"field_type": "single_text",
"config": {
"label": "Deal Name",
"description": "The name of the deal.",
"required": true
}
},
{
"field_type": "unique_id",
"config": {
"label": "Deal ID",
"description": "The ID of the deal.",
"settings": {
"prefix": "DEAL-",
"min_digits": 4
}
}
}
]
}
{
"app_id": 1,
"workspace_id": 1,
"slug": "deals",
"external_id": "deals",
"name": "Deals",
"record_name": "Deal",
"item_name": "Deal",
"type": "database",
"config": {
"item_name": "Deal",
"name": "Deals"
},
"fields": [
{
"field_id": 1,
"external_id": "deal_name",
"slug": "deal_name",
"label": "Deal Name",
"type": "text",
"field_type": "single_text",
"config": {
"label": "Deal Name",
"slug": "deal_name",
"external_id": "deal_name",
"description": "The name of the deal.",
"show_description": true,
"required": true,
"always_hidden": false,
"hidden_if_empty": false,
"primary": true,
"settings": {
"formatted": false,
"format": "plain"
}
}
},
{
"field_id": 2,
"external_id": "deal_id",
"slug": "deal_id",
"label": "Deal ID",
"type": "unique_id",
"field_type": "unique_id",
"config": {
"label": "Deal ID",
"slug": "deal_id",
"external_id": "deal_id",
"description": "The ID of the deal.",
"show_description": false,
"required": false,
"always_hidden": false,
"hidden_if_empty": false,
"primary": false,
"settings": {
"prefix": "DEAL-",
"min_digits": 4,
"unit_location": "prefix",
"unit_label": "DEAL-",
"unit": "DEAL-"
}
}
}
]
}
The example creates a deals app in the workspace with ID 1. The app gets a single_text field "Deal Name" and a unique_id field "Deal ID" with the prefix "DEAL-" and at least four digits.
Find the workspace ID with Retrieve workspaces.
General behavior
- Without
primary, Tape makes the first field of the request the primary field. It skipsunique_idfields when the request has fields of other types. - Without
unit_location, Tape sets it from the labels you send:"prefix"for a prefix,"suffix"for a suffix,"prefix_and_suffix"for both. - A new unique ID field doesn't show its
descriptionas help text yet (show_descriptionisfalse). To show it, send thedescriptionagain in a field update.
Requirements: apps:edit, and a workspace role that may edit apps in the workspace. Works with a personal access token, an OAuth access token or a user API key.
Errors
min_digitsabove 12 returns400.
App update
Use the update app endpoint to create new unique ID fields in an app or to change existing ones.
/v1/app/{appId}api.tapeapp.com- cURL
- JSON
curl -X PUT https://api.tapeapp.com/v1/app/1 \
-H "Authorization: Bearer $TAPE_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"fields": [
{
"field_id": 2,
"config": {
"label": "Deal ID",
"description": "The ID of the deal.",
"settings": {
"prefix": "DEAL-",
"suffix": "-EU",
"min_digits": 5
}
}
}
]
}'
{
"fields": [
{
"field_id": 2,
"config": {
"label": "Deal ID",
"description": "The ID of the deal.",
"settings": {
"prefix": "DEAL-",
"suffix": "-EU",
"min_digits": 5
}
}
}
]
}
{
"app_id": 1,
"workspace_id": 1,
"slug": "deals",
"external_id": "deals",
"name": "Deals",
"record_name": "Deal",
"item_name": "Deal",
"type": "database",
"config": {
"item_name": "Deal",
"name": "Deals"
},
"fields": [
{
"field_id": 1,
"external_id": "deal_name",
"slug": "deal_name",
"label": "Deal Name",
"type": "text",
"field_type": "single_text",
"config": {
"label": "Deal Name",
"slug": "deal_name",
"external_id": "deal_name",
"description": "The name of the deal.",
"show_description": true,
"required": true,
"always_hidden": false,
"hidden_if_empty": false,
"primary": true,
"settings": {
"formatted": false,
"format": "plain"
}
}
},
{
"field_id": 2,
"external_id": "deal_id",
"slug": "deal_id",
"label": "Deal ID",
"type": "unique_id",
"field_type": "unique_id",
"config": {
"label": "Deal ID",
"slug": "deal_id",
"external_id": "deal_id",
"description": "The ID of the deal.",
"show_description": true,
"required": false,
"always_hidden": false,
"hidden_if_empty": false,
"primary": false,
"settings": {
"prefix": "DEAL-",
"suffix": "-EU",
"min_digits": 5,
"unit_location": "prefix_and_suffix",
"unit_label": "DEAL-",
"unit": "DEAL-"
}
}
}
]
}
The example changes the "Deal ID" field (ID 2) of the deals app. It sets min_digits to 5 and adds the suffix "-EU". The 12th deal then shows as DEAL-00012-EU.
Find the app ID and the field IDs in the Developer view of the app.
General behavior
- A field with
field_idupdates that field. A field withoutfield_idcreates a new field and needs afield_type. - Send
prefixandsuffixtogether, even if only one of them changes. Withoutunit_location, Tape sets it from the labels in the request, so a request with onlysuffixshows only the suffix. - Without
min_digits, the minimum number of digits stays the same. - Changing the settings changes only how Tape shows the IDs. The numbers of the records stay the same.
- Send
required,always_hidden,hidden_if_emptyanddescriptionwith every field you update. Tape sets left-out switches tofalseand hides the help text withoutdescription. See Create and update fields. - Fields that aren't in the request stay unchanged.
Requirements: apps:edit, and Full access to the app. Works with a personal access token, an OAuth access token or a user API key.
Errors
- Every field you update needs
config.label, even if the label stays the same. Without it, Tape rejects the request with400andinput_validation. The message reads, for example,Invalid input: data/fields/0/config must have required property 'label'. min_digitsabove 12 returns400.