Mark copies as sent
Mark copies as sent
Overview
Requires a read-write API key. Marks one or more copies as sent via an ids list. Unknown or invalid copy IDs are skipped.
posthttps://api.subsail.com/v1/copies/mark-sent/
Request parameters
No parameters.
Request body
idsnumber[]RequiredCopy IDs to mark as sent. May contain a single ID.
datedateSent date in YYYY-MM-DD format. Use null to remove sent date. Omit to mark sent without a date.
Example
JSON
{
"ids": [
"<number>"
],
"date": "<date>"
}Request examples
curl -X POST https://api.subsail.com/v1/copies/mark-sent/ \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"<number>"
],
"date": "<date>"
}'const response = await fetch('https://api.subsail.com/v1/copies/mark-sent/', {
method: 'POST',
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"ids": [
"<number>"
],
"date": "<date>"
}),
});
const data = await response.json();Responses
200Copies marked sent
errorbooleanRequiredupdated_countnumberRequireditemsCopy[]RequiredArray (Copy):
idnumberNumeric copy (subscription item) ID.
date_sentdatestatusSent | Cancelled | Not sentcountrystringISO country code.
issueIssueRefObject (IssueRef):
idstringnumbernumbernamestringsubscriber_idstringsubscription_idstringExample
JSON
{
"error": "<boolean>",
"updated_count": "<number>",
"items": [
{
"id": "<number>",
"date_sent": "<date>",
"status": "<Sent | Cancelled | Not sent>",
"country": "<string>",
"issue": {
"id": "<string>",
"number": "<number>",
"name": "<string>"
},
"subscriber_id": "<string>",
"subscription_id": "<string>"
}
]
}400Invalid request
errorbooleanRequiredmessagestringRequiredcodestringMachine-readable code, e.g. read_only_key for read-only key write attempts.
Example
JSON
{
"error": "<boolean>",
"message": "<string>",
"code": "<string>"
}401Missing or invalid API key (empty response body).
403Write request rejected. Inactive account returns an empty body. Read-only API key returns JSON with `code: read_only_key`.
errorbooleanRequiredmessagestringRequiredcodestringMachine-readable code, e.g. read_only_key for read-only key write attempts.
Example
JSON
{
"error": true,
"message": "This API key is read-only. Create a read-write key in Subsail settings to perform write operations.",
"code": "read_only_key"
}