Subscriptions
A subscription books the licenses of a directory per tier. These endpoints do what the Billing page in Sally does: read how many licenses are available, assigned and free, list the subscriptions, start one through a Stripe checkout link and change the number of licenses. Only owners and administrators can use them. A directory managed by a reseller partner is booked by its partner, so these endpoints answer 409 MANAGED_BY_RESELLER_PARTNER there.
To take a license away from a single member, use PATCH …/memberships/{userId} on Directories & members. How both fit together is shown in the guide Clean up licenses automatically.
Every endpoint below shows its parameters and response fields in the middle. On the right you find request samples in cURL, JavaScript and Python, an example response and Try it, which sends the request for real with your own token.
Returns the license statistics of the directory
Per tier: licenses available, assigned and free, split into the individual contract with Sally and the online subscriptions. Computed exactly like the Billing page in Sally: assigned licenses fill the individual contract first, only the rest counts against the subscriptions. Only owners and administrators.
Path parameters
directoryIdstringrequiredId of the directory (the Sally company account) the resource belongs to. The directories a token can address are listed by
GET /v1.0/me/directories/memberships.
Query parameters
fieldsstringoptionalComma-separated list of the fields to return. Leave it out and you get every field — including fields added in the future, which is your call to make: name your fields if you want to be shielded from that.
Only first-level fields can be named. A nested list such as
attendees,tagsorsectionItemsis returned whole or not at all;attendees.nameis not supported.On a paged response the selection applies to the entries in
items;page,pageSize,totalandhasMoreare always returned. An unknown name is rejected with 400 rather than ignored.Selectable here:
enterprise,hasIndividualContract,pro,starter.Example:enterprise,hasIndividualContract
Response
hasIndividualContractbooleanrequiredWhether the directory has an individual contract with Sally.
starteranyrequiredStarter licenses.
proanyrequiredPro licenses.
enterpriseanyrequiredEnterprise licenses.
Status codes
- 200Success
- 400
Invalid request (validation error).
- 401
Missing or invalid bearer token.
- 403
ADMIN_ONLY_LICENSE_STATISTICS: only owners and administrators. - 404
Resource not found or not accessible.
- 429
Rate limit exceeded (per token/IP). Transcription uploads may also return
codeFUP_LIMIT_EXCEEDEDorTOO_MANY_CONCURRENT_TRANSCRIPTIONS. - 500
Internal server error.
- cURL
- JavaScript
- Python
curl "https://api.sally.io/v1.0/directories/$DIRECTORY_ID/license-statistics" \
-H "Authorization: Bearer $SALLY_TOKEN"
const response = await fetch(`https://api.sally.io/v1.0/directories/${directoryId}/license-statistics`, {
headers: {
Authorization: `Bearer ${process.env.SALLY_TOKEN}`,
},
});
const data = await response.json();
import os
import requests
response = requests.get(
f"https://api.sally.io/v1.0/directories/{directory_id}/license-statistics",
headers={"Authorization": f"Bearer {os.environ['SALLY_TOKEN']}"},
)
data = response.json()
{
"hasIndividualContract": true,
"starter": null,
"pro": null,
"enterprise": null
}
Lists the subscriptions of the directory
Every subscription of the directory that is not deleted, newest first, each with its subscriptionId, billing interval, licenses per tier, end of the current period and a scheduled change. Only owners and administrators. A directory managed by a reseller partner answers 409 MANAGED_BY_RESELLER_PARTNER: its partner books the licenses.
Path parameters
directoryIdstringrequiredId of the directory (the Sally company account) the resource belongs to. The directories a token can address are listed by
GET /v1.0/me/directories/memberships.
Query parameters
fieldsstringoptionalComma-separated list of the fields to return. Leave it out and you get every field — including fields added in the future, which is your call to make: name your fields if you want to be shielded from that.
Only first-level fields can be named. A nested list such as
attendees,tagsorsectionItemsis returned whole or not at all;attendees.nameis not supported.On a paged response the selection applies to the entries in
items;page,pageSize,totalandhasMoreare always returned. An unknown name is rejected with 400 rather than ignored.Selectable here:
billingInterval,currentPeriodEnd,enterpriseLicensesCount,isCanceled,proLicensesCount,scheduledChange,starterLicensesCount,status,subscriptionId,trialEndsOn.Example:billingInterval,currentPeriodEnd
Response
itemsobject[]requiredAll subscriptions of the directory that are not deleted, newest first.
10 child fields
subscriptionIdstringrequiredId of the subscription.
billingIntervalstringrequiredBilling interval.
Allowed values:monthlyyearlystatusstringrequiredtrialingduring the trial,canceledonce it is canceled (it still runs untilcurrentPeriodEnd), otherwiseactive.Allowed values:activetrialingcanceledstarterLicensesCountnumberrequiredStarter licenses booked.
proLicensesCountnumberrequiredPro licenses booked.
enterpriseLicensesCountnumberrequiredEnterprise licenses booked.
currentPeriodEndstringrequiredEnd of the current period (ISO-8601, UTC).
trialEndsOnstringrequirednullableEnd of the trial (ISO-8601, UTC), null without a trial.
isCanceledbooleanrequiredWhether the subscription is canceled at the end of the current period.
scheduledChangeanyrequirednullableA change scheduled for the end of the current period, or null: a reduction, or a member moving down to a lower tier (that tier is then higher here than today). A new lower target replaces it; the current number or a higher one removes it.
Status codes
- 200Success
- 400
Invalid request (validation error).
- 401
Missing or invalid bearer token.
- 403
OWNER_OR_ADMIN_ONLY_SUBSCRIPTION: only owners and administrators. - 404
Resource not found or not accessible.
- 409
MANAGED_BY_RESELLER_PARTNER: a reseller partner manages this directory and books its licenses. - 429
Rate limit exceeded (per token/IP). Transcription uploads may also return
codeFUP_LIMIT_EXCEEDEDorTOO_MANY_CONCURRENT_TRANSCRIPTIONS. - 500
Internal server error.
- cURL
- JavaScript
- Python
curl "https://api.sally.io/v1.0/directories/$DIRECTORY_ID/subscriptions" \
-H "Authorization: Bearer $SALLY_TOKEN"
const response = await fetch(`https://api.sally.io/v1.0/directories/${directoryId}/subscriptions`, {
headers: {
Authorization: `Bearer ${process.env.SALLY_TOKEN}`,
},
});
const data = await response.json();
import os
import requests
response = requests.get(
f"https://api.sally.io/v1.0/directories/{directory_id}/subscriptions",
headers={"Authorization": f"Bearer {os.environ['SALLY_TOKEN']}"},
)
data = response.json()
{
"items": [
{
"subscriptionId": "77e63339-474b-468f-a6b0-99e59513cd75",
"billingInterval": "monthly",
"status": "active",
"starterLicensesCount": 3,
"proLicensesCount": 3,
"enterpriseLicensesCount": 3,
"currentPeriodEnd": "string",
"trialEndsOn": "2026-09-24T09:30:00Z",
"isCanceled": true,
"scheduledChange": null
}
]
}
Starts a new subscription (returns the checkout link)
The same way as „Choose plan" on the Billing page in Sally. Sally never takes payment details through the API: the response carries a checkoutUrl, a person opens it, chooses the number of licenses (1 to 999) and pays. There is no trial; billing starts at once. After the purchase Sally creates the subscription, and GET …/subscriptions lists it within seconds. Only owners and administrators.
There can only be one running subscription. Every starting point has exactly one answer:
- No subscription, also after an earlier one ended:
201withcheckoutUrl. - A running subscription (active, trial, overdue, paused, or canceled until the end of the period):
409 SUBSCRIPTION_ALREADY_ACTIVEwith itssubscriptionId. Change it withPATCH …/subscriptions/{subscriptionId}. - A checkout completed in the last 24 hours whose subscription is still being set up:
409 SUBSCRIPTION_ALREADY_ACTIVEwithsubscriptionId: null. LoadGET …/subscriptionsagain in a few seconds. - An individual contract:
409 CUSTOM_CONTRACT_ACTIVE. - Managed by a reseller partner:
409 MANAGED_BY_RESELLER_PARTNER. - A tier without a price in this interval, for example „None":
400 LICENSE_NOT_BOOKABLE. - A
currencyCodeother than the one the directory has been billed in:409 CURRENCY_MISMATCH. - Neither owner nor administrator:
403 OWNER_OR_ADMIN_ONLY_SUBSCRIPTION.
Path parameters
directoryIdstringrequiredId of the directory (the Sally company account) the resource belongs to. The directories a token can address are listed by
GET /v1.0/me/directories/memberships.
Query parameters
fieldsstringoptionalComma-separated list of the fields to return. Leave it out and you get every field — including fields added in the future, which is your call to make: name your fields if you want to be shielded from that.
Only first-level fields can be named. A nested list such as
attendees,tagsorsectionItemsis returned whole or not at all;attendees.nameis not supported.On a paged response the selection applies to the entries in
items;page,pageSize,totalandhasMoreare always returned. An unknown name is rejected with 400 rather than ignored.Selectable here:
checkoutUrl,status.Example:checkoutUrl,status
Request body application/json
licenseIdstringrequiredLicense tier to book; resolve valid ids via
GET /v1.0/licenses. Only Starter, Pro and Enterprise can be booked.billingIntervalstringrequiredBilling interval.
Allowed values:monthlyyearlyExample:yearlycurrencyCodestringoptionalCurrency of the subscription. Leave it out to use the currency the directory has been billed in before, otherwise EUR.
Allowed values:EURUSD
Response
statusstringrequiredAlways
checkout_required.Allowed values:checkout_requiredcheckoutUrlstringrequiredLink to the Stripe checkout. A person opens it, chooses the number of licenses and pays; Sally then creates the subscription and lists it in
GET …/subscriptionswithin seconds. Every opening starts a new checkout until a purchase is completed.
Status codes
- 201Success
- 400
LICENSE_NOT_BOOKABLEorVALIDATION_FAILED. - 401
Missing or invalid bearer token.
- 403
OWNER_OR_ADMIN_ONLY_SUBSCRIPTION. - 404
Resource not found or not accessible.
- 409
SUBSCRIPTION_ALREADY_ACTIVE(withsubscriptionId),CUSTOM_CONTRACT_ACTIVE,MANAGED_BY_RESELLER_PARTNERorCURRENCY_MISMATCH. - 429
Rate limit exceeded (per token/IP). Transcription uploads may also return
codeFUP_LIMIT_EXCEEDEDorTOO_MANY_CONCURRENT_TRANSCRIPTIONS. - 500
Internal server error.
- cURL
- JavaScript
- Python
curl -X POST "https://api.sally.io/v1.0/directories/$DIRECTORY_ID/subscriptions" \
-H "Authorization: Bearer $SALLY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"licenseId": "f5f084e9-b993-425f-ad36-bfd5dc3f0e65",
"billingInterval": "yearly"
}'
const response = await fetch(`https://api.sally.io/v1.0/directories/${directoryId}/subscriptions`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SALLY_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"licenseId": "f5f084e9-b993-425f-ad36-bfd5dc3f0e65",
"billingInterval": "yearly"
}),
});
const data = await response.json();
import os
import requests
response = requests.post(
f"https://api.sally.io/v1.0/directories/{directory_id}/subscriptions",
headers={"Authorization": f"Bearer {os.environ['SALLY_TOKEN']}"},
json={
"licenseId": "f5f084e9-b993-425f-ad36-bfd5dc3f0e65",
"billingInterval": "yearly",
},
)
data = response.json()
{
"status": "checkout_required",
"checkoutUrl": "https://example.com/hooks/sally"
}
Changes the licenses of a subscription
The same booking and the same limits as „Adjust licenses" on the Billing page in Sally. Send only the tiers that change. Only owners and administrators.
- Increasing takes effect at once and is charged pro rata right away; send
acceptTerms: true. If the bank wants to confirm the payment, the answer is202with aconfirmationUrl: an owner or administrator confirms it on the Billing page in Sally, and until then nothing is booked. The change expires after about 23 hours. With SEPA direct debit the increase applies at once and the invoice stays open. - Reducing is scheduled for the end of the current period, without a credit, and shows up in
scheduledChange. During the trial it applies at once. A new lower target replaces the scheduled one, the current number or a higher one removes it. - Never below the licenses assigned through the subscription (
409 BELOW_ASSIGNED_LICENSESwith the tier and the minimum), unless the same request adds free seats in other tiers for every member who would lose theirs. Assigned licenses fill an individual contract first; otherwise take licenses away from members first withPATCH …/memberships/{userId}. - Switching tiers in one request: taking seats away from a tier and adding seats to a higher tier takes effect at once. Stripe credits the unused time of the lower tier against the higher one, so only the difference is charged, and members who held the lower tier move up. Moving a member down to a lower tier takes effect at the end of the current period: the member keeps the higher tier until then, there is no credit, and
scheduledChangeshows both tiers. - At most 2000 licenses per tier. The billing interval is changed in Sally only.
- Only the running subscription can be changed: an unknown id answers
404, an earlier or ended one409 SUBSCRIPTION_NOT_ACTIVE.
Path parameters
directoryIdstringrequiredId of the directory (the Sally company account) the resource belongs to. The directories a token can address are listed by
GET /v1.0/me/directories/memberships.subscriptionIdstringrequiredId of the subscription, from
GET …/subscriptions.
Query parameters
fieldsstringoptionalComma-separated list of the fields to return. Leave it out and you get every field — including fields added in the future, which is your call to make: name your fields if you want to be shielded from that.
Only first-level fields can be named. A nested list such as
attendees,tagsorsectionItemsis returned whole or not at all;attendees.nameis not supported.On a paged response the selection applies to the entries in
items;page,pageSize,totalandhasMoreare always returned. An unknown name is rejected with 400 rather than ignored.Selectable here:
billingInterval,currentPeriodEnd,enterpriseLicensesCount,isCanceled,proLicensesCount,scheduledChange,starterLicensesCount,status,subscriptionId,trialEndsOn.Example:billingInterval,currentPeriodEnd
Request body application/json
starterLicensesCountnumberoptionalTarget number of Starter licenses. Leave it out to keep the current number.
proLicensesCountnumberoptionalTarget number of Pro licenses. Leave it out to keep the current number.
enterpriseLicensesCountnumberoptionalTarget number of Enterprise licenses. Leave it out to keep the current number.
acceptTermsbooleanoptionalRequired as
truefor every increase: an increase is charged right away, and you accept the terms of use and the privacy policy with it, as on the Billing page in Sally.
Response
subscriptionIdstringrequiredId of the subscription.
billingIntervalstringrequiredBilling interval.
Allowed values:monthlyyearlystatusstringrequiredtrialingduring the trial,canceledonce it is canceled (it still runs untilcurrentPeriodEnd), otherwiseactive.Allowed values:activetrialingcanceledstarterLicensesCountnumberrequiredStarter licenses booked.
proLicensesCountnumberrequiredPro licenses booked.
enterpriseLicensesCountnumberrequiredEnterprise licenses booked.
currentPeriodEndstringrequiredEnd of the current period (ISO-8601, UTC).
trialEndsOnstringrequirednullableEnd of the trial (ISO-8601, UTC), null without a trial.
isCanceledbooleanrequiredWhether the subscription is canceled at the end of the current period.
scheduledChangeanyrequirednullableA change scheduled for the end of the current period, or null: a reduction, or a member moving down to a lower tier (that tier is then higher here than today). A new lower target replaces it; the current number or a higher one removes it.
Status codes
- 200The change is booked.
- 400
TERMS_NOT_ACCEPTEDorVALIDATION_FAILED. - 401
Missing or invalid bearer token.
- 402
LICENSE_PAYMENT_DECLINED: nothing was booked. - 403
OWNER_OR_ADMIN_ONLY_SUBSCRIPTION. - 404
SUBSCRIPTION_NOT_FOUND. - 409
BELOW_ASSIGNED_LICENSES,SUBSCRIPTION_NOT_ACTIVE,MANAGED_BY_RESELLER_PARTNERorLICENSE_CHANGE_PENDING_CONFIRMATION(withconfirmationUrl: an earlier change still waits for the bank). - 429
Rate limit exceeded (per token/IP). Transcription uploads may also return
codeFUP_LIMIT_EXCEEDEDorTOO_MANY_CONCURRENT_TRANSCRIPTIONS. - 500
Internal server error.
- cURL
- JavaScript
- Python
curl -X PATCH "https://api.sally.io/v1.0/directories/$DIRECTORY_ID/subscriptions/$SUBSCRIPTION_ID" \
-H "Authorization: Bearer $SALLY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"starterLicensesCount": 3,
"proLicensesCount": 3,
"enterpriseLicensesCount": 3,
"acceptTerms": true
}'
const response = await fetch(`https://api.sally.io/v1.0/directories/${directoryId}/subscriptions/${subscriptionId}`, {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SALLY_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"starterLicensesCount": 3,
"proLicensesCount": 3,
"enterpriseLicensesCount": 3,
"acceptTerms": true
}),
});
const data = await response.json();
import os
import requests
response = requests.patch(
f"https://api.sally.io/v1.0/directories/{directory_id}/subscriptions/{subscription_id}",
headers={"Authorization": f"Bearer {os.environ['SALLY_TOKEN']}"},
json={
"starterLicensesCount": 3,
"proLicensesCount": 3,
"enterpriseLicensesCount": 3,
"acceptTerms": True,
},
)
data = response.json()
{
"subscriptionId": "77e63339-474b-468f-a6b0-99e59513cd75",
"billingInterval": "monthly",
"status": "active",
"starterLicensesCount": 3,
"proLicensesCount": 3,
"enterpriseLicensesCount": 3,
"currentPeriodEnd": "string",
"trialEndsOn": "2026-09-24T09:30:00Z",
"isCanceled": true,
"scheduledChange": null
}