Close a case

SDK platic.cases.close()

Finish a case by sending reason: resolved, discarded or unresolved. Include a note if you discard it or could not resolve it. A closed case cannot be reopened; if the problem returns, open another case.

Example

await platic.cases.close("case_123", { reason: "resolved", returnToAgent: true });

Path parameters

ParameterTypeDescriptionRequired
caseIdstringCase id✓

Request body

{
  "reason": "resolved",
  "note": "The invoice was reissued with the correct tax ID.",
  "returnToAgent": true
}
ParameterTypeRequiredDescription
reasonstring✓resolved (it was resolved), discarded (it did not apply: this is declining it, as in the app) or unresolved (it could not be resolved). expired is only set by Platica when the case expires
notestring-How it ended, up to 4,000 characters. Required with discarded and unresolved
returnToAgentboolean-If it was the last one open and a person was handling the conversation (supervised), true gives it back to the agent: it answers again from the contact's next message. Default, false

Response

200 OK. result is closed, or already_closed if it was already closed; in that case nothing changes.

{
  "status": "success",
  "data": {
    "result": "closed",
    "case": {
      "id": "Es4kP9wLx2QmZ7bN1cVd",
      "workspaceId": "Wk5rT8yUi2OpAs4d",
      "number": 143,
      "folio": "INV-0143",
      "escalationId": "Et7hQ2mVx9LpRk3s",
      "escalationSnapshot": {
        "name": "Invoice error",
        "prefix": "INV",
        "color": "#2563EB",
        "keepReplying": false,
        "canClose": false,
        "waitMessage": null,
        "inactivityCloseHours": null,
        "untakenDiscardHours": 72,
        "allowManual": true
      },
      "status": "closed",
      "priority": "normal",
      "summary": "Asks to fix the tax ID on the invoice for order 48213.",
      "fields": {"order_number": "48213", "tax_id": "ACME010101AB1"},
      "contactId": "Ct3fG5hJ7kL9mN1p",
      "conversationId": "Cv8hN2lP4qR6sT0u",
      "channelId": "Ch2wE4rT6yU8iO0p",
      "platform": "whatsapp",
      "relatedConversationIds": [],
      "postId": null,
      "threadId": null,
      "agentId": "Ag6bV8nM1qW3eR5t",
      "openedBy": {"kind": "agent", "id": "Ag6bV8nM1qW3eR5t"},
      "assigneeIds": ["Us9fG3hJ6kL2mN8b", "Us2qW4eR6tY8uI0o"],
      "acceptedBy": "Us2qW4eR6tY8uI0o",
      "acceptedAt": "2026-11-12T15:12:00.000Z",
      "lastActivityAt": "2026-11-12T15:12:00.000Z",
      "maxOpenAt": "2026-11-26T15:04:00.000Z",
      "autoCloseAt": null,
      "discardAt": null,
      "discardWarnAt": null,
      "discardWarnedAt": null,
      "closedAt": "2026-11-12T16:40:00.000Z",
      "closedBy": {"kind": "api", "id": "Ak7Pz2Lm9Qx4Wc6e"},
      "closeReason": "resolved",
      "closeNote": "The invoice was reissued with the correct tax ID.",
      "createdAt": "2026-11-12T15:04:00.000Z",
      "updatedAt": "2026-11-12T16:40:00.000Z",
      "assigneeEmails": ["billing@acme.com", "support@acme.com"],
      "acceptedByEmail": "support@acme.com"
    },
    "conversation": {
      "conversationId": "Cv8hN2lP4qR6sT0u",
      "threadId": null,
      "openCount": 0,
      "operationBefore": "supervised",
      "operation": "automatic",
      "operationChanged": true,
      "ownersAdded": [],
      "ownersAddedEmails": [],
      "post": null
    }
  }
}
FieldTypeDescription
resultstringclosed or already_closed
caseobjectThe case as it ended up, with the fields in get a case
conversationobjectHow the conversation ended up. openCount: 0 means none are left open. See the conversation object

Errors

Statusdetails.codeWhen
400INVALID_REQUESTreason is missing or not valid (expired is not accepted either), or note is missing with discarded or unresolved (Closing as discarded needs a note)
404CASE_NOT_FOUNDThe case does not exist in this workspace

The errors that come up on any operation are in the introduction.

Notes

  • Declining is closing with discarded and a note explaining why it did not apply. If it was the last open case on a direct message and the conversation goes back to automatic, Platica asks the agent to continue the conversation right then (the same as declining from the inbox).
  • When you close as resolved or unresolved with returnToAgent: true, the agent does not answer on the spot: it picks up from the contact's next message. If you want to tell them it is handling them again, send a message with send a message.
  • If the agent was paused by the case (assistance) and it was the last one open, the conversation goes back to the agent without needing returnToAgent.
  • The case.closed webhook arrives. If the conversation changed, conversation.operation.updated also arrives with source api.case.closed.
  • From an AI agent, the tool is close_case.