# End a session

**DELETE** `/api/embed/v1/sessions/current`

Signs the frame’s session out. The SDK calls it when the frame goes away.

Needs the frame’s session: `Authorization: Bearer gri_…`. The SDK calls it; you rarely do.

Embed · Self-hosted with an Embed license

## Request

It takes no parameters and no body.

## Responses

- 204 No Content

  Ended.

- 401 `UNAUTHORIZED`

  No session token.

- 401 `EMBED_SESSION_ENDED`

  The session ended. `details.reason` says why, such as `access_removed`, `role_changed` or `workspace_deleted`.

- 403 `EMBED_NOT_AVAILABLE`

  Embed isn’t licensed here, or sign-in is off (`details.reason`: `not_licensed` or `sign_in_off`).

- 500 `INTERNAL_ERROR`

  Something failed on the installation’s side. Try again.

Any call can also answer: [`429 RATE_LIMITED`](https://docs.gorunner.io/errors#RATE_LIMITED) · [`503 BUSY`](https://docs.gorunner.io/errors#BUSY). See [Errors](https://docs.gorunner.io/embed/api#errors).

Request

**curl**

```bash
GORUNNER="https://automations.example.com"
GORUNNER_SESSION="gri_…"  # the frame’s session

curl -X DELETE "$GORUNNER/api/embed/v1/sessions/current" \
  -H "Authorization: Bearer $GORUNNER_SESSION"
```

**JavaScript**

```js
const GORUNNER = "https://automations.example.com";
const SESSION = process.env.GORUNNER_SESSION; // gri_…

const res = await fetch(
  `${GORUNNER}/api/embed/v1/sessions/current`,
  {
    method: "DELETE",
    headers: {
        Authorization: `Bearer ${SESSION}`,
      },
  },
);
console.log(res.status); // 204
```

**Python**

```python
import os, requests

GORUNNER = "https://automations.example.com"
SESSION = os.environ["GORUNNER_SESSION"]  # gri_…

res = requests.delete(
    f"{GORUNNER}/api/embed/v1/sessions/current",
    headers={"Authorization": f"Bearer {SESSION}"},
)
print(res.status_code)  # 204
```

Response · 204 No Content

```http
HTTP/1.1 204 No Content
```

**Every field**

It takes no body.

204 No Content: no body.

Related: [Start a session](https://docs.gorunner.io/embed/api/sign-in/start-session) · [Login codes and sessions](https://docs.gorunner.io/embed/sign-in-and-sessions)

Source: https://docs.gorunner.io/embed/api/sign-in/end-session
