Skip to main content

Documentation Index

Fetch the complete documentation index at: https://www.plain.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Using TypeScript? Check out our GraphQL SDK for a fully typed client.
You can fetch snippets either as a paginated collection or by ID. These queries require the following permissions:
  • snippet:read

Get snippets

Query
query getSnippets($first: Int = 50, $after: String) {
  snippets(first: $first, after: $after) {
    edges {
      node {
        id
        name
        text
        markdown
        path
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 50
}

Get a snippet by ID

Query
query getSnippet($snippetId: ID!) {
  snippet(snippetId: $snippetId) {
    id
    name
    text
    markdown
    path
  }
}
Variables
{
  "snippetId": "sn_01HXXXXXXXXXXXXXXXXXXXXXXX"
}