Oauth Token

The oauth token resource.

Basehttps://rest.carbon.ms/oauthToken
GET/oauthToken

List oauth tokens

Retrieve a paginated list of oauth tokens. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GEThttps://rest.carbon.ms/oauthToken
curl --request GET \
  --url 'https://rest.carbon.ms/oauthToken?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "accessToken": "string",
    "refreshToken": "string",
    "clientId": "xyz789",
    "userId": "xyz789",
    "companyId": "xyz789",
    "expiresAt": "2026-01-01T00:00:00Z",
    "createdAt": "2026-01-01T00:00:00Z"
  }
]
GET/oauthToken

Retrieve a oauth token

Fetch a single oauth token by filtering on `id`.

Query parameters

idstring

Match on the oauth token's `id`, e.g. `eq.{id}`.

GEThttps://rest.carbon.ms/oauthToken
curl --request GET \
  --url 'https://rest.carbon.ms/oauthToken?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "accessToken": "string",
  "refreshToken": "string",
  "clientId": "xyz789",
  "userId": "xyz789",
  "companyId": "xyz789",
  "expiresAt": "2026-01-01T00:00:00Z",
  "createdAt": "2026-01-01T00:00:00Z"
}
POST/oauthToken

Create a oauth token

Create a new oauth token.

Body parameters

accessTokenstringrequired
refreshTokenstringrequired
clientIdstringrequired

References oauthClient.clientId

userIdstringrequired

References user.id

companyIdstringrequired

References company.id

expiresAttimestamprequired
POSThttps://rest.carbon.ms/oauthToken
curl --request POST \
  --url https://rest.carbon.ms/oauthToken \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"accessToken":"string","refreshToken":"string","clientId":"xyz789","userId":"xyz789","companyId":"xyz789","expiresAt":"2026-01-01T00:00:00Z"}'
Response
{
  "id": "abc123def456",
  "accessToken": "string",
  "refreshToken": "string",
  "clientId": "xyz789",
  "userId": "xyz789",
  "companyId": "xyz789",
  "expiresAt": "2026-01-01T00:00:00Z",
  "createdAt": "2026-01-01T00:00:00Z"
}
PATCH/oauthToken

Update a oauth token

Update an existing oauth token, matched on `id`.

Body parameters

accessTokenstringrequired
refreshTokenstringrequired
clientIdstringrequired

References oauthClient.clientId

userIdstringrequired

References user.id

companyIdstringrequired

References company.id

expiresAttimestamprequired
PATCHhttps://rest.carbon.ms/oauthToken
curl --request PATCH \
  --url 'https://rest.carbon.ms/oauthToken?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"accessToken":"string"}'
Response
{
  "id": "abc123def456",
  "accessToken": "string",
  "refreshToken": "string",
  "clientId": "xyz789",
  "userId": "xyz789",
  "companyId": "xyz789",
  "expiresAt": "2026-01-01T00:00:00Z",
  "createdAt": "2026-01-01T00:00:00Z"
}
DELETE/oauthToken

Delete a oauth token

Delete a oauth token, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the oauth token to delete, e.g. `eq.{id}`.

DELETEhttps://rest.carbon.ms/oauthToken
curl --request DELETE \
  --url 'https://rest.carbon.ms/oauthToken?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content