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

# Update Activity Logs

Use this API to update existing activity log records within an organization.

# Endpoint

`POST https://api.velt.dev/v2/activities/update`

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**organizationId** `string` *required*

Organization ID

**activities** `object[]` *required*

Array of activity log objects to update. Each must include the activity log `id`.

**properties**

**id** `string` *required*

Activity log ID to update.

**changes** `object`

Map of field names to `{ from, to }` objects describing what changed.

**entityData** `any`

Updated snapshot of the entity.

**entityTargetData** `any`

Updated snapshot of the target entity.

**displayMessageTemplate** `string`

Updated message template string. Use `{{variable}}` syntax for dynamic values.

**displayMessageTemplateData** `object`

Updated key-value data to populate `displayMessageTemplate` variables.

**actionIcon** `string`

Updated URL or identifier for the action icon.

## **Example Requests**

#### Update a single activity log's display message

```JSON theme={null}
{
  "data": {
    "organizationId": "org-123",
    "activities": [
      {
        "id": "activity-001",
        "displayMessageTemplate": "{{user}} updated the comment"
      }
    ]
  }
}
```

#### Update multiple activities

```JSON theme={null}
{
  "data": {
    "organizationId": "org-123",
    "activities": [
      {
        "id": "activity-001",
        "displayMessageTemplate": "{{user}} updated the comment",
        "displayMessageTemplateData": {
          "user": {
            "userId": "user-1",
            "name": "User Name"
          }
        }
      },
      {
        "id": "activity-002",
        "actionIcon": "https://example.com/icons/edit.svg"
      }
    ]
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Activity(s) updated successfully.",
    "data": {
      "activity-001": {
        "success": true,
        "message": "Activity updated."
      }
    }
  }
}
```

#### When some activities are not found

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Activity(s) updated successfully.",
    "data": {
      "activity-001": {
        "success": false,
        "message": "Failed to update activity."
      },
      "activity-002": {
        "success": true,
        "message": "Activity updated."
      }
    }
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

```js theme={null}
{
  "result": {
    "status": "success",
    "message": "Activity(s) updated successfully.",
    "data": {
      "activity-001": {
        "success": true,
        "message": "Activity updated."
      }
    }
  }
}
```


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