cURL
curl --request POST \
--url http://localhost:4100/v1/auth/session \
--header 'Content-Type: application/json' \
--data '
{
"privyToken": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({privyToken: '<string>'})
};
fetch('http://localhost:4100/v1/auth/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"sessionToken": "<string>",
"accountId": "<string>",
"signerAddress": "<string>",
"privyUserId": "<string>",
"kind": "browser",
"clientName": "<string>",
"issuedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"locked": true
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}Consumer session
Post v1authsession
cURL
curl --request POST \
--url http://localhost:4100/v1/auth/session \
--header 'Content-Type: application/json' \
--data '
{
"privyToken": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({privyToken: '<string>'})
};
fetch('http://localhost:4100/v1/auth/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"sessionToken": "<string>",
"accountId": "<string>",
"signerAddress": "<string>",
"privyUserId": "<string>",
"kind": "browser",
"clientName": "<string>",
"issuedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"locked": true
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}Response
Session created.