Enumerate amendments¶
GET/
Partner API · Tenants
List all account amendments.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Partner-ID | header | string (uuid) | Yes | Partner ID. |
tenantId | path | string (uuid) | Yes | Tenant ID. |
fields | query | array of string | No | The fields to return in a partial response. |
status | query | array of string (enum) | No | Search by account amendment status. Items must be unique. Each item must be one of: pending, applied, failed, canceled. |
page | query | integer | No | The page number to fetch, starting with 1. |
pageSize | query | integer | No | The size of the page requested. |
pageTotal | query | boolean | No | Whether the number of pages should be calculated and returned in the response. |
Request samples¶
curl -X GET "https://api.central.sophos.com/partner/v1/tenants/<tenantId>/account-amendments" -H "Authorization: Bearer <access-token>" -H "X-Partner-ID: <partner-id>"
import requests
response = requests.get(
"https://api.central.sophos.com/partner/v1/tenants/<tenantId>/account-amendments",
headers={
"Authorization": "Bearer <access-token>",
"X-Partner-ID": "<partner-id>",
},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
"X-Partner-ID" = "<partner-id>"
}
Invoke-RestMethod -Method GET -Uri "https://api.central.sophos.com/partner/v1/tenants/<tenantId>/account-amendments" -Headers $headers
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.central.sophos.com/partner/v1/tenants/<tenantId>/account-amendments", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
req.Header.Set("X-Partner-ID", "<partner-id>")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
const response = await fetch("https://api.central.sophos.com/partner/v1/tenants/<tenantId>/account-amendments", {
method: "GET",
headers: {
"Authorization": "Bearer <access-token>",
"X-Partner-ID": "<partner-id>",
},
});
const data = await response.json();
console.log(data);
Responses¶
200 — Page of account amendments.¶
Response fields
itemsarray of objectrequiredList of account amendments.
Response from a request to create a new billing amendment.
Show child attributesHide child attributes
idstring (uuid)requiredAmendment ID.
statusstring (enum)requiredAccount amendment status.
Must be one of:
Must be one of:
pending, applied, failed, canceled.typestringrequiredAmendment request type.
Must be one of:
Must be one of:
billingChange, resumeAccount, cancelAccount, suspendAccount, unlinkFromPartner.effectiveAtstring (datetime)Date and time (UTC) when the amendment is effective.
createdAtstring (datetime)requiredDate and time (UTC) when the amendment request was created.
failedAtstring (datetime)Date and time (UTC) when the amendment request failed.
appliedAtstring (datetime)Date and time (UTC) when the amendment request was applied.
createdByobjectUser or service principal that made the change.
Show child attributesHide child attributes
idstringrequiredPrincipal ID.
typestringrequiredType of entity that made this change.
Must be one of:
Must be one of:
user, service.namestringPrincipal name.
accountTypestringAccount type for this principal.
Must be one of:
Must be one of:
partner, tenant, organization, distributor.accountIdstring (uuid)Account ID.
changesobjectrequiredChange object from an amendment request.
Show child attributesHide child attributes
billingTypeobjectBilling type change object.
Show child attributesHide child attributes
tostringrequiredBilling type that the tenant was changed to.
Must be one of:
Must be one of:
trial, ordered, usage.fromstringrequiredBilling type that the tenant was changed from.
Must be one of:
Must be one of:
trial, ordered, usage, term.productsobjectList of amended products.
Show child attributesHide child attributes
usageobjectShow child attributesHide child attributes
addedarray of stringItems must be unique. Each item must match the pattern
^[A-Z][a-zA-Z]{0,19}([0-9]{0,4})([-_][a-zA-Z0-9]{0,20}([0-9]{0,3})){0,5}$.removedarray of stringItems must be unique. Each item must match the pattern
^[A-Z][a-zA-Z]{0,19}([0-9]{0,4})([-_][a-zA-Z0-9]{0,20}([0-9]{0,3})){0,5}$.orderedobjectShow child attributesHide child attributes
addedarray of objectDefault products for ordered billing type.
Show child attributesHide child attributes
codestringrequiredSophos product code.
Must match the pattern
Must match the pattern
^[A-Z][a-zA-Z]{0,19}([0-9]{0,4})([-_][a-zA-Z0-9]{0,20}([0-9]{0,3})){0,5}$.quantityintegerrequiredQuantity for the number of seats.
removedarray of objectDefault products for ordered billing type.
Show child attributesHide child attributes
codestringrequiredSophos product code.
Must match the pattern
Must match the pattern
^[A-Z][a-zA-Z]{0,19}([0-9]{0,4})([-_][a-zA-Z0-9]{0,20}([0-9]{0,3})){0,5}$.quantityintegerrequiredQuantity for the number of seats.
modifiedarray of objectShow child attributesHide child attributes
codestringSophos product code.
Must match the pattern
Must match the pattern
^[A-Z][a-zA-Z]{0,19}([0-9]{0,4})([-_][a-zA-Z0-9]{0,20}([0-9]{0,3})){0,5}$.fromQuantityintegertoQuantityintegerstatusobjectAccount status type change.
Show child attributesHide child attributes
tostringrequiredStatus this account was changed to.
Must be one of:
Must be one of:
active, suspended, canceled.fromstringrequiredStatus this account was changed from.
Must be one of:
Must be one of:
active, suspended, canceled.partnerobjectPartner change.
Show child attributesHide child attributes
fromstring (uuid)requiredTenant should be unlinked from this partner account.
tostring (uuid)Tenant should be linked to this partner account.
pagesobjectrequiredShow child attributesHide child attributes
currentintegerrequiredThe 1-based page number being returned.
sizeintegerrequiredThe size of the page being returned.
totalinteger(Optional) The total number of pages that exist, if pageTotal=true in the request.
itemsinteger(Optional) The total number of items across all pages.
maxSizeintegerrequiredThe maximum page size that can be requested.
Errors¶
| Status | Meaning |
|---|---|
500 | Unexpected error. |
All error responses share the same shape — see the error response object.
Response examples¶
200¶
{
"items": [
{
"id": "00000000-0000-0000-0000-000000000000",
"status": "pending",
"type": "billingChange",
"effectiveAt": "2019-09-23T12:02:01.700Z",
"createdAt": "2019-09-23T12:02:01.700Z",
"failedAt": "2019-09-23T12:02:01.700Z",
"appliedAt": "2019-09-23T12:02:01.700Z",
"createdBy": {
"id": "string",
"type": "user",
"name": "string",
"accountType": "partner",
"accountId": "00000000-0000-0000-0000-000000000000"
},
"changes": {
"billingType": {
"to": "trial",
"from": "trial"
},
"products": {
"usage": {
"added": [
"string"
],
"removed": [
"string"
]
},
"ordered": {
"added": [
{
"code": "string",
"quantity": 0
}
],
"removed": [
{
"code": "string",
"quantity": 0
}
],
"modified": [
{
"code": "string",
"fromQuantity": 0,
"toQuantity": 0
}
]
}
},
"status": {
"to": "active",
"from": "active"
},
"partner": {
"from": "00000000-0000-0000-0000-000000000000",
"to": "00000000-0000-0000-0000-000000000000"
}
}
}
],
"pages": {
"current": 0,
"size": 0,
"total": 0,
"items": 0,
"maxSize": 0
}
}
See the guide for a narrative walkthrough of this API.