---
title: "Update Derived Log"
method: PUT
path: "/v0/logs/derived"
tags: ["Logs"]
---

# Update Derived Log

`PUT /v0/logs/derived`

Updates multiple derived logs, identified either by a direct list of derived IDs or by
get_logs–style filters. If 'referenced_logs' is provided, we delete all existing
derived logs for each (log_event_id, key) group and re-insert new ones referencing
the new base logs. Finally, we recompute them.

The context parameter can be:
- A string: Uses the string as the context name with default values (description=None, is_versioned=False)
- An object: Uses the object's name, description, and is_versioned properties

## Request body

- UpdateDerivedEntriesConfig
  - `project_name` string, required — Name of the project these derived logs belong to.
  - `context` union — Optional context path to update for the logs. Can use '/' for nested contexts (e.g. 'training/batch1'). Can be a string (which will be interpreted with description=None and is_versioned=False) or a ContextCreateRequest object.
    - ContextCreateRequest — Request model for creating a new context within a project.
      - `name` string, required — Context name, can be nested using '/' (e.g., 'parent/child'). Must contain only alphanumeric characters, underscores, and hyphens.
      - `description` string, nullable — Optional description of the context
      - `is_versioned` boolean — Whether the context should be versioned. If True, the context will be versioned and mutable.
      - `allow_duplicates` boolean — Whether duplicate log entries are allowed in this context. If False, attempts to add duplicate logs will be ignored.
      - `unique_keys` object, nullable — Unique key definition. Keys are column names, values are types ('str', 'int', 'float', 'bool', 'datetime', 'time', 'date', 'timedelta', 'dict', 'list').
      - `auto_counting` object, nullable — Auto-counting configuration. Keys are column names to auto-increment, values are parent counter names (None for independent counters).
      - `foreign_keys` ForeignKeyConfig[], nullable — Foreign key definitions for referential integrity
        - `name` string, required — Column name or path to nested field that references another context. Supports: - Simple column: 'department_id' - Array elements: 'images[*].image_id' - Nested object: 'metadata.user.user_id' - Mixed nesting: 'teams[*].members[*].user_id'
        - `references` string, required — Referenced context and column in format 'ContextName.column_name'
        - `on_delete` 'CASCADE' | 'SET NULL' | 'SET DEFAULT' | 'RESTRICT' | 'NO ACTION' — Action to perform when referenced row is deleted
        - `on_update` 'CASCADE' | 'SET NULL' | 'SET DEFAULT' | 'RESTRICT' | 'NO ACTION' — Action to perform when referenced row is updated
        - `default` unknown
        - `is_nested` boolean, nullable — Auto-set: True if this FK uses a nested path (contains . or [])
        - `path_segments` object[], nullable — Auto-set: Parsed path structure for nested FKs
    - string
  - `target_derived_logs` union, required — The derived logs to update, either as a list of derived_log IDs or as a set of arguments for the get_logs endpoint.
    - integer[]
    - object
  - `key` string, nullable — New key name for the derived entries
  - `equation` string, nullable — New equation for computing derived values
  - `referenced_logs` object, nullable — Optional new referenced logs to use for computation. Can be specified either as a list of log IDs or as a set of arguments for the get_logs endpoint.

## Response `200`

Derived log updated successfully

- unknown

## Other responses

- `400` — Bad Request
- `404` — Log Not Found
- `422` — Validation Error

---

[API](https://skmtc.net/unify/apis/unifyai-http-api-reference.md) · [All operations](https://skmtc.net/unify/apis/unifyai-http-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/unify/unifyai-http-api-reference/revisions/900377f918b6/schema)
