Skip to content

Create a legal hold

POST
/v1/Accounts/{auth_id}/LegalHolds
curl --request POST \
--url https://api.siprtc.io/v1/Accounts/AC000000000000000000/LegalHolds \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data Reason=example \
--data MatterId=example \
--data RecordingSid=example \
--data CallSid=example \
--data ConversationSid=example \
--data PhoneNumber=example \
--data DateFrom=example \
--data DateTo=example \
--data All=true

Places a legal hold: matching recordings, transcripts and chat messages are kept whatever retention says, and API deletes of them are refused (409, code 64030). A hold needs a scope; every scope field you set must match (a PhoneNumber with DateFrom/DateTo holds that number’s content in that range), and All=true holds everything of the account. Phone numbers compare by their digits only, matching the call’s from or to. Scope fields may also be sent as Scope., or as a JSON body {“reason”: …, “scope”: {“call_sid”: …}}. Holds are never deleted, only released, and their scope never changes. Audited as legal_hold.created. Also served at LegalHolds.json. Only the account owner (Basic auth with the account’s Auth ID and Auth Secret) or a platform admin may call it; other logins get 403.

auth_id
required
string

Account Auth ID (AC followed by the account id) the request acts on

Example

AC000000000000000000
Media type application/x-www-form-urlencoded
object
Reason
required

Why the content is held, 1 to 1024 characters

string
MatterId

Your reference for the legal matter, up to 256 characters

string
RecordingSid

Hold this one recording

string
CallSid

Hold the recordings and transcripts of this call (parent call SID)

string
ConversationSid

Hold a conversation: a parent call SID or a chat conversation SID

string
PhoneNumber

Hold content from or to this number (compared by digits, e.g. +15550100123)

string
DateFrom

Hold content created at or after this date (YYYY-MM-DD, RFC 3339, RFC 2822 or unix seconds)

string
DateTo

Hold content created at or before this date; a bare date covers the whole day

string
All

Hold everything of the account

boolean

Example generated

Reason=example&MatterId=example&RecordingSid=example&CallSid=example&ConversationSid=example&PhoneNumber=example&DateFrom=example&DateTo=example&All=true

Created

Media type application/json
object
account_sid

Account the hold belongs to.

string
created_by

Login that created the hold.

string
date_created

When the hold was created, RFC 2822 date, e.g. “Thu, 26 Nov 2026 10:15:30 +0000”.

string
date_released

When the hold was released, RFC 2822 date, e.g. “Thu, 26 Nov 2026 10:15:30 +0000”; null while active.

string
date_updated

When the hold last changed, RFC 2822 date, e.g. “Thu, 26 Nov 2026 10:15:30 +0000”.

string
matter_id

Your reference for the legal matter.

string
reason

Why the content is held.

string
released_by

Login that released the hold; empty while active.

string
scope

What the hold covers; every field set must match.

object
all

Holds everything of the account.

boolean
call_sid

Holds the recordings and transcripts of this call.

string
conversation_sid

Holds this conversation: a parent call SID or a chat conversation SID.

string
date_from

Holds content created at or after this time, RFC 2822 date, e.g. “Thu, 26 Nov 2026 10:15:30 +0000”; null when unset.

string
date_to

Holds content created at or before this time, RFC 2822 date, e.g. “Thu, 26 Nov 2026 10:15:30 +0000”; null when unset.

string
phone_number

Holds content from or to this number, compared by digits.

string
recording_sid

Holds this one recording.

string
sid

Legal hold SID: LH followed by 32 hex digits.

string
status

Active or released. Released holds no longer protect anything.

string
url

Absolute URL of this hold.

string

Example

{
"account_sid": "AC000000000000000000",
"created_by": "AC000000000000000000",
"date_created": "Thu, 26 Nov 2026 10:15:30 +0000",
"date_updated": "Thu, 26 Nov 2026 10:15:30 +0000",
"matter_id": "MATTER-2026-17",
"reason": "Litigation hold for matter 2026-17",
"released_by": "",
"scope": {
"all": false,
"call_sid": "3f0c2a9e-6a51-4d55-9a57-0d2f6e0f8a11",
"phone_number": "+15550100123",
"recording_sid": "9b1d7e0c-2f4a-4c1e-8f3b-5a6d7c8e9f00"
},
"sid": "LH0123456789abcdef0123456789abcdef",
"status": "active",
"url": "https://api.siprtc.io/v1/Accounts/AC000000000000000000/LegalHolds/LH0123456789abcdef0123456789abcdef"
}

Reason missing or too long, MatterId too long, empty scope, bad date, DateTo before DateFrom, or a PhoneNumber without digits (code 20001)

Media type application/json
object
code

Error code: 20001 invalid parameter, 20403 forbidden, 20404 not found, 20409 conflict, 20503 unavailable, 64030 under legal hold, 64031 active encryption key.

integer
message

Human readable explanation.

string
more_info

Link to more information; currently always empty.

string
status

HTTP status code of the response.

integer

Example

{
"code": 20404,
"message": "the requested resource was not found",
"more_info": "",
"status": 404
}

Authentication failed: missing or invalid credentials (JSON string from the API gateway)

Media type application/json
string

Example generated

example

Only the account owner or an admin may do this, or the login does not belong to this account (code 20403)

Media type application/json
object
code

Error code: 20001 invalid parameter, 20403 forbidden, 20404 not found, 20409 conflict, 20503 unavailable, 64030 under legal hold, 64031 active encryption key.

integer
message

Human readable explanation.

string
more_info

Link to more information; currently always empty.

string
status

HTTP status code of the response.

integer

Example

{
"code": 20404,
"message": "the requested resource was not found",
"more_info": "",
"status": 404
}

Storage or account lookup unavailable (code 20503)

Media type application/json
object
code

Error code: 20001 invalid parameter, 20403 forbidden, 20404 not found, 20409 conflict, 20503 unavailable, 64030 under legal hold, 64031 active encryption key.

integer
message

Human readable explanation.

string
more_info

Link to more information; currently always empty.

string
status

HTTP status code of the response.

integer

Example

{
"code": 20404,
"message": "the requested resource was not found",
"more_info": "",
"status": 404
}