DELETE
/
v0
/
logs
curl --request DELETE \
  --url 'https://api.unify.ai/v0/logs' \
  --header "Authorization: Bearer $UNIFY_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "project": "eval-project",
    "context": "experiment1/trial1",
    "ids_and_fields": [
        [
            123,
            "score"
        ],
        [
            [
                456,
                457
            ],
            [
                "score",
                "response"
            ]
        ],
        [
            [
                458,
                459,
                460
            ],
            "response"
        ],
        [
            {
                "score": "100"
            },
            null
        ],
        [
            null,
            "score"
        ]
    ],
    "source_type": "all",
    "delete_empty_logs": true,
    "delete_empty_fields": true
}'
{
    "info": "Log entries deleted successfully!"
}

Deletes log entries based on specified criteria. Can delete both base logs and derived logs.

If a context is provided, logs will be removed from that context instead of being entirely deleted, unless it is the last context associated with the log. This allows logs to be shared across multiple contexts and only removed from specific contexts when needed.

Args: source_type: Controls which type of logs to delete:

  • ‘all’: Delete both base and derived logs (default)
  • ‘base’: Only delete base logs
  • ‘derived’: Only delete derived logs

Authorizations

Authorization
string
required

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

Body

project
string
required

Name of the project the logs belong to.

context
string | null

Optional context path to update for the logs. Can use ’/’ for nested contexts (e.g. ‘training/batch1’).

ids_and_fields
[array]
required

List of tuples of log ID(s) and field(s) to delete, either as an individual item or a list of items. A log ID of None indicates that the field should be deleted from all logs. Can also use a dict of filter arguments to select logs. The filter dict should be a key:value pair where the key is the field to filter on and the value is the value to filter on.

source_type
string
default:"all"

Specifies which type of logs to delete. Can be ‘base’ for base logs only, ‘derived’ for derived logs only, or ‘all’ to delete from both types.

delete_empty_logs
boolean
default:false

Whether to delete logs which end up being empty as a result of the field deletion.

delete_empty_fields
boolean
default:true

Whether to delete fields that have no data after log deletion.

curl --request DELETE \
  --url 'https://api.unify.ai/v0/logs' \
  --header "Authorization: Bearer $UNIFY_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "project": "eval-project",
    "context": "experiment1/trial1",
    "ids_and_fields": [
        [
            123,
            "score"
        ],
        [
            [
                456,
                457
            ],
            [
                "score",
                "response"
            ]
        ],
        [
            [
                458,
                459,
                460
            ],
            "response"
        ],
        [
            {
                "score": "100"
            },
            null
        ],
        [
            null,
            "score"
        ]
    ],
    "source_type": "all",
    "delete_empty_logs": true,
    "delete_empty_fields": true
}'
{
    "info": "Log entries deleted successfully!"
}