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

# Create Action

> Create a logged or assigned action at a store.

Creates an action at a store. There are two kinds:

* **Logged:** something already done, such as a coaching conversation. Saved as done.
* **Assigned:** something someone needs to do. Saved as open.

> [!NOTE]
>
> Actions must be enabled for your workspace. Contact Xenia to enable it. Until then, every Actions endpoint returns `403` with "Actions are not enabled for this workspace."

## Permissions

The key acts as its default user, or the user in the `x-client-user` header (who must be in the workspace). That user's location access and role permissions apply.

Creating actions requires **Can View Actions** on the user's role. When Actions is turned on for a workspace, its Owner and Admin roles get Can View Actions.

## Path parameters

**workspaceId** `string\<uuid\>` *required*

UUID of the workspace. Must be the workspace your API key is bound to.

## Body: both kinds

**kind** `string` *required*

`logged` or `assigned`.

**locationId** `string\<uuid\>` *required*

A store the user has access to. That's a site-level location, or a bottom-level location if the workspace doesn't use levels. Parent locations, like a district or region, are refused.

**title** `string`

Up to 200 characters. At least one of `title` or `note` is required.

**note** `string`

Up to 10,000 characters. At least one of `title` or `note` is required.

**recheckAt** `string\<date-time\>`

When to check back.

## Body: logged only

**coached** `object[]`

Up to 50 people. Each is `{ "userId": "<uuid>" }` for a workspace user, or `{ "name": "Sam Lee" }` (up to 200 characters) for someone without an account. The same user can't be listed twice.

**completedAt** `string\<date-time\>`

When it was done. Defaults to now and can't be in the future.

## Body: assigned only

**assignees** `object[]` *required*

1 to 50 assignees, with no duplicates. Each is `{ "type": "user" | "team" | "role" | "location", "id": "<uuid>" }`. Every id must exist in the workspace.

**dueAt** `string\<date-time\>`

When it's due.

**evidenceRequired** `string` (default: none)

`none` or `photo`.

All timestamps are ISO 8601 with a timezone, such as `2026-11-20T17:00:00Z`. Date-only values are rejected.

Sending a field to the wrong kind is an error, such as "dueAt is only for assigned actions". Unknown fields are ignored.

## Response

Returns `200` with `{ "data": <action> }`.

* `completion` is `{ "kind": "open" }`, or `{ "kind": "done", "completedAt", "completedBy": { "id", "name" }, "note", "attachments" }`
* `coached` entries come back as `{ "kind": "user", "userId", "name" }` or `{ "kind": "name", "name" }`
* `createdVia` is read-only and shows where the action came from: `app`, `api`, or `mcp`

## Errors

Errors return the message at `error.message`.

| Status | When |
| - | - |
| `401` | Invalid client credentials |
| `403` | Actions are not enabled for this workspace |
| `403` | The user's role doesn't have Can View Actions |
| `403` | The user doesn't have access to this location |
| `422` | Invalid input, including a bad uuid. The message names the problem, such as "title or note is required" or "Not found in this workspace: user 2b7e…" |

> [!NOTE]
>
> The `422` body is `{ "error": { "message": "..." } }` only, without the extra fields shown on the [Error handling](https://docs.xenia.team/guides/error-handling.md) page.

```bash cURL theme={null}
curl -X POST "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/actions" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "assigned",
    "locationId": "8f1c…",
    "title": "Re-face the paint aisle",
    "assignees": [{ "type": "user", "id": "2b7e…" }],
    "dueAt": "2026-11-20T17:00:00Z",
    "evidenceRequired": "photo"
  }'
```

```json 200 theme={null}
{
  "data": {
    "id": "c41a…",
    "kind": "assigned",
    "status": "open",
    "location": { "id": "8f1c…", "name": "Downtown" },
    "title": "Re-face the paint aisle",
    "note": null,
    "createdVia": "api",
    "evidenceRequired": "photo",
    "recheckAt": null,
    "dueAt": "2026-11-20T17:00:00.000Z",
    "attachments": [],
    "coached": [],
    "assignees": [{ "type": "user", "id": "2b7e…", "name": "Sam Lee" }],
    "completion": { "kind": "open" },
    "createdBy": { "id": "9d03…", "name": "Alex Kim" },
    "createdAt": "2026-11-16T18:02:11.482Z",
    "updatedAt": "2026-11-16T18:02:11.482Z"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.