DELETE
/
v0
/
logs
curl --request DELETE \
  --url 'https://api.unify.ai/v0/logs?delete_empty_logs=True' \
  --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"
        ]
    ],
    "source_type": "all"
}'
{
    "info": "Log entries deleted successfully!"
}

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

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.

Query Parameters

delete_empty_logs
boolean

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

Body

project
string
required

Name of the project the logs belong to.

context
any | 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.

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.

curl --request DELETE \
  --url 'https://api.unify.ai/v0/logs?delete_empty_logs=True' \
  --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"
        ]
    ],
    "source_type": "all"
}'
{
    "info": "Log entries deleted successfully!"
}