# Release a client (/docs/api-reference/reseller-clients/releaseClient)

> End your relationship with one direct client, for good. One-way: unlike blocking, a release cannot be undone.

> **Reseller accounts only.** [Request access](https://omnidim.io/contact-us?reason=reseller_api&lock=1).

**POST** `/reseller/clients/release`

End your relationship with one direct client, for good. One-way:
unlike blocking, a release cannot be undone.

It reverts the balance you funded, detaches the client's numbers,
takes back the ones you bought, unlinks the organization, and retires
its logins so the same email can sign up fresh. The client
organization stays as history.

Preview it first with `GET /reseller/clients/release-preview`.

Who may call: a reseller key. Any other key gets `403`. A client that
is not one of your direct clients gets `404`.

Errors: `409 conflict` while the client has a live subscription, which
must be cancelled first. `500 server_error` if the balance moved while
releasing; nothing is changed, so try again.

```yaml
operationId: releaseClient
requestBody:
  required: true
  content:
    application/json:
      schema:
        type: object
        required:
          - organization_id
        properties:
          organization_id:
            type: integer
            description: The client organization to release.
      example:
        organization_id: 5678
responses:
  '200':
    description: The client was released.
    content:
      application/json:
        schema:
          type: object
          properties:
            success:
              type: boolean
            organization_id:
              type: integer
            reverted_credits:
              type: object
              description: |
                The balance returned to you, or `{}` when the client had
                nothing to return.
              properties:
                deducted:
                  type: number
                refunded:
                  type: number
            user_ids:
              type: array
              items:
                type: integer
              description: The client users whose logins were retired.
            detached_numbers:
              type: object
              description: |
                Numbers detached from their agents, keyed by number id.
              additionalProperties:
                type: object
                properties:
                  agent_id:
                    type: integer
                  sms_enabled:
                    type: boolean
            transferred_numbers:
              type: array
              items:
                type: integer
              description: Numbers that transferred back to you.
        example:
          success: true
          organization_id: 5678
          reverted_credits:
            deducted: 12.5
            refunded: 10
          user_ids:
            - 1234
          detached_numbers:
            '91':
              agent_id: 412
              sms_enabled: false
          transferred_numbers:
            - 91
  '400':
    description: '`organization_id` is missing or not an integer.'
    content:
      application/json:
        schema:
          type: object
          properties:
            error:
              type: string
              description: Machine-readable error code.
            error_description:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: |
                Stable, specific reason. Present on the newer endpoints (Voice
                cloning, WhatsApp); older endpoints return only `error`.
            request_id:
              type: string
              description: |
                Correlates this response with the server log. Present alongside
                `code`. Also sent as the `X-Request-Id` header.
  '403':
    description: The key is not a reseller's, or not the owner or an admin.
    content:
      application/json:
        schema:
          type: object
          properties:
            error:
              type: string
              description: Machine-readable error code.
            error_description:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: |
                Stable, specific reason. Present on the newer endpoints (Voice
                cloning, WhatsApp); older endpoints return only `error`.
            request_id:
              type: string
              description: |
                Correlates this response with the server log. Present alongside
                `code`. Also sent as the `X-Request-Id` header.
  '404':
    description: The organization is not one of your direct clients.
    content:
      application/json:
        schema:
          type: object
          properties:
            error:
              type: string
              description: Machine-readable error code.
            error_description:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: |
                Stable, specific reason. Present on the newer endpoints (Voice
                cloning, WhatsApp); older endpoints return only `error`.
            request_id:
              type: string
              description: |
                Correlates this response with the server log. Present alongside
                `code`. Also sent as the `X-Request-Id` header.
  '409':
    description: The client has a live subscription and must cancel it first.
    content:
      application/json:
        schema:
          type: object
          properties:
            error:
              type: string
              description: Machine-readable error code.
            error_description:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: |
                Stable, specific reason. Present on the newer endpoints (Voice
                cloning, WhatsApp); older endpoints return only `error`.
            request_id:
              type: string
              description: |
                Correlates this response with the server log. Present alongside
                `code`. Also sent as the `X-Request-Id` header.
        example:
          error: conflict
          error_description: >-
            This client has an active subscription. It must be cancelled before the client can be
            released.
  '500':
    description: The balance moved while releasing. Nothing changed, so try again.
    content:
      application/json:
        schema:
          type: object
          properties:
            error:
              type: string
              description: Machine-readable error code.
            error_description:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: |
                Stable, specific reason. Present on the newer endpoints (Voice
                cloning, WhatsApp); older endpoints return only `error`.
            request_id:
              type: string
              description: |
                Correlates this response with the server log. Present alongside
                `code`. Also sent as the `X-Request-Id` header.
```

**curl**

```bash
curl -X POST "https://backend.omnidim.io/api/v1/reseller/clients/release" \
  -H "Authorization: Bearer $OMNIDIM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "organization_id": 5678
}'
```