PUT
/
v0
/
logs
curl --request PUT \
  --url 'https://api.unify.ai/v0/logs' \
  --header "Authorization: Bearer $UNIFY_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "project": "eval-project",
    "context": "experiment1/trial1",
    "params": {
        "explicit_types": {
            "category": {
                "restrict": false,
                "type": "enum",
                "values": [
                    "A",
                    "B",
                    "C"
                ]
            },
            "priority": {
                "type": "enum"
            },
            "system-prompt": {
                "mutable": true,
                "type": "str"
            }
        },
        "function_definition": "...",
        "system-prompt": "..."
    },
    "entries": {
        "explicit_types": {
            "input": {
                "mutable": true,
                "type": "Image"
            },
            "label": {
                "type": "enum"
            },
            "status": {
                "restrict": true,
                "type": "enum",
                "values": [
                    "pending",
                    "completed",
                    "failed"
                ]
            }
        },
        "input": "...",
        "score-test-1": "..."
    },
    "overwrite": false
}'
{
    "info": "Logs updated successfully!"
}

Updates multiple logs with the provided entries. Each entry will be either added or overridden in the specified logs.

The logs parameter can be either:

  • A list of log IDs to update
  • A filter dictionary to select logs matching specific criteria (requires project or context)

A dictionary of “explicit_types” can be passed as part of the entries. If present, it will override the inferred type of any matching key in all logs.

Authorizations

Authorization
string
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

logs
array | object
required

List of log IDs or a dict of filter arguments to select logs. Filter dicts are passed as key:value pairs (e.g. {"status": "done", "user_id": 12}).

project
string | null

Name of the project. Required when using filter dict in logs. Omit when passing a list of IDs.

context
any | string | array | null

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. Required when using filter dict in logs if project is not provided.

params
object | array
default:{}

Dictionary or list of dictionaries of key-value parameter pairs to add or update in the logs.

entries
object | array
default:{}

Dictionary or list of dictionaries of key-value entry pairs to add or update in the logs. Supports nested path syntax using dot notation for object properties (e.g., ‘metadata.author’) and bracket notation for array indices (e.g., ‘results[0]’). Complex paths like ‘results[0].scores.accuracy’ are also supported for deep updates.

overwrite
boolean
default:false

Whether to overwrite existing logs

curl --request PUT \
  --url 'https://api.unify.ai/v0/logs' \
  --header "Authorization: Bearer $UNIFY_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "project": "eval-project",
    "context": "experiment1/trial1",
    "params": {
        "explicit_types": {
            "category": {
                "restrict": false,
                "type": "enum",
                "values": [
                    "A",
                    "B",
                    "C"
                ]
            },
            "priority": {
                "type": "enum"
            },
            "system-prompt": {
                "mutable": true,
                "type": "str"
            }
        },
        "function_definition": "...",
        "system-prompt": "..."
    },
    "entries": {
        "explicit_types": {
            "input": {
                "mutable": true,
                "type": "Image"
            },
            "label": {
                "type": "enum"
            },
            "status": {
                "restrict": true,
                "type": "enum",
                "values": [
                    "pending",
                    "completed",
                    "failed"
                ]
            }
        },
        "input": "...",
        "score-test-1": "..."
    },
    "overwrite": false
}'
{
    "info": "Logs updated successfully!"
}