Token
An OAuth token.
Operations
Every route this entity exposes. Each route links to its own reference on this page.
| Method | Route | SDK operation | Returns |
|---|---|---|---|
POST |
/oauth/token |
create |
Token created successfully |
Examples
One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.
Golang
Construct client as shown in the Golang setup, then call the operations:
created, err := client.Token(nil).Create(map[string]any{"access_token": "example", "created_at": "example", "expires_at": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(created)
Lua
Construct client as shown in the Lua setup, then call the operations:
local created, err = client:Token():create({ access_token = "example", created_at = "example", expires_at = "example" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$created = $client->Token()->create(["access_token" => "example", "created_at" => "example", "expires_at" => "example"]);
Python
Construct client as shown in the Python setup, then call the operations:
created = client.Token().create({ "access_token": "example", "created_at": "example", "expires_at": "example" })
Ruby
Construct client as shown in the Ruby setup, then call the operations:
created = client.Token.create({ "access_token" => "example", "created_at" => "example", "expires_at" => "example" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const created = await client.Token().create({ access_token: "example", created_at: "example", expires_at: "example" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
access_token |
string |
No | Access token to be used when calling the API. |
created_at |
string |
No | Token creation time in ISO 8601 format. |
expires_at |
string |
No | Access token expiration timestamp (UTC). |
expires_in |
integer |
No | Access token expiry time in seconds. |
refresh_token |
string |
No | Refresh token used to obtain new user access tokens without requiring the user to re-authorise. |
refresh_token_expires_at |
string |
No | Refresh token expiration timestamp (UTC). |
refresh_token_expires_in |
integer |
No | Refresh token expiry time in seconds. |
scope |
string |
No | Scope of the token. |
token_type |
string |
No | Type of the token. |
create
POST /oauth/token
Operation ID: oauthTokenCreate.
Authentication: basic token (BasicAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
X-External-Correlation-Id |
header |
string (uuid) |
No | Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more. |
Request body
application/x-www-form-urlencoded
The request body is object or object or object or object.
Responses
200: Token created successfully
application/json
| Property | Type | Required | Description |
|---|---|---|---|
access_token |
string |
No | Access token to be used when calling the API. Valid for 12 hours. |
created_at |
string |
No | Token creation time in ISO 8601 format. Only returned for user access token grant types (registration_code, authorization_code, refresh_token). |
expires_at |
string |
No | Access token expiration timestamp (UTC). |
expires_in |
integer (int32) |
No | Access token expiry time in seconds. |
refresh_token |
string |
No | Refresh token used to obtain new user access tokens without requiring the user to re-authorise. Valid for up to 20 years. Only returned for user access token grant types (registration_code, authorization_code, refresh_token). |
refresh_token_expires_at |
string |
No | Refresh token expiration timestamp (UTC). Only returned for user access token grant types (registration_code, authorization_code, refresh_token). |
refresh_token_expires_in |
integer (int32) |
No | Refresh token expiry time in seconds. Only returned for user access token grant types (registration_code, authorization_code, refresh_token). |
scope |
string |
No | Scope of the token. |
token_type |
string |
No | Type of the token. |
400: Bad request
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
No | |
error_description |
string |
No |
401: Invalid credentials. For example, the user reclaimed the account or an invalid registration code was used
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
No | |
error_description |
string |
No |
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header
application/json
The response is object.