Skip to content

Deleting trace via API endpoint doesn't work #2077

@yurii-ve

Description

@yurii-ve

POST request to the https://api.smith.langchain.com/api/v1/runs/delete made according to the documentation results in status 202 Accepted with {"message":"Run deletes queued"}, but the trace is not deleted.

TS code example:

const result = await fetch('https://api.smith.langchain.com/api/v1/runs/delete', {
    method: 'POST',
    body: JSON.stringify({
         trace_ids: ['dffc83b7-2c4f-49de-8464-5ff276982b39'],
         session_id: '2e9de836-3c95-4024-b7ef-d5d69bc4eb44',  // Langsmith project id
    }),
    headers: {
         'X-API-Key': process.env.LANGSMITH_API_KEY ?? '',
         'Content-Type': 'application/json',
    },
});

Curl example (copied from the Langsmith Swagger UI):

curl -X 'POST' \
  'https://api.smith.langchain.com/api/v1/runs/delete' \
  -H 'accept: application/json' \
  -H 'X-API-Key: API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{"session_id": "2e9de836-3c95-4024-b7ef-d5d69bc4eb44", "trace_ids": ["dffc83b7-2c4f-49de-8464-5ff276982b39"]}'

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions