> ## 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.

# Object action

> Add an action that can be taken on an object

Object actions are actions your app can take on an **object**, as opposed to a single record. They are rendered in two places: the actions menu on the object's record list page, and the CMD+K quick action palette. Use them for object-level work like imports, syncs, or opening object-wide views.

Add an object action by creating an extension folder under `src/app/extensions/` whose `extension.tsx` default-exports a `defineExtension` call with `type: "object-action"`. See [App structure](./overview) for the discovery rules.

## Example

```tsx src/app/extensions/import-companies/extension.tsx theme={"system"}
import {Extensions} from "attio/client"

export default Extensions.defineExtension({
  type: "object-action",
  id: "import-companies",
  label: "Import companies",
  onTrigger: async ({object}) => {
    // Run code here
  },
  objects: "companies",
})
```

## Arguments

<ParamField path="type" type="&#x22;object-action&#x22;" required>
  Identifies this extension as an object action.
</ParamField>

<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 object 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 ({ object: ObjectSlug }) => Promise<void>">
  The function to run when the action is triggered. It receives the [object
  slug](/docs/objects-and-lists) it was triggered on. 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> | (info) => boolean">
  A single slug, an array of slugs, or a predicate to select which objects the action will apply
  to. The predicate receives `{object}` and returns whether the action should be shown.

  Defaults to `undefined`, which will cause the action to show on ***all*** objects.

  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>
