Envelope
When calling an endpoint of our API, you'll get a specific response depending on the status of the request and the endpoint you called.
The envelope is always the same with the following structure:
{
"success": bool,
"data": Data Object,
"error": Error Object,
"pagination": Pagination Object
}
Response Objects
success
true
: The request was successful. Theerror
object will be an empty dict{}
.false
: The request was not successful. More information about the error can be found in theerror
object.
data
This object will contain the useful data in case of a sucessful request. It will always contain user_id or account_id (Except for the List Users response) and all the other fields will be dynamic, according to the endpoint you called.
Dynamic fields:
country
: The country of the user's account.platform
: The platform of the user's account.message
: Information provided in case of a failed connection.profile
: The user's profile. See the Profile section for more information.earnings
: The user's earnings. See the Earnings section for more information.accounts
: The user's accounts.users
: A company's users.
error
This object will contain information about the error in case of a failed request.
"error":{
"code": str,
"message": str,
"errors": [
{
"message": str,
"location": str
}
]
}
To get more information about potential errors, see the Errors section.
pagination
This object will only be included in the response for the endpoints where pagination is used, like:
POST /accounts/:account_id/earnings/search
POST /accounts
"pagination": {
"page": 1,
"items_per_page": 50,
"total_items": 200,
"total_pages": 4
}
The default value for items_per_page
is 100
, unless indicated otherwise in the request payload.