---
title: "Create a user session"
description: "Sign in to manage your workspaces and create backend API keys."
api: POST https://api.nuxie.ai/v1/tokens
authMethod: none
playground: simple
search:
  tags: ["api", "workspace", "reference"]
  keywords: ["email", "password", "user session token", "Bearer", "email_verification_required"]
---

Sign in with your Nuxie email and password to get a user session bearer token. Use that token to [list your workspaces](/docs/api-reference/workspace/list-workspaces) and [create a workspace API key](/docs/api-reference/workspace/create-api-key) for your backend.

Your account must have an email/password login and a verified email address. This request does not need an existing API key.

## Request body

- **`email`** · body · `string` · required

  Email address of your Nuxie account.

- **`password`** · body · `string` · required

  Account password.

## Response

- **`object`** · `string` · required

  `token`.

- **`token`** · `string` · required

  User session bearer token. Keep this secret and send it as `Authorization: Bearer <token>` when managing workspace keys.

- **`expires_at`** · `string` · required

  ISO 8601 session expiry time, or `null` if no time was returned.

- **`user`** · `object` · required

  Signed-in account.

  **User fields**

  - **`id`** · `string` · required

    User ID.

  - **`email`** · `string` · required

    Account email.

  - **`name`** · `string` · required

    Account name.

Use the session token for account and key-management requests. Your backend should use the workspace key it creates for ongoing workspace operations.

## Errors

| Status | Code | Action |
| --- | --- | --- |
| `401` | `invalid_credentials` | Check the email and password. |
| `403` | `email_verification_required` | Verify the account's email before trying again. |
| `429` | Rate limit | Wait before retrying sign-in. |
| `400` | `token_create_failed` | Read the response's `error.message` for the failure. |

## End the session

Send `DELETE /v1/tokens/current` with this token as `Authorization: Bearer <token>`. A successful response contains `object: "token"` and `revoked: true`.

```sh title="cURL"
curl https://api.nuxie.ai/v1/tokens \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "you@example.com",
  "password": "your-account-password"
}'
```

```json title="201"
{
  "object": "token",
  "token": "user-session-token",
  "expires_at": "2026-08-28T12:00:00.000Z",
  "user": {
    "id": "user-id",
    "email": "you@example.com",
    "name": "Your Name"
  }
}
```
