Skip to content

Enumerate amendments

GET/tenants/{tenantId}/account-amendments

Partner API · Tenants

List all account amendments.

Required permissionaccount_management:read OR license_management:read

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 objectrequired
List of account amendments.
Response from a request to create a new billing amendment.
Show child attributesHide child attributes
idstring (uuid)required
Amendment ID.
statusstring (enum)required
Account amendment status.
Must be one of: pending, applied, failed, canceled.
typestringrequired
Amendment request type.
Must be one of: billingChange, resumeAccount, cancelAccount, suspendAccount, unlinkFromPartner.
effectiveAtstring (datetime)
Date and time (UTC) when the amendment is effective.
createdAtstring (datetime)required
Date 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.
createdByobject
User or service principal that made the change.
Show child attributesHide child attributes
idstringrequired
Principal ID.
typestringrequired
Type of entity that made this change.
Must be one of: user, service.
namestring
Principal name.
accountTypestring
Account type for this principal.
Must be one of: partner, tenant, organization, distributor.
accountIdstring (uuid)
Account ID.
changesobjectrequired
Change object from an amendment request.
Show child attributesHide child attributes
billingTypeobject
Billing type change object.
Show child attributesHide child attributes
tostringrequired
Billing type that the tenant was changed to.
Must be one of: trial, ordered, usage.
fromstringrequired
Billing type that the tenant was changed from.
Must be one of: trial, ordered, usage, term.
productsobject
List of amended products.
Show child attributesHide child attributes
usageobject
Show child attributesHide child attributes
addedarray of string
Items 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 string
Items 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}$.
orderedobject
Show child attributesHide child attributes
addedarray of object
Default products for ordered billing type.
Show child attributesHide child attributes
codestringrequired
Sophos product code.
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}$.
quantityintegerrequired
Quantity for the number of seats.
removedarray of object
Default products for ordered billing type.
Show child attributesHide child attributes
codestringrequired
Sophos product code.
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}$.
quantityintegerrequired
Quantity for the number of seats.
modifiedarray of object
Show child attributesHide child attributes
codestring
Sophos product code.
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}$.
fromQuantityinteger
toQuantityinteger
statusobject
Account status type change.
Show child attributesHide child attributes
tostringrequired
Status this account was changed to.
Must be one of: active, suspended, canceled.
fromstringrequired
Status this account was changed from.
Must be one of: active, suspended, canceled.
partnerobject
Partner change.
Show child attributesHide child attributes
fromstring (uuid)required
Tenant should be unlinked from this partner account.
tostring (uuid)
Tenant should be linked to this partner account.
pagesobjectrequired
Show child attributesHide child attributes
currentintegerrequired
The 1-based page number being returned.
sizeintegerrequired
The 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.
maxSizeintegerrequired
The 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.