Skip to content

Begin New Session

POST
/ad/v1/session

Start a new session for the user. This will generate a new ad api token that is returned in the response header.

Authorizations

Parameters

Header Parameters

x-hz-ad-api-token

Optional header to make calling the endpoint faster by not requiring a new token to be generated.

string

Optional header to make calling the endpoint faster by not requiring a new token to be generated.

Request Body required

object
country_code
required

ISO 3166-1 alpha-2 country code for the user

string
>= 2 characters <= 2 characters
device_id

Unique Identifier for the device a session is started on. E.g should be the same for multiple users on the same device.

string
>= 1 characters <= 256 characters

Responses

200

Successful Response

Headers

x-hz-ad-api-token
string

Provide this token to future requests for the same user to make their requests faster (as a new token doesn't need to be generated)

403

Forbidden

object
auth_success
boolean
default: true
error_code
required
string
desc
required
string

422

Validation Error

object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string

500

Internal Server Error

Headers

x-hz-ad-api-token
string

Provide this token to future requests for the same user to make their requests faster (as a new token doesn't need to be generated)