Skip to main content
GET
/
organizations
/
{organization}
/
databases
/
{database}
/
schema-recommendations
List schema recommendations
curl --request GET \
  --url https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/schema-recommendations \
  --header 'Authorization: Bearer <token>'
{
  "current_page": 123,
  "next_page": 123,
  "next_page_url": "<string>",
  "prev_page": 123,
  "prev_page_url": "<string>",
  "data": [
    {
      "id": "<string>",
      "html_url": "<string>",
      "title": "<string>",
      "table_name": "<string>",
      "keyspace": "<string>",
      "ddl_statement": "<string>",
      "number": 123,
      "state": "open",
      "recommendation_type": "unused_table",
      "created_at": "<string>",
      "updated_at": "<string>",
      "applied_at": "<string>",
      "dismissed_at": "<string>",
      "closed_by_deploy_request": {
        "id": "<string>",
        "branch_id": "<string>",
        "number": 123
      },
      "dismissed_by": {
        "id": "<string>",
        "display_name": "<string>",
        "avatar_url": "<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

Organization name slug from list_organizations. Example: acme.

database
string
required

Database name slug from list_databases. Example: app-db.

Query Parameters

state
enum<string>

Filter by recommendation state

Available options:
open,
closed

Response

Returns schema recommendations

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