Exchange a mobile PKCE code or rotate a refresh credential
POST
/v1/mobile/token
const url = 'https://api.vocapable.com/v1/mobile/token';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"grant_type":"authorization_code","client_id":"vocapable-mobile","authorization_code":"example","code_verifier":"example","redirect_uri":"example","refresh_token":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.vocapable.com/v1/mobile/token \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "grant_type": "authorization_code", "client_id": "vocapable-mobile", "authorization_code": "example", "code_verifier": "example", "redirect_uri": "example", "refresh_token": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
MobileTokenRequest
The two native token-exchange grants; no API key may satisfy either one.
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
MobileTokenResponse
Tokens returned once over TLS to the native app’s secure device storage.
object
access_token
required
Access Token
string
refresh_token
required
Refresh Token
string
token_type
Token Type
string
expires_at
required
Expires At
string format: date-time
tenant_id
required
Tenant Id
string
membership_id
required
Membership Id
string
device_id
required
Device Id
string
role
required
TenantMembershipRole
The only roles a customer can hold in one workspace.
string
Example
{ "token_type": "Bearer", "role": "admin"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}