Skip to main content

List Templates

Retrieve all artifact type templates available to you.

Endpoint

GET /templates

Request

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key
X-API-SecretYesYour API secret

Query Parameters

ParameterTypeRequiredDescription
statusstringNoFilter by status: draft, pending_approval, published, deprecated
pageintegerNoPage number (default: 1)
limitintegerNoItems per page (default: 20, max: 100)

Example Request

curl -X GET "https://api.docyard.io/v1/templates?status=published&limit=10" \
  -H "X-API-Key: dk_live_dist_aaaaaaaa" \
  -H "X-API-Secret: dk_secret_dist_bbbbbbbb"

Response

Success (200 OK)

{
  "templates": [
    {
      "template_id": "tmpl-ins-dec-001",
      "name": "Insurance Declaration Page",
      "description": "Standard insurance declaration document",
      "status": "published",
      "owner": {
        "id": "dist-abc123",
        "name": "Acme Insurance"
      },
      "locks_count": 6,
      "required_locks_count": 3,
      "created_at": "2026-03-10T09:00:00Z",
      "published_at": "2026-03-12T14:00:00Z"
    },
    {
      "template_id": "tmpl-ins-end-001",
      "name": "Insurance Endorsement",
      "description": "Policy endorsement document",
      "status": "published",
      "owner": {
        "id": "dist-abc123",
        "name": "Acme Insurance"
      },
      "locks_count": 5,
      "required_locks_count": 2,
      "created_at": "2026-03-11T10:00:00Z",
      "published_at": "2026-03-13T11:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 2,
    "total_pages": 1
  }
}

Response Fields

FieldTypeDescription
template_idstringUnique template identifier
namestringTemplate name
descriptionstringTemplate description
statusstringCurrent status
ownerobjectTemplate owner information
locks_countintegerTotal number of locks
required_locks_countintegerNumber of required locks
created_atstringCreation timestamp
published_atstringWhen template was published (if applicable)

Error Responses

Unauthorized (401)

{
  "error": "invalid_api_key",
  "message": "The provided API key is invalid",
  "request_id": "req-abc123xyz"
}

Forbidden (403)

{
  "error": "access_denied",
  "message": "You do not have permission to view templates",
  "request_id": "req-abc123xyz"
}

Code Examples

Node.js

const templates = await client.templates.list({
  status: 'published',
  limit: 10
});

console.log(templates.data);

Python

templates = client.templates.list(
    status='published',
    limit=10
)

print(templates['templates'])

Go

templates, err := client.Templates.List(&docyard.ListTemplatesOptions{
    Status: "published",
    Limit: 10,
})