---
title: "Close a case"
method: POST
path: "/contact_cases/{id}/close"
tags: ["Case"]
---

# Close a case

`POST /contact_cases/{id}/close`

Close a case. closed_by_id is derived server-side from the
authenticated caller's own agent identity -- there is no request
body -- so the closing-agent attribution the platform treats as a
hard invariant cannot be forged by supplying an arbitrary agent_id.
Returns the actually-persisted state, including already_closed
semantics reflected via the returned closed_reason / closed_by_type /
closed_by_id fields when the case had already been closed by
someone/something else.

## Path parameters

- `id` string, uuid, required

## Response `200`

Case closed successfully.

- ContactManagerCase
  - `id` string, uuid — Unique identifier for the case.
  - `customer_id` string, uuid — Unique identifier of the associated customer.
  - `peer` CommonAddress — Contains source or destination detail info.
    - `type` '' | 'agent' | 'conference' | 'email' | 'extension' | 'line' | 'sip' | 'tel' | 'web_session' — Type of address.
    - `target` string — The address endpoint. Format depends on type: phone number for tel (e.g. +14155551234), UUID for agent/conference/extension, email for email, SIP URI for sip.
    - `target_name` string — Address's name.
    - `name` string — Optional label for this address.
    - `detail` string — Additional notes about this address.
  - `local` CommonAddress — Contains source or destination detail info.
    - `type` '' | 'agent' | 'conference' | 'email' | 'extension' | 'line' | 'sip' | 'tel' | 'web_session' — Type of address.
    - `target` string — The address endpoint. Format depends on type: phone number for tel (e.g. +14155551234), UUID for agent/conference/extension, email for email, SIP URI for sip.
    - `target_name` string — Address's name.
    - `name` string — Optional label for this address.
    - `detail` string — Additional notes about this address.
  - `reference_type` string — Origin channel type (e.g. "call", "conversation_message").
  - `reference_id` string — The internal VoIPBin resource ID that reference_type points at (the call ID when reference_type is "call", the conversation ID when reference_type is "conversation_message"), set automatically at case creation time. Never a customer- or agent-supplied value. Empty when no such internal resource ID applies.
  - `contact_id` string, uuid — The resolved contact this case is attributed to. Nullable until resolved.
  - `owner_type` string — Type of the case owner.
  - `owner_id` string, uuid — ID of the case owner.
  - `status` 'open' | 'closed' — Case lifecycle status.
  - `opened_at` string, date-time — Timestamp when the case was opened. Nullable.
  - `closed_at` string, date-time — Timestamp when the case was closed. Nullable.
  - `closed_reason` string — Reason the case was closed (e.g. "agent_closed", "timeout").
  - `closed_by_type` string — Type of the actor that closed the case (e.g. "agent", "system").
  - `closed_by_id` string, uuid — ID of the actor that closed the case. Nullable.
  - `name` string — Optional freeform case name/title, settable only at creation time.
  - `detail` string — Optional freeform case detail, settable only at creation time.
  - `previous_case_id` string, uuid — ID of the prior (now-closed) case this case continues from, if any.
  - `tm_create` string, date-time — Timestamp when this case was created.
  - `tm_update` string, date-time — Timestamp when this case was last updated.

## Other responses

- `400` — Invalid request (INVALID_ARGUMENT).
- `401` — Authentication required (UNAUTHENTICATED).
- `403` — Insufficient permission (PERMISSION_DENIED).
- `404` — Resource not found (NOT_FOUND).
- `500` — Internal error (INTERNAL).

---

[API](https://skmtc.net/voipbin/apis/voipbin-api.md) · [All operations](https://skmtc.net/voipbin/apis/voipbin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voipbin/voipbin-api/versions/79e779080bcc/schema)
