---
title: "Close a session"
method: DELETE
path: "/api/v2/projects/{projectId}/sessions/{sessionId}"
tags: ["Sessions"]
---

# Close a session

`DELETE /api/v2/projects/{projectId}/sessions/{sessionId}`

## Request

- Base URL: `https://davinci-app.com`
- URL: `https://davinci-app.com/api/v2/projects/{projectId}/sessions/{sessionId}`
- Auth: HTTP bearer

Releases the project and revokes every grant the session issued. Grants stop
working immediately rather than at expiry, which is the point of closing a
session rather than letting it lapse.

## Response `200`

The session was closed.

- DeleteSessionResponse
  - `success` boolean, required
  - `sessionId` string, uuid, required
  - `revokedGrants` integer: How many live grants the close revoked.

## Other responses

- `401`: No credential was supplied, or the supplied credential is malformed, expired, or revoked. A credential that is present but unusable is never downgraded to an anonymous request.
- `403`: Authenticated but not authorized. Either the acting user lacks the required resource permission, the key's scope ceiling excludes it, or the endpoint rejects this credential type (`CREDENTIAL_NOT_PERMITTED`).
- `404`: No such session, or it belongs to another user. Error code is `SESSION_NOT_FOUND`.
- `429`: Request rate exceeded, either globally or for this key.
- `500`: Unexpected server error.

## Changes

- **2026-09-15** (v2) `67c8b8616dbb`: 5 info
  - the `success` response property const value `false` was added for the status `401`
  - the `success` response property const value `false` was added for the status `403`
  - the `success` response property const value `false` was added for the status `404`
  - the `success` response property const value `false` was added for the status `429`
  - …1 more
- **2026-09-15** (v2) `48948af37797`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/celedon-solutions/apis/davinci-public-api/changes/api/v2/projects/:projectId/sessions/:sessionId/delete.md)

---

[API](https://skmtc.dev/celedon-solutions/apis/davinci-public-api.md) - [All operations](https://skmtc.dev/celedon-solutions/apis/davinci-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/celedon-solutions/apis/davinci-public-api/revisions/279218ca2e8d?raw)
