---
title: "createActivity"
method: POST
path: "/v1/entity/activity"
tags: ["Activity"]
---

# createActivity

`POST /v1/entity/activity`

Create an activity that can be displayed in activity feeds.

- All activites are published as events on the event bus
- Entity mutations are always part of an activity
- When more than 10 entities are passed, the first 10 are attached synchronously and the rest are processed asynchronously to avoid DynamoDB throttling

## Query parameters

- `entities` EntityId[]

## Request body

- Activity
  - `type` string, required — A type for the activity. Used to categorize activities in the activity feed and for event subscriptions. Built-in entity activity types (custom activities can be defined as well): - EntityCreated - EntityUpdated - EntityDeleted - EntitySoftDeleted - EntityRestored - RelationsAdded - RelationsRemoved - RelationsSoftDeleted - RelationsRestored - RelationsDeleted - ChangesetCreated - ChangesetAutoCleared - ChangesetApplied - ChangesetDismissed
  - `title` string, required — Title for activity. Supports handlebars syntax.
  - `message` string, required — Message for activity. Supports handlebars syntax.
  - `payload` object
  - `pending` boolean — Indicates whether the activity is in the pending state. Pending activities are not yet visible in the activity feed and events are not yet dispatched.

## Response `200`

Success

- BaseActivityItem
  - `_id` string, ulid — See https://github.com/ulid/spec
  - `timestamp` string, date-time
  - `type` string, required — A type for the activity. Used to categorize activities in the activity feed and for event subscriptions. Built-in entity activity types (custom activities can be defined as well): - EntityCreated - EntityUpdated - EntityDeleted - EntitySoftDeleted - EntityRestored - RelationsAdded - RelationsRemoved - RelationsSoftDeleted - RelationsRestored - RelationsDeleted - ChangesetCreated - ChangesetAutoCleared - ChangesetApplied - ChangesetDismissed
  - `title` string, required — Title for activity. Supports handlebars syntax.
  - `message` string, required — Message for activity. Supports handlebars syntax.
  - `payload` object
  - `pending` boolean — Indicates whether the activity is in the pending state. Pending activities are not yet visible in the activity feed and events are not yet dispatched.
  - `caller` ActivityCallerContext
    - `EpilotAuth` object
      - `token` object
        - `sub` string
        - `email` string
        - `cognito:username` string
        - `custom:ivy_user_id` string

## Other responses

- `429` — Too many requests

---

[API](https://skmtc.net/epilot/apis/entity-api.md) · [All operations](https://skmtc.net/epilot/apis/entity-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/epilot/entity-api/revisions/3020984570dc/schema)
