Skip to main content
GET
/
organizations
/
{organization}
/
oauth-applications
/
{application_id}
/
tokens
List OAuth tokens
curl --request GET \
  --url https://api.planetscale.com/v1/organizations/{organization}/oauth-applications/{application_id}/tokens \
  --header 'Authorization: Bearer <token>'
{
  "current_page": 123,
  "next_page": 123,
  "next_page_url": "<string>",
  "prev_page": 123,
  "prev_page_url": "<string>",
  "data": [
    {
      "id": "<string>",
      "name": "<string>",
      "display_name": "<string>",
      "token": "<string>",
      "plain_text_refresh_token": "<string>",
      "avatar_url": "<string>",
      "created_at": "<string>",
      "updated_at": "<string>",
      "expires_at": "<string>",
      "last_used_at": "<string>",
      "actor_id": "<string>",
      "actor_display_name": "<string>",
      "actor_type": "<string>",
      "service_token_accesses": [
        {
          "id": "<string>",
          "access": "<string>",
          "description": "<string>",
          "resource_name": "<string>",
          "resource_id": "<string>",
          "resource_type": "<string>",
          "resource": {
            "id": "<string>",
            "name": "<string>",
            "created_at": "<string>",
            "updated_at": "<string>",
            "deleted_at": "<string>"
          }
        }
      ],
      "oauth_accesses_by_resource": {
        "database": {
          "databases": [
            {
              "name": "<string>",
              "id": "<string>",
              "organization": "<string>",
              "url": "<string>"
            }
          ],
          "accesses": [
            {
              "name": "<string>",
              "description": "<string>"
            }
          ]
        },
        "organization": {
          "organizations": [
            {
              "name": "<string>",
              "id": "<string>",
              "url": "<string>"
            }
          ],
          "accesses": [
            {
              "name": "<string>",
              "description": "<string>"
            }
          ]
        },
        "branch": {
          "branches": [
            {
              "name": "<string>",
              "id": "<string>",
              "database": "<string>",
              "organization": "<string>",
              "url": "<string>"
            }
          ],
          "accesses": [
            {
              "name": "<string>",
              "description": "<string>"
            }
          ]
        },
        "user": {
          "users": [
            {
              "name": "<string>",
              "id": "<string>"
            }
          ],
          "accesses": [
            {
              "name": "<string>",
              "description": "<string>"
            }
          ]
        }
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

organization
string
required

The name of the organization the OAuth application belongs to

application_id
string
required

The ID of the OAuth application

Query Parameters

page
integer
default:1

If provided, specifies the page offset of returned results

per_page
integer
default:25

If provided, specifies the number of returned results

Response

Returns the OAuth tokens issued on behalf of the OAuth application

current_page
integer
required

The current page number

next_page
integer
required

The next page number

next_page_url
string
required

The next page of results

prev_page
integer
required

The previous page number

prev_page_url
string
required

The previous page of results

data
object[]
required