curl --request GET \
--url https://api.planetscale.com/v1/organizations/{organization}/service-tokens \
--header 'Authorization: <api-key>'{
"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>"
}
]
}
}
}
]
}List service tokens for an organization.
A service token must have at least one of the following access in order to use this API endpoint:
Service Token Accesses
read_service_tokens
curl --request GET \
--url https://api.planetscale.com/v1/organizations/{organization}/service-tokens \
--header 'Authorization: <api-key>'{
"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>"
}
]
}
}
}
]
}The name of the organization
If provided, specifies the page offset of returned results
If provided, specifies the number of returned results
Returns the organization's service tokens
The current page number
The next page number
The next page of results
The previous page number
The previous page of results
Show child attributes
The ID of the service token
The name of the service token
The display name of the service token
The plaintext token. Available only after create.
The plaintext refresh token. Available only after create.
The image source for the avatar of the service token
When the service token was created
When the service token was last updated
When the service token will expire
When the service token was last used
The ID of the actor on whose behalf the service token was created
The name of the actor on whose behalf the service token was created
The type of the actor on whose behalf the service token was created
Show child attributes
The ID of the service token access
The name of the service token access
The description of the service token access
The name of the resource the service token access gives access to
The ID of the resource the service token access gives access to
The type of the resource the service token access gives access to
Show child attributes
The ID for the resource
The name for the resource
When the resource was created
When the resource was last updated
When the resource was deleted, if deleted
Show child attributes
Show child attributes
Show child attributes
the name of the database the token has access to
the id of the database the token has access to
the name of the database's organization
the planetscale app url for the database
Show child attributes
Show child attributes
the name of the organization
the id of the organization
the planetscale app url for the organization
Show child attributes
Show child attributes
the name of the branch
the id of the branch
the name of the database the branch belongs to
the name of the organization the branch belongs to
the planetscale app url for the branch
Show child attributes
Was this page helpful?