Skip to content

Public API: Get a Template

Isaiah Fisher edited this page Dec 5, 2024 · 2 revisions

Getting a specific template

The following endpoint lets you retrieve a specific template.

GET https://api.pneumatic.app/templates/<ID>

You need to supply the template's id, which you can find in its url:

Screenshot 2024-12-05 at 1 35 09 PM

This is what it looks like in python:

import requests

api_key = 'your_api_key'
headers = {
  'Authorization': f'Bearer {api_key}'
}
template_id = 42588

r = requests.get(f'https://api.pneumatic.app/templates/{template_id}', headers=headers)

The request returns a json describing the retrieved template in excruciating detail:

{
  "id": "int",
  "name": "str",
  "description": "str",
  "is_active": "bool",
  "is_public": "bool",
  "public_url": "str | null",
  "public_url": "str | null",
  "public_success_url": "str | null",
  "is_embedded": "?bool,     // default: false"
  "embed_url": "str | null",
  "finalizable": "bool",
  "date_updated": "str", //" ISO 8601 format: YYYY-MM-DDThh:mm:ss[.SSS]"
  "updated_by": "int",
  "template_owners": ["int"],
  "tasks_count": "int",
  "performers_count": "int",
  "kickoff": {
    "id": "int",
    "description": "str",
    "fields": [
      {
        "id": "int",
        "order": "int",
        "name": "str",
        "type": "str",
        "is_required": "bool",
        "description": "str",
        "default": "str",
        "api_name": "str",
        "selections": [ // these are only passed in for radio button checkbox and dropdown fields
          {
            "id": "int",
            "value": "str"
          }
        ]
      }
    ]
  },
  "tasks": [
    {
      "id": "int",
      "number": "int",
      "name": "str",
      "description": "str",
       "delay": "str",       // null if the formal is not aset as: '[DD] [[hh:]mm:]ss'
      "require_completion_by_all": "bool",
      "raw_due_date": {
          "api_name": "str",
          "duration": "str",
          "duration_months": "int, default 0",
          "rule": "str",
          "source_id": "?str | null"
      },
      "raw_performers": [
        {
          "id": "int",
          "type": "user|field|workflow_starter",
          "source_id": "?str", // id the id of a user, group or the api name of the field or null
          "label": "str"       // this is a read only parameter: the user name, group name or field name
        },
      ],
      "checklists": ?[
        {
          "api_name": "str",
          "selecions": [
            {
              "api_name": "str",
              "value": "str"
            }
          ]
        }
      ]
      "fields": ?[
        {
          "id": "int",
            "order": "int",
            "name": "str",
            "type": "str",
            "is_required": "bool",
            "description": "str",
          "default": "str",
            "api_name": "str",
            "selections": [ // these are only passed in for radio button checkbox and dropdown fields
              {
                "id": "int",
                "value": "str"
              }
            ]
        }
      ],
      "conditions": ?[
        {
          "id": "int",
          "action": "str", // end_process, skip_task, start_task
          "order": "int",
          "api_name": "str",
          "rules": [
            {
              "id": "int",
              "api_name": "str",
              "predicates": [
                {
                  "id": "int",
                  "field_type": "str",
                  "value": "Optional[str]",
                  "api_name": "str",
                  "field": "str", // the api_name of the field being used
                  "operator": "str" // equals, not_equals,  exists, not_exists, contains, not_contains, more_than, less_than
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Here null represents empty values for strings and numbers, [] represents empty values for lists and false is the default value for booleans.