Accounts
The Playbooks API offers the ability to access other accounts (ie teams) associated with your session.
In doing so, you're able to act on their behalf, in accordance with your permissions, by passing an account
header in your request.
Headers
Header | Type | Description |
---|---|---|
Account | string | Your account identifier |
Endpoints
To keep things concise, the Playbooks API offers the following endpoints when using the account
header:
/account
/account/*
Depending on the account
header you pass, those endpoints will forward your request to the appropriate resource shown below:
/session
/session/*
/session/teams/<team_uuid>
/session/teams/<team_uuid>/*
To see this in action, simply copy / paste the following commands and replace the display headers with your own credentials. You should get the same 200 response as shown for both requests.
Requests
Account Requestcurl -L "https://api.playbooks.xyz/account" --header "Authorization: <your_api_key>" --header "Account: <team_uuid>"
Session Team Requestcurl "https://api.playbooks.xyz/session/teams/<team_uuid>" --header "Authorization: <your_api_key>" --header "Account: <team_uuid>"
Response
Response{ "data": { "type": "teams", "id": "6", "attributes": { "status": "active", "name": "Mile Hi Labs", "tagline": "Elevated Software & System Design", ... } }, "included": [], "meta": {}, }
Notes
Note the use of -L
in the convenience request above.
This tells curl to accept / follow the server-side redirect.