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

# Enable/Disable SIP Registration

> Toggle an agent's SIP registration on or off without resending the full configuration

Enable or disable an agent's existing SIP registration by flipping a single
flag. Unlike [Set SIP Registration](/api-reference/agents/sip-registration),
this endpoint does **not** require you to resend `sipDomain`, `username`,
`password`, or any other field — all stored settings are preserved. Use it to
register or deregister an agent while keeping its SIP credentials on file.

<Note>
  This endpoint moves the registration flag **only** — the agent's `status` field is
  left as it is, so an agent deregistered this way still reads as `active`. To move
  both together, use [Update Agent Status](/api-reference/agents/update-status).
</Note>

<Note>
  The agent must already have a SIP registration configured. If none exists, this
  endpoint returns `404`. Use [Set SIP Registration](/api-reference/agents/sip-registration)
  to create the configuration first, or [Delete SIP Registration](/api-reference/agents/delete-sip-registration)
  to remove it entirely.
</Note>

## Path Parameters

<ParamField path="agentId" type="string" required>
  The unique identifier of the agent (UUID format)
</ParamField>

## Request Body

<ParamField body="registrationEnabled" type="boolean" required>
  Set to `true` to enable (register) the agent, or `false` to disable it.

  This is the only accepted field — any additional properties are rejected with
  a `400` error. All other SIP settings are left untouched.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://api.telzino.com/v1/agents/123e4567-e89b-12d3-a456-426614174000/sip/registration \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "registrationEnabled": false
    }'
  ```

  ```javascript JavaScript theme={null}
  const agentId = '123e4567-e89b-12d3-a456-426614174000';

  const response = await fetch(
    `https://api.telzino.com/v1/agents/${agentId}/sip/registration`,
    {
      method: 'PATCH',
      headers: {
        'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        registrationEnabled: false
      })
    }
  );

  const result = await response.json();
  ```

  ```python Python theme={null}
  import requests

  agent_id = '123e4567-e89b-12d3-a456-426614174000'

  response = requests.patch(
      f'https://api.telzino.com/v1/agents/{agent_id}/sip/registration',
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
      json={
          'registrationEnabled': False
      }
  )

  result = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "data": {
      "sipDomain": "sip.example.com",
      "username": "1001",
      "password": "secure_password",
      "proxy": "proxy.example.com",
      "port": 5060,
      "transport": "udp",
      "subscribe": false,
      "authUsername": null,
      "did": null,
      "sipRoutingHeaderXDestUser": null,
      "registrationEnabled": false,
      "extension": "1001"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": "Invalid request data",
    "details": [
      {
        "code": "invalid_type",
        "expected": "boolean",
        "received": "undefined",
        "path": ["registrationEnabled"],
        "message": "Required"
      }
    ]
  }
  ```

  ```json 404 theme={null}
  {
    "error": "not_found",
    "error_description": "No SIP registration configured for this agent"
  }
  ```
</ResponseExample>

## How It Works

1. **API validates** that `registrationEnabled` is a boolean
2. **Loads the existing** `sip_registration_data` for the agent (returns `404` if none is configured)
3. **Updates only** the `registrationEnabled` flag, preserving every other stored field
4. **Sync service picks up** the change via Supabase realtime and registers or deregisters with OpenSIPS accordingly

<Info>
  Disabling a registration keeps the SIP configuration stored, so you can re-enable
  it later with a single `PATCH` — no need to re-enter credentials. To remove the
  configuration completely, use the [Delete SIP Registration](/api-reference/agents/delete-sip-registration) endpoint.
</Info>

## Troubleshooting

| Error                                           | Cause                                                         | Solution                                                                                 |
| ----------------------------------------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| "No SIP registration configured for this agent" | The agent has no stored SIP configuration                     | Use [Set SIP Registration](/api-reference/agents/sip-registration) to configure it first |
| "Agent not found"                               | Invalid agentId or no access                                  | Verify the agent ID and your access token                                                |
| "Cannot update vida agents via this API"        | Agent is not a LiveKit agent                                  | Only LiveKit agents support SIP registration via API                                     |
| "Invalid request data"                          | Missing or non-boolean `registrationEnabled`, or extra fields | Send exactly `{ "registrationEnabled": true }` or `{ "registrationEnabled": false }`     |
