> ## Documentation Index
> Fetch the complete documentation index at: https://docs.attio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Record action

> Registers an action for records in Attio

<img className="dark:hidden" width="720" height="440" noZoom src="https://mintcdn.com/attio/2EyaTyByKNPeSVcd/images/record-action.png?fit=max&auto=format&n=2EyaTyByKNPeSVcd&q=85&s=5aa155a7e072505e191cf4106d79a314" data-path="images/record-action.png" />

<img className="hidden dark:block" width="720" height="440" noZoom src="https://mintcdn.com/attio/2EyaTyByKNPeSVcd/images/record-action-dark.png?fit=max&auto=format&n=2EyaTyByKNPeSVcd&q=85&s=7eef3b679a0df3e281616fa1cc45313d" data-path="images/record-action-dark.png" />

Record actions are rendered:

* on Record pages in Attio
* in the CMD+K quick action palette.

Register a record action by creating an `App.Record.Action` and adding it to the `record.actions`
array of your [`app.ts`](./app-ts) file.

## Example

```tsx send-invoice.ts theme={"system"}
import type {App} from "attio"

export const sendInvoiceAction: App.Record.Action = {
  id: "send-invoice",
  label: "Send Invoice",
  icon: "Sales",
  onTrigger: async ({recordId}) => {
    // Run code here
  },
  objects: "people",
}
```

```tsx app.ts theme={"system"}
import type {App} from "attio"

import {sendInvoiceAction} from "./send-invoice"

export const app: App = {
  record: {
    actions: [sendInvoiceAction],
    // ...
  },
  // ...
}
```

## Arguments

<ParamField path="id" type="string" required>
  The unique identifier for this action.

  It is only used internally; never shown to the user.
</ParamField>

<ParamField path="label" type="string" required>
  The human readable label for the record action.
</ParamField>

<ParamField path="icon" type="AttioIcon">
  An [`AttioIcon`](../icons) to display in the action.

  <Tip>
    If no `icon` prop is provided, it will default to your app's icon that you set up in the
    [Developer dashboard](https://build.attio.com).
  </Tip>
</ParamField>

<ParamField path="onTrigger" type="async ({ recordId: string }) => Promise<void>">
  The function to run when the action is triggered. You'll likely want to [show a
  dialog](../dialogs/show-dialog) or run a [server function](../server/server-functions) here.
</ParamField>

<ParamField path="objects" type="ObjectSlug | Array<ObjectSlug>">
  A single slug or an array of slugs to select which types of record the record action will apply to.

  Defaults to `undefined`, which will cause the action to show on ***all*** types of records.

  The built-in slugs are

  * [`"companies"`](../../docs/standard-objects/standard-objects-companies)
  * [`"people"`](../../docs/standard-objects/standard-objects-people)
  * [`"deals"`](../../docs/standard-objects/standard-objects-deals)
  * [`"users"`](../../docs/standard-objects/standard-objects-users)
  * [`"workspaces"`](../../docs/standard-objects/standard-objects-workspaces)
</ParamField>
