> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.staple.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.staple.ai/_mcp/server.

# Get Model Templates

POST https://api.staple.io/v1/models/templates
Content-Type: application/json

Get the model templates that are used by any specific model.

Reference: https://docs.staple.ai/api-reference/v1/models/get-model-templates

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v1
  version: 1.0.0
paths:
  /v1/models/templates:
    post:
      operationId: getModelTemplates
      summary: Get Model Templates
      description: Get the model templates that are used by any specific model.
      tags:
        - models
      parameters:
        - name: x-api-key
          in: header
          description: API key issued by Staple.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Models_getModelTemplates_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                input:
                  $ref: >-
                    #/components/schemas/V1ModelsTemplatesPostRequestBodyContentApplicationJsonSchemaInput
                pagination:
                  $ref: >-
                    #/components/schemas/V1ModelsTemplatesPostRequestBodyContentApplicationJsonSchemaPagination
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    V1ModelsTemplatesPostRequestBodyContentApplicationJsonSchemaInput:
      type: object
      properties:
        mid:
          type: integer
        status:
          type: string
      title: V1ModelsTemplatesPostRequestBodyContentApplicationJsonSchemaInput
    V1ModelsTemplatesPostRequestBodyContentApplicationJsonSchemaPagination:
      type: object
      properties:
        skip:
          type: integer
        take:
          type: integer
      title: V1ModelsTemplatesPostRequestBodyContentApplicationJsonSchemaPagination
    Models_getModelTemplates_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Models_getModelTemplates_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key issued by Staple.
    bearerAuth:
      type: http
      scheme: bearer
      description: JWT obtained from the login endpoint.

```

## Examples

### Get Model Templates



**Request**

```json
undefined
```

**Response**

```json
{
  "getTemplatesByStatus": {
    "data": [
      {
        "createdAt": 1617852200027,
        "errorMessage": null,
        "id": 1,
        "mid": 44,
        "numPages": 2,
        "templateName": "KPMG Test.pdf",
        "uid": 1,
        "uploadedAt": 1626992041907,
        "uploadedBy": "developer@gmail.com"
      },
      {
        "createdAt": 1618444815676,
        "errorMessage": null,
        "id": 2,
        "mid": 44,
        "numPages": 1,
        "templateName": "i4.pdf",
        "uid": 1,
        "uploadedAt": 1618444815000,
        "uploadedBy": "developer@gmail.com"
      },
      {
        "createdAt": 1618802449990,
        "errorMessage": null,
        "id": 3,
        "mid": 44,
        "numPages": 2,
        "templateName": "re-in.pdf",
        "uid": 1,
        "uploadedAt": 1635402653854,
        "uploadedBy": "developer@gmail.com"
      }
    ],
    "pageInfo": {
      "hasNextPage": false,
      "hasPreviousPage": false,
      "lastCursor": 3
    },
    "total": 3
  }
}
```

**SDK Code**

```python Get Model Templates
import requests

url = "https://api.staple.io/v1/models/templates"

headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Get Model Templates
const url = 'https://api.staple.io/v1/models/templates';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Get Model Templates
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.staple.io/v1/models/templates"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Get Model Templates
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v1/models/templates")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Get Model Templates
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v1/models/templates")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Get Model Templates
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v1/models/templates', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Get Model Templates
using RestSharp;

var client = new RestClient("https://api.staple.io/v1/models/templates");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Get Model Templates
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v1/models/templates")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Models_getModelTemplates_example



**Request**

```json
{
  "input": {
    "mid": 44,
    "status": "RECEIVED"
  },
  "pagination": {
    "skip": 0,
    "take": 10
  }
}
```

**Response**

```json
{
  "getTemplatesByStatus": {
    "data": [
      {
        "createdAt": 1617852200027,
        "errorMessage": null,
        "id": 1,
        "mid": 44,
        "numPages": 2,
        "templateName": "KPMG Test.pdf",
        "uid": 1,
        "uploadedAt": 1626992041907,
        "uploadedBy": "developer@gmail.com"
      },
      {
        "createdAt": 1618444815676,
        "errorMessage": null,
        "id": 2,
        "mid": 44,
        "numPages": 1,
        "templateName": "i4.pdf",
        "uid": 1,
        "uploadedAt": 1618444815000,
        "uploadedBy": "developer@gmail.com"
      },
      {
        "createdAt": 1618802449990,
        "errorMessage": null,
        "id": 3,
        "mid": 44,
        "numPages": 2,
        "templateName": "re-in.pdf",
        "uid": 1,
        "uploadedAt": 1635402653854,
        "uploadedBy": "developer@gmail.com"
      }
    ],
    "pageInfo": {
      "hasNextPage": false,
      "hasPreviousPage": false,
      "lastCursor": 3
    },
    "total": 3
  }
}
```

**SDK Code**

```python Models_getModelTemplates_example
import requests

url = "https://api.staple.io/v1/models/templates"

payload = {
    "input": {
        "mid": 44,
        "status": "RECEIVED"
    },
    "pagination": {
        "skip": 0,
        "take": 10
    }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Models_getModelTemplates_example
const url = 'https://api.staple.io/v1/models/templates';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"input":{"mid":44,"status":"RECEIVED"},"pagination":{"skip":0,"take":10}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Models_getModelTemplates_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.staple.io/v1/models/templates"

	payload := strings.NewReader("{\n  \"input\": {\n    \"mid\": 44,\n    \"status\": \"RECEIVED\"\n  },\n  \"pagination\": {\n    \"skip\": 0,\n    \"take\": 10\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Models_getModelTemplates_example
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v1/models/templates")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"input\": {\n    \"mid\": 44,\n    \"status\": \"RECEIVED\"\n  },\n  \"pagination\": {\n    \"skip\": 0,\n    \"take\": 10\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Models_getModelTemplates_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v1/models/templates")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"input\": {\n    \"mid\": 44,\n    \"status\": \"RECEIVED\"\n  },\n  \"pagination\": {\n    \"skip\": 0,\n    \"take\": 10\n  }\n}")
  .asString();
```

```php Models_getModelTemplates_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v1/models/templates', [
  'body' => '{
  "input": {
    "mid": 44,
    "status": "RECEIVED"
  },
  "pagination": {
    "skip": 0,
    "take": 10
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Models_getModelTemplates_example
using RestSharp;

var client = new RestClient("https://api.staple.io/v1/models/templates");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"input\": {\n    \"mid\": 44,\n    \"status\": \"RECEIVED\"\n  },\n  \"pagination\": {\n    \"skip\": 0,\n    \"take\": 10\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Models_getModelTemplates_example
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "input": [
    "mid": 44,
    "status": "RECEIVED"
  ],
  "pagination": [
    "skip": 0,
    "take": 10
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v1/models/templates")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```