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.
We provide three methods for fetching tasks:
  1. Get tasks — paginated collection
  2. Get task by ID
  3. Get task by refref is the short human-readable identifier shown in the Plain app (e.g. T-123)
These queries require the following permissions:
  • task:read

Get tasks

Query
query getTasks($first: Int = 50, $after: String) {
  tasks(first: $first, after: $after) {
    edges {
      node {
        id
        ref
        title
        description
        status
        priority
        assignedTo {
          __typename
          ... on User {
            id
            fullName
          }
          ... on MachineUser {
            id
            fullName
          }
        }
        company {
          id
          name
        }
        tenant {
          id
          name
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 50
}

Get task by ID

Query
query getTask($taskId: ID!) {
  task(taskId: $taskId) {
    id
    ref
    title
    description
    status
    priority
    assignedTo {
      __typename
      ... on User {
        id
        fullName
      }
      ... on MachineUser {
        id
        fullName
      }
    }
  }
}
Variables
{
  "taskId": "ta_01HXXXXXXXXXXXXXXXXXXXXXXX"
}

Get task by ref

Query
query getTaskByRef($ref: String!) {
  taskByRef(ref: $ref) {
    id
    ref
    title
    description
    status
    priority
  }
}
Variables
{
  "ref": "T-123"
}