Aller au contenu
Livstick Développeurs

Create or fetch a container

Méthode POST https://client-api.v5.livstick.com/api/v3/containers

Use this endpoint to initialize a container by business reference (crid). Contact values can be supplied for server-side message prefill. Recipient first and last names are optional. Without recipient.channel, email is selected whenever recipient.email is available, even if a phone is also supplied. A phone-only recipient must explicitly use channel: sms. If the container already exists for the platform, the API returns existing links without mutating it. Use PATCH /containers/{crid} for corrections.

Autorisation

Scope requis containers:write

Use Authorization: Bearer liv_<prefix>_<secret>.

Corps de la requête

Requis application/json Schéma CreateContainerInput

Nom Type Requis Description
crid string Requis
emailObsolète string Facultatif Deprecated alias of sender.email. Contraintes format email
sender SenderInput Facultatif Optional sender identity and contact values.
recipient RecipientInput Facultatif Optional recipient identity and contact values. With no channel, email is selected when present. A phone-only recipient must set channel to sms.
language string Facultatif
codeGroup string Facultatif
mode ContainerMode Facultatif Container mode. single (default) holds one message; gallery accepts multiple messages. Ignored when the container already exists. Valeurs single gallery
additionalData object Facultatif Arbitrary metadata, preserved unchanged. Historical contact aliases remain recognized: email, senderEmail, sender first/last-name variants, receiverEmail, receiverPhone, and messageNotified.

Réponses

201 application/json Schéma CreateContainerOutput

Container created or reused.

400 application/json Schéma ApiErrorEnvelope

Request rejected due to invalid payload or business precondition.

json 400
{
  "error": {
    "code": "DATA_INVALID",
    "message": "Invalid request data"
  }
}

401 application/json Schéma ApiErrorEnvelope

Authentication failed or missing bearer token.

json 401
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Missing API key"
  }
}

403 application/json Schéma ApiErrorEnvelope

Authenticated but not allowed by scope or key constraints.

json 403
{
  "error": {
    "code": "FORBIDDEN",
    "message": "Insufficient permissions"
  }
}