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

# Log Activities in Bulk

> Logs up to 5,000 custom activities in one call. They are stored in the background; check the result with the batch status call.

Send up to **5,000 custom activities in one request**, with the whole request at most 5 MB. The request is checked and answered straight away with a batch id, and the events are stored in the background, usually within seconds. Use [Get Batch Result](/api-reference/activities/get-activity-batch) to see what happened to each one.

One batch request counts once against the [rate limit](/api-reference/rate-limits), however many events it carries.

## Request

```json theme={null}
{
  "source": "bigquery",
  "events": [
    {
      "id": "u8821:tapped_search_result:well_88213:2026-10-08",
      "activity_key": "26a86703-f134-46f5-9e11-ac4f4d74e656",
      "occured_at": "2026-10-08T06:12:40Z",
      "phone": "+14057401507",
      "properties": {"marker_id": "well_88213", "count": 14}
    },
    {
      "id": "u9020:opened_app:2026-10-08",
      "activity_key": "a1c0d3f2-5b7e-4c55-9d1e-0f6b8a2e4c11",
      "occured_at": "2026-10-08T07:40:02Z",
      "email": "tom@acme.com"
    }
  ]
}
```

| Field | Required | Notes |
| - | - | - |
| `source` | No | A source added under Activities & Scoring and enabled for every type in the batch. Leave it out to use the default source. |
| `events[].id` | Yes | Your id for the event, up to 128 characters, unique per activity type. An id we already hold for that type and source is skipped, so a batch can be sent again safely. |
| `events[].activity_key` | Yes | A custom activity type id from [List Activity Types](/api-reference/activities/list-activity-types). |
| `events[].occured_at` | Yes | When it happened, ISO 8601 with a timezone. |
| `events[].phone` | One identifier | E.164 format, for example `+14057401507`. |
| `events[].email` | One identifier | |
| `events[].linkedin_url` | One identifier | |
| `events[].domain` | Company types | Used for activity types that apply to companies. |
| `events[].properties` | No | Only fields defined on the activity type, up to 2,048 bytes per event. |

Each event needs at least one identifier that the activity type links on: phone, email or LinkedIn URL for contact types, domain for company types. The person or company must already exist. Logging an activity never creates a contact.

## Responses

**202**, the batch is accepted:

```json theme={null}
{
  "batch_id": "4e7c9b1e-2f1a-4c8e-9a51-1b7d3c0e6f42",
  "received": 1000,
  "status_url": "/api/public/activities/batch/4e7c9b1e-2f1a-4c8e-9a51-1b7d3c0e6f42"
}
```

**400**, one or more events are invalid. Nothing from the batch is stored. Fix the listed events and send the whole batch again:

```json theme={null}
{
  "error": "Validation failed",
  "rows": [
    {"index": 17, "field": "phone", "message": "Not a valid phone number. Send E.164, for example +14057401507."},
    {"index": 418, "field": "id", "message": "Duplicate id for this activity type in this batch."}
  ],
  "row_errors": 2
}
```

**422**, the `source` is unknown or not enabled for one of the activity types.

**429**, the workspace has reached its daily event limit. The response says when it resets and carries a `Retry-After` header:

```json theme={null}
{"error": "Daily event limit reached", "limit": 2000000, "received_today": 1999500, "resets_at": "2026-10-10T00:00:00+00:00"}
```

**413**, the request is larger than 5 MB. Send fewer events per request.

**503**, the batch could not be queued. Nothing was stored; send it again.

<Note>
  Send one or two batches at a time rather than all at once, and back off on a `429`. Allow at least 60 seconds for a response: a full batch takes several seconds to check.
</Note>


## OpenAPI

````yaml POST /public/activities/batch/
openapi: 3.0.3
info:
  title: RevyOps API
  version: 1.0.0
servers:
  - url: https://app.revyops.com/api
security:
  - ApiKeyAuth: []
paths:
  /public/activities/batch/:
    post:
      tags:
        - public
      description: >-
        Logs up to 5,000 custom activities in one call. They are stored in the
        background; check the result with the batch status call.
      operationId: public_activities_batch_create
      responses:
        '200':
          description: No response body
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````

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