# pub.chive.activity.log

> Log a user-initiated write action before performing PDS write. The activity is stored with status='pending' until the firehose event is received and correlated.

- Kind: procedure
- Authority: activity.chive.pub
- Lexicon: 1
- Published by [lexicons.governance.chive.pub](https://lexicon.garden/identity/did:plc:egjghlwgts2hlcer2txilxeh), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:egjghlwgts2hlcer2txilxeh/pub.chive.activity.log)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:egjghlwgts2hlcer2txilxeh/pub.chive.activity.log/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:egjghlwgts2hlcer2txilxeh/pub.chive.activity.log/analytics)

## Procedure (`pub.chive.activity.log`)

Type: procedure · POST

### Input (application/json)

- `action` (string, required): Action type
  - Constraints: knownValues: create | update | delete
- `category` (string, required): Semantic activity category
  - Constraints: knownValues: eprint_submit | eprint_update | eprint_delete | review_create | review_update | review_delete | endorsement_create | endorsement_delete | tag_create | tag_delete | profile_update | proposal_create | vote_create
- `collection` (string, required): NSID of the record collection
- `recordSnapshot` (string): Snapshot of record data being written as JSON string
  - Constraints: maxLength: 50000
- `rkey` (string, required): Record key (TID)
- `spanId` (string): OpenTelemetry span ID
  - Constraints: minLength: 16, maxLength: 16
- `targetTitle` (string): Target record title for display
  - Constraints: maxLength: 500
- `targetUri` (string · at-uri): Target record URI (e.g., the eprint being reviewed)
- `traceId` (string): OpenTelemetry trace ID
  - Constraints: minLength: 32, maxLength: 32
- `uiContext` (string): UI context metadata as JSON string
  - Constraints: maxLength: 10000

### Output (application/json)

- `activityId` (string, required): Created activity ID (UUID)

### Errors

- `AuthenticationRequired`: No description in schema.
- `InvalidRequest`: No description in schema.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Log a user-initiated write action before performing PDS write. The activity is stored with status='pending' until the firehose event is received and correlated.",
      "errors": [
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "InvalidRequest"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "action": {
              "description": "Action type",
              "knownValues": [
                "create",
                "update",
                "delete"
              ],
              "type": "string"
            },
            "category": {
              "description": "Semantic activity category",
              "knownValues": [
                "eprint_submit",
                "eprint_update",
                "eprint_delete",
                "review_create",
                "review_update",
                "review_delete",
                "endorsement_create",
                "endorsement_delete",
                "tag_create",
                "tag_delete",
                "profile_update",
                "proposal_create",
                "vote_create"
              ],
              "type": "string"
            },
            "collection": {
              "description": "NSID of the record collection",
              "type": "string"
            },
            "recordSnapshot": {
              "description": "Snapshot of record data being written as JSON string",
              "maxLength": 50000,
              "type": "string"
            },
            "rkey": {
              "description": "Record key (TID)",
              "type": "string"
            },
            "spanId": {
              "description": "OpenTelemetry span ID",
              "maxLength": 16,
              "minLength": 16,
              "type": "string"
            },
            "targetTitle": {
              "description": "Target record title for display",
              "maxLength": 500,
              "type": "string"
            },
            "targetUri": {
              "description": "Target record URI (e.g., the eprint being reviewed)",
              "format": "at-uri",
              "type": "string"
            },
            "traceId": {
              "description": "OpenTelemetry trace ID",
              "maxLength": 32,
              "minLength": 32,
              "type": "string"
            },
            "uiContext": {
              "description": "UI context metadata as JSON string",
              "maxLength": 10000,
              "type": "string"
            }
          },
          "required": [
            "collection",
            "rkey",
            "action",
            "category"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "activityId": {
              "description": "Created activity ID (UUID)",
              "type": "string"
            }
          },
          "required": [
            "activityId"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "pub.chive.activity.log",
  "lexicon": 1,
  "revision": 1
}
```
