You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/api/subaccounts.apib
+100-5Lines changed: 100 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ description: Manage subaccounts, a way for service providers to provision and ma
4
4
5
5
# Group Subaccounts
6
6
7
+
<Banner status="warning"><strong>Deprecation of non-paginated results</strong>: All results returned from the `GET /api/v1/subaccounts` endpoint will be [paginated](#header-pagination) by default starting March 2022. Set the`cursor` parameter to `initial` to test paginated results.</Banner>
8
+
7
9
Subaccounts are a way for you to provision and manage senders separately from each other, and to provide assets and reporting data for each of them. This is useful for service providers who send on behalf of others or for a business that wants to separate their different streams of traffic. Learn more in our [subaccount guide](https://www.sparkpost.com/docs/user-guide/subaccounts/).
8
10
9
11
The following APIs have subaccount support:
@@ -43,6 +45,63 @@ When making POST, PUT, or DELETE requests without the `X-MSYS-SUBACCOUNT` header
43
45
44
46
<Banner status="info">`X-MSYS-SUBACCOUNT` is not required, but if provided, must be a number.</Banner>
45
47
48
+
###Pagination
49
+
50
+
The Subaccounts API supports pagination for queries with larger result sets. Pagination is done through the use of the `cursor` and `per_page` query parameters.
51
+
The `per_page` query parameter sets the number of subaccounts to return in a single request, and supports a maximum value of 100.
52
+
53
+
Once you have the response, you then can use `links` to retrieve the URL for your next page, which will be prefilled with the appropriate value for the `cursor` query parameter,
54
+
as well as any other filters you supplied with the original request.
55
+
56
+
If your result set is less than one page of data, then the `links` object will not have a `next` key.
57
+
58
+
+ Data Structure: Paginated Response
59
+
+ results (array) - A page of subaccount objects that match the search parameters.
60
+
+ total_count (number) - The total number of subaccounts that match the search parameters.
61
+
+ links (object)
62
+
+ next (string)
63
+
A URL that can be used to retrieve the next page of results. Will be prefilled with the appropriate value for the `cursor` query parameter, as well as any other filters supplied with the original request.
@@ -287,19 +346,55 @@ This endpoint only returns information about the subaccount, not the resources a
287
346
}
288
347
}
289
348
290
-
### List all Subaccounts [GET /v1/subaccounts{?option}]
349
+
### List Subaccounts [GET /v1/subaccounts]
350
+
351
+
<Banner status="warning"><strong>Deprecation of non-paginated results</strong>: All results returned from the `GET /api/v1/subaccounts` endpoint will be [paginated](#header-pagination) by default starting March 2022. Set the`cursor` parameter to `initial` to test paginated results.</Banner>
352
+
353
+
Returns a list of your subaccounts. Passing certain query parameters will cause results to be [paginated](#header-pagination).
354
+
355
+
+ Parameters
356
+
357
+
+ option (enum[string], optional) - Filters subaccounts to those with the option enabled.
358
+
+ Members
359
+
+ `deliverability`
360
+
361
+
+ cursor (string, optional) - A cursor provided in the `links` object of a page of results, used to get the next page of results. Set this parameter to `initial` to retrieve the first page of results. Passing this parameter will cause results to be [paginated](#header-pagination).
291
362
292
-
Returns a list of your subaccounts.
363
+
+ per_page (number, optional) - Limits the number of subaccounts that are returned in the `results` object. The maximum allowed value is 100. Passing this parameter will cause results to be [paginated](#header-pagination).
364
+
+ Default: 25
365
+
366
+
+ sort_by (enum[string], optional) - Sorts results by the specified property. Passing this parameter will cause results to be [paginated](#header-pagination).
367
+
+ Default: `created_at`
368
+
+ Members
369
+
+ `created_at`
370
+
+ `updated_at`
371
+
+ `id`
372
+
+ `name`
373
+
374
+
+ order (enum[string], optional) - Returns subaccounts in the specified order based on the `sort_by` parameter. `asc` returns results in ascending order, `desc` returns results in descending order. Passing this parameter will cause results to be [paginated](#header-pagination).
375
+
+ Default: `desc`
376
+
+ Members
377
+
+ `asc`
378
+
+ `desc`
379
+
380
+
+ ip_pool (string, optional) - Returns only subaccounts that are assigned to the IP pool with the ID passed in this parameter. Passing this parameter will cause results to be [paginated](#header-pagination).
381
+
382
+
+ status (enum[string], optional) - Returns only subaccounts with the specified status. Passing this parameter will cause results to be [paginated](#header-pagination).
383
+
+ Members
384
+
+ `active`
385
+
+ `suspended`
386
+
+ `terminated`
387
+
388
+
+ name (string, optional) - Returns subaccounts whose name includes the string passed in the parameter. May return false positives. Passing this parameter will cause results to be [paginated](#header-pagination).
389
+
390
+
+ ids: `1,2,3,4` (string, optional) - Returns only subaccounts with the IDs included in the comma separated list in the parameter. Passing this parameter will cause results to be [paginated](#header-pagination).
+ option (optional, string, `deliverability`) ... Filters subaccounts to those with the option enabled. The only valid value is currently `deliverability`.
0 commit comments