Skip to main content
GET
/
organizations
/
{organization}
/
databases
/
{database}
/
schema-recommendations
/
{number}
Get a schema recommendation
curl --request GET \
  --url https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/schema-recommendations/{number} \
  --header 'Authorization: Bearer <token>'
{
  "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

The name of the organization

database
string
required

The name of the database

number
integer
required

The number for the schema recommendation

Response

Returns a schema recommendation

id
string
required

The ID of the schema recommendation

html_url
string
required

The URL to the schema recommendation in the app

title
string
required

The title of the schema recommendation

table_name
string
required

The name of the table the recommendation applies to

keyspace
string
required

The keyspace the recommendation applies to

ddl_statement
string
required

The DDL statement to apply the recommendation

number
integer
required

The number of the schema recommendation

state
enum<string>
required

The state of the recommendation

Available options:
open,
applied,
dismissed,
stale
recommendation_type
enum<string>
required

The type of recommendation

Available options:
unused_table,
unused_index,
duplicate_index,
sequence_overflow,
sequence_overflow_foreign_key,
new_index,
encoding_upgrade,
bloated_table,
bloated_index
created_at
string
required

When the recommendation was created

updated_at
string
required

When the recommendation was last updated

applied_at
string
required

When the recommendation was applied

dismissed_at
string
required

When the recommendation was dismissed

closed_by_deploy_request
object
required
dismissed_by
object
required