> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mithunai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Allow or withdraw MITHUNAI support access

> Turn MITHUNAI support access on or off. It is off until you turn it on, and withdrawing ends every live session at once rather than letting them run to expiry.

Turn support access on or off. Requires the owner or administrator role.

It is **off by default**, and stays off until someone with that role turns it on. A control whose default is "yes" is not a control, so this one starts at no.

**Withdrawing ends every live session immediately**, rather than letting the sessions run to their expiry. Turning this off is revoking access, not declining to renew it. Consent is re-read on every request a session makes, so a session that is already open stops on its next call.

The response is the same shape as [Read support access](/api-reference/support-access/get-support-access), so your interface re-renders from the result rather than from what it assumed would happen.

<ParamField body="allowed" type="boolean" required>
  Whether MITHUNAI support may open a session against your organisation.
</ParamField>

## Response

<ResponseField name="allowed" type="boolean" required>
  The value after the change.
</ResponseField>

<ResponseField name="active" type="object[]" required>
  Sessions inside the organisation right now. Empty after withdrawing access, because withdrawing
  ends them.
</ResponseField>

<ResponseField name="history" type="object[]" required>
  Recent sessions, live and finished, newest first.
</ResponseField>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl --request PUT "$MITHUNAI_URL/arukz/api/v1/support-access" \
    --header "Authorization: Bearer $MITHUNAI_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{"allowed": true}'
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import os

  import requests

  response = requests.put(
      f"{os.environ['MITHUNAI_URL']}/arukz/api/v1/support-access",
      headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
      json={"allowed": False},
      timeout=30,
  )
  response.raise_for_status()
  # Withdrawing ended every live session; `active` is empty.
  print(response.json()["active"])
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  // From your backend. Never send an API key to a browser.
  const response = await fetch(`${process.env.MITHUNAI_URL}/arukz/api/v1/support-access`, {
    method: 'PUT',
    headers: {
      Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ allowed: true }),
  })
  console.log((await response.json()).allowed)
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "allowed": false,
    "active": [],
    "history": [
      {
        "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
        "staff_name": "Priya Raman",
        "staff_email": "priya.raman@mithunai.com",
        "reason": "Ticket 4821: ingestion reports success but the assistant abstains",
        "started_at": "2026-09-26T09:14:02.118374+00:00",
        "expires_at": "2026-09-26T10:14:02.118374+00:00",
        "end": "revoked"
      }
    ]
  }
  ```

  ```json 400 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  { "code": "validation_error", "message": "'allowed' is required." }
  ```

  ```json 403 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  { "code": "authorization_error", "message": "You are not allowed to perform this action." }
  ```
</ResponseExample>
