---
title: "Restrict session"
url: https://hexelstudio.com/docs/api/titan/administration/restrict
---

# Restrict session

**POST** `/titan/admin/sessions/{id}/restrict`

## Path parameters

- `id: string`

## Headers

- `Authorization: string`

  `Bearer <token>`. A Hexel Studio access token for a member or a service user of your organization (or send a service user's API key as X-API-Key).

- `Titan-Enforcement-Deployment: optional string`

  The enforcement deployment this call acts on (its td-... id). Required on the shared plane, where one Gateway serves many tenants and there is no default: a missing, unknown, repeated or other organization's deployment answers 403, like a failed authorization. Optional on a dedicated cell, which defaults to its one deployment.

## Body parameters

- `action: string`

  One of: `"suspend"`, `"resume"`, `"revoke"`

- `reason_code: string`

  One of: `"OPERATOR_REQUEST"`, `"SECURITY_INCIDENT"`, `"POLICY_VIOLATION"`

## Returns

`200` Successful response; exact status varies by operation. (`object`)

- `changed: boolean`

- `session_id: string`

- `state: string`

  One of: `"active"`, `"suspended"`, `"revoked"`, `"closed"`

## Errors

- `400` Admin error
- `403` Admin error
- `404` Admin error
- `409` Admin error
- `413` Admin error
- `415` Admin error
- `503` Admin error

## Example

```bash
curl --request POST \
  --url 'https://api.hexelstudio.com/v1/titan/admin/sessions/{id}/restrict' \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
  "action": "suspend",
  "reason_code": "OPERATOR_REQUEST"
}'
```

### Response (200)

```json
{
  "changed": true,
  "session_id": "string",
  "state": "active"
}
```

### Response (400)

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```

### Response (403)

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```

### Response (404)

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```

### Response (409)

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```

### Response (413)

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```

### Response (415)

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```

### Response (503)

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```
