# Token reference

> Every token you can use in a text field, grouped by where it comes from.

Source: https://docs.buildcord.dev/reference/tokens/

Write a token in braces. See [Values and tokens](https://docs.buildcord.dev/concepts/values) for how they work. A token that names nothing becomes empty.

## Who and where

Available in every flow that someone set off. Schedules and webhooks get only `{server.*}` and `{bot.*}` when they act in a server.

| Token | Value |
| --- | --- |
| `{user.mention}` | Mentions whoever set the flow off |
| `{user.name}` | Their display name |
| `{user.id}` | Their Discord ID |
| `{user.createdAt}` | When their account was made, in seconds since 1970 |
| `{user.voiceChannel}` | The voice channel they're in, if any |
| `{member.accountAge}`, `{member.timeInServer}` | How old their account is, and how long they've been a member, in seconds |
| `{member.roles}`, `{member.permissions}`, `{member.joinedAt}` | Their roles, permissions and join date, from a command, button or form |
| `{server.name}`, `{server.id}` | The server |
| `{server.memberCount}`, `{server.onlineCount}` | How many members it has, and how many are online |
| `{server.owner}`, `{server.icon}` | Its owner's ID, and its icon's address |
| `{server.boosts}`, `{server.boostTier}` | How many boosts it has, and its boost level |
| `{channel.name}`, `{channel.id}`, `{channel.mention}` | The channel this happened in |
| `{channel.parent}` | For a thread, the ID of the channel it's in. For a channel in a category, the category's ID |
| `{bot.id}`, `{bot.mention}` | The bot itself |
| `{bot.latency}` | The bot's ping, in milliseconds |
| `{bot.permissions}` | What the bot may do in the channel, from a command, button or form |

`{server.name}` and the other server values are looked up when a flow uses them, and kept a few minutes.

## Any time

| Token | Value |
| --- | --- |
| `{now}` | The time, in seconds. Write `<t:{now}:R>` to show it as a date. |
| `{run.id}` | This run's ID |

## Commands

| Token | Value |
| --- | --- |
| `{option.name}` | The value of the option with that name |
| `{target.id}` | The member a member option names, or else whoever ran it |

## Right-click commands

| Token | Value |
| --- | --- |
| `{target.id}`, `{target.mention}`, `{target.name}` | On a member: who it was opened on |
| `{message.content}`, `{message.link}`, `{message.author}` | On a message: the message, and who wrote it |

## Schedules

| Token | Value |
| --- | --- |
| `{run.time}` | When this run started |
| `{run.count}` | How many times this schedule has run, this one included |

## Buttons and menus

| Token | Value |
| --- | --- |
| `{component.data}` | What the button or menu was sent with, such as a row's number |
| `{component.message}` | The ID of the message it's on |
| `{component.choiceLabel}`, `{component.choice}` | From a menu: the choice made, and its ID |

## Webhooks

| Token | Value |
| --- | --- |
| `{webhook.body}` | What was sent, reached into with dots |
| `{webhook.text}` | What was sent, exactly as it came |
| `{webhook.query.name}` | A part of the address's query |

## Sub-flows

| Token | Value |
| --- | --- |
| `{input.name}` | In a sub-flow: what the flow that ran it gave it |
| `{result.name}` | After [Run another flow](https://docs.buildcord.dev/nodes/flow-control/run-flow): what the sub-flow handed back |

## Produced by steps

These exist after the step that makes them.

| Token | Made by | Value |
| --- | --- | --- |
| `{sent.id}`, `{sent.channel}`, `{sent.link}` | Any step that sends a message | The message, its channel and a link to it |
| `{fetched.content}`, `{fetched.author.id}` and more | [Read a message](https://docs.buildcord.dev/nodes/messages/read-message) | The message read |
| `{lookup.roles}`, `{lookup.joinedAt}` and more | [Look up a member](https://docs.buildcord.dev/nodes/members/look-up-member) | The member looked up |
| `{modal.label}` | [Send a form](https://docs.buildcord.dev/nodes/messages/send-form) | The answer to the input with that label |
| `{http.status}`, `{http.body}` | [Send an API request](https://docs.buildcord.dev/nodes/integrations/api-request) | The status code and the response |
| `{feed.item.title}`, `{feed.item.link}` and more | [Check a feed](https://docs.buildcord.dev/nodes/integrations/check-feed) | The newest item |
| `{code.key}` or `{code.result}` | [Run code](https://docs.buildcord.dev/nodes/integrations/run-code) | What the snippet returned |
| `{row.id}`, `{row.column}`, `{rows.count}` | [Find rows](https://docs.buildcord.dev/nodes/variables-and-data/find-rows), [For each row](https://docs.buildcord.dev/nodes/variables-and-data/for-each-row), [Pick at random](https://docs.buildcord.dev/nodes/variables-and-data/pick-at-random) | A row's number and columns, and how many matched |
| `{inserted.id}` | [Add row](https://docs.buildcord.dev/nodes/variables-and-data/add-row) | The new row's number |
| `{upserted.id}`, `{upserted.created}` | [Add or change a row](https://docs.buildcord.dev/nodes/variables-and-data/add-or-change-row) | The row, and whether it was new |
| `{updated.count}` | [Change rows](https://docs.buildcord.dev/nodes/variables-and-data/change-rows) | How many rows changed |
| `{list.count}`, `{list.item}` | [Change a list](https://docs.buildcord.dev/nodes/variables-and-data/change-list) | How long the list is, and what was taken off |
| `{loop.index}`, `{loop.item}` | [Repeat](https://docs.buildcord.dev/nodes/flow-control/repeat), [For each item](https://docs.buildcord.dev/nodes/flow-control/for-each), [For each row](https://docs.buildcord.dev/nodes/variables-and-data/for-each-row) | The pass, starting at 1, and the item |
| `{temp.name}` | [Set a unique variable](https://docs.buildcord.dev/nodes/variables-and-data/unique-variable), [Manipulate text](https://docs.buildcord.dev/nodes/variables-and-data/manipulate-text), [Work out an equation](https://docs.buildcord.dev/nodes/variables-and-data/work-out-equation), [Date and time](https://docs.buildcord.dev/nodes/variables-and-data/date-and-time), [Read JSON](https://docs.buildcord.dev/nodes/variables-and-data/read-json), [Count or total rows](https://docs.buildcord.dev/nodes/variables-and-data/count-rows), [Pick at random](https://docs.buildcord.dev/nodes/variables-and-data/pick-at-random) | A value that lasts for this run |
| `{invite.url}`, `{invite.code}` | [Create server invite](https://docs.buildcord.dev/nodes/server/create-invite) | The invite |
| `{created.channel}`, `{created.channel.mention}` | [Create a channel](https://docs.buildcord.dev/nodes/server/create-channel), [Create a voice channel](https://docs.buildcord.dev/nodes/voice/create-voice-channel) | The channel |
| `{created.role}`, `{created.role.mention}` | [Create a role](https://docs.buildcord.dev/nodes/server/create-role) | The role |
| `{thread.id}`, `{thread.mention}` | [Create a thread](https://docs.buildcord.dev/nodes/server/create-thread), [Create a forum post](https://docs.buildcord.dev/nodes/server/forum-post) | The thread |
| `{created.event}`, `{created.event.link}` | [Schedule an event](https://docs.buildcord.dev/nodes/server/schedule-event) | The event |
| `{created.emoji}` | [Add an emoji](https://docs.buildcord.dev/nodes/server/add-emoji) | The emoji |
| `{purged.count}` | [Purge messages](https://docs.buildcord.dev/nodes/server/purge-messages) | How many were deleted |
| `{bulk.count}` | [Change a role for many](https://docs.buildcord.dev/nodes/members/change-role-for-many) | How many members changed |
| `{error.message}` | Any step that fails into its error way out, or a [Try](https://docs.buildcord.dev/nodes/flow-control/try) | What went wrong |

## Documents

A token can hold a document, such as an API's answer or JSON read in: reach into it with dots (`{http.body.user.name}`), into a list by position from 0 (`{http.body.items.0}`), and ask a list's length with `.length`. A document written whole comes out as JSON.

## Variables and secrets

| Token | Value |
| --- | --- |
| `{var.name}` | The variable with that name, such as `{var.points}` |
| `{secret.NAME}` | A secret. Only [Send an API request](https://docs.buildcord.dev/nodes/integrations/api-request) and a webhook address in [Send as someone else](https://docs.buildcord.dev/nodes/messages/send-as-someone-else) fill it in. |

## Events

Event flows add their own tokens. See [Events](https://docs.buildcord.dev/reference/events).
