Skip to content

Lists SQL snippets for the logged in user

get/v1/snippets

OAuth scopes

  • database:read

The fine-grained token must include the following permissions to access this endpoint:

  • snippets_read

Query parameters

  • project_ref
    Optional
    string

    Project ref

  • cursor
    Optional
    string
  • limit
    Optional
    string
  • sort_by
    Optional
    enum
  • sort_order
    Optional
    enum

Response codes

  • 200
  • 401
  • 403
  • 429
  • 500

Response (200)

{
"data": [
{
"id": "lorem",
"inserted_at": "lorem",
"updated_at": "lorem",
"type": "sql",
"visibility": "user",
"name": "lorem",
"description": "lorem",
"project": {
"id": 42,
"name": "lorem"
},
"owner": {
"id": 42,
"username": "lorem"
},
"updated_by": {
"id": 42,
"username": "lorem"
},
"favorite": true
}
],
"cursor": "lorem"
}
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"inserted_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"sql"
]
},
"visibility": {
"type": "string",
"enum": [
"user",
"project",
"org",
"public"
]
},
"name": {
"type": "string"
},
"description": {
"type": "string",
"nullable": true
},
"project": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name"
]
},
"owner": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"username": {
"type": "string"
}
},
"required": [
"id",
"username"
]
},
"updated_by": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"username": {
"type": "string"
}
},
"required": [
"id",
"username"
]
},
"favorite": {
"type": "boolean"
}
},
"required": [
"id",
"inserted_at",
"updated_at",
"type",
"visibility",
"name",
"description",
"project",
"owner",
"updated_by",
"favorite"
]
}
},
"cursor": {
"type": "string"
}
},
"required": [
"data"
]
}