Skip to main content
PATCH
/
contracts
/
{id}
Update a contract
curl --request PATCH \
  --url https://panel.sendcloud.sc/api/v3/contracts/{id} \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "is_active": false,
  "is_default_per_carrier": false,
  "contract_data": {
    "country": "NL",
    "client_id": "sendcloud-1"
  },
  "name": "main"
}
'
{
  "data": {
    "id": 60,
    "carrier": {
      "code": "lettresuivie",
      "name": "Lettre Suivie"
    },
    "client_id": "sendcloud-1",
    "is_default_per_carrier": true,
    "state": "active",
    "type": "direct"
  }
}

Documentation Index

Fetch the complete documentation index at: https://sendcloud.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Basic Authentication using API key and secrets is currently the main authentication mechanism.

Path Parameters

id
integer
required

The id of the contract.

Body

application/json

Update request object model

is_active
boolean

New contracts are inactive by default, if you want to activate it immediately set this flag.

Example:

false

is_default_per_carrier
boolean
default:false

Marks the contract as default for a carrier. You can have only one default direct contract per carrier.

Note: You cannot mark a contract as not default, to switch the default contract of a carrier use is_default_per_carrier: true on the contract you like to set as active, other contracts for this carrier will automatically be marked as not default.

Example:

false

contract_data
object

Fields for creating a contract. It supports dynamic key-value pairs, where keys represent field names and values are string-based data.

Example:
{
"country": "NL",
"client_id": "sendcloud-1"
}
name
string

The name of the contract

Maximum string length: 50
Example:

"main"

Response

OK

Update contract

data
Contract · object

User contract