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

# Add a template by URL, or get a presigned upload URL

POST https://api.cloudraker.com/v1/templates
Content-Type: application/json

Adds a blank form to your organization's template library.

The two request shapes match [POST /v1/files](https://docs.cloudraker.com/api/cloud-raker-api/files/create-file):

- `{ url, name? }` — fetched over http(s) for you.
- `{ name, mimeType }` — returns `uploadUrl` plus `uploadExpiresAt` (15 minutes); `PUT` the bytes with a `Content-Type` equal to the `mimeType` you sent.

```json
{ "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf", "name": "w9.pdf" }
```

<Note>
Templates are deliberately never parsed or indexed — they are documents to be filled, not read. That is why a template reaches `ready` as soon as its bytes land, with no `processing` stage. Pass one to [fill](https://docs.cloudraker.com/api/cloud-raker-api/capabilities/fill) as `template: { "id": "…" }`.
</Note>

**Learn more:** [Form filling guide](https://docs.cloudraker.com/capabilities/fill)

Reference: https://docs.cloudraker.com/api/cloud-raker-api/templates/create-template

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: CloudRaker API
  version: 1.0.0
paths:
  /v1/templates:
    post:
      operationId: create-template
      summary: Add a template by URL, or get a presigned upload URL
      description: >-
        Adds a blank form to your organization's template library.


        The two request shapes match [POST
        /v1/files](https://docs.cloudraker.com/api/cloud-raker-api/files/create-file):


        - `{ url, name? }` — fetched over http(s) for you.

        - `{ name, mimeType }` — returns `uploadUrl` plus `uploadExpiresAt` (15
        minutes); `PUT` the bytes with a `Content-Type` equal to the `mimeType`
        you sent.


        ```json

        { "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf", "name": "w9.pdf" }

        ```


        <Note>

        Templates are deliberately never parsed or indexed — they are documents
        to be filled, not read. That is why a template reaches `ready` as soon
        as its bytes land, with no `processing` stage. Pass one to
        [fill](https://docs.cloudraker.com/api/cloud-raker-api/capabilities/fill)
        as `template: { "id": "…" }`.

        </Note>


        **Learn more:** [Form filling
        guide](https://docs.cloudraker.com/capabilities/fill)
      tags:
        - templates
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '201':
          description: The template.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Template'
        '422':
          description: The URL could not be fetched (`file_fetch_failed`).
          content:
            application/json:
              schema:
                description: Any type
        '429':
          description: >-
            Rate limited. The `/v1` API allows at least **67 requests per minute
            per organization** (about 1,000 requests per 15 minutes) — a
            guaranteed floor, enforced per edge location, so a geographically
            spread caller may get more. Wait for the `Retry-After` interval and
            retry — the error is `retryable`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTemplateRequestTooManyRequestsError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1CreateTemplateBody'
servers:
  - url: https://api.cloudraker.com
    description: Production
  - url: https://api.staging.raker.one
    description: Staging
  - url: https://api.dev.raker.one
    description: Development
components:
  schemas:
    V1CreateTemplateBody0:
      type: object
      properties:
        url:
          type: string
          format: uri
        name:
          type: string
      required:
        - url
      title: V1CreateTemplateBody0
    V1CreateTemplateBody1:
      type: object
      properties:
        name:
          type: string
        mimeType:
          type: string
      required:
        - name
        - mimeType
      title: V1CreateTemplateBody1
    V1CreateTemplateBody:
      oneOf:
        - $ref: '#/components/schemas/V1CreateTemplateBody0'
        - $ref: '#/components/schemas/V1CreateTemplateBody1'
      title: V1CreateTemplateBody
    V1TemplateStatus:
      type: string
      enum:
        - uploading
        - processing
        - ready
        - failed
      title: V1TemplateStatus
    V1Template:
      type: object
      properties:
        object:
          type: string
          enum:
            - template
        id:
          type: string
        name:
          type: string
        mimeType:
          type: string
        kind:
          type: string
        status:
          $ref: '#/components/schemas/V1TemplateStatus'
        createdAt:
          type: string
        downloadUrl:
          type: string
        uploadUrl:
          type: string
        uploadExpiresAt:
          type: string
      required:
        - object
        - id
        - name
        - mimeType
        - status
        - createdAt
      title: V1Template
    V1TemplatesPostResponsesContentApplicationJsonSchemaCode:
      type: string
      enum:
        - rate_limited
      title: V1TemplatesPostResponsesContentApplicationJsonSchemaCode
    CreateTemplateRequestTooManyRequestsError:
      type: object
      properties:
        code:
          $ref: >-
            #/components/schemas/V1TemplatesPostResponsesContentApplicationJsonSchemaCode
        message:
          type: string
        retryable:
          type: boolean
        requestId:
          type: string
        docUrl:
          type: string
      required:
        - code
        - message
        - retryable
        - requestId
      title: CreateTemplateRequestTooManyRequestsError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{
  "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
}
```

**Response**

```json
{
  "object": "template",
  "id": "a3f1c9e2-7b4d-4f8a-9c2e-1d2b3f4a5e6f",
  "name": "fw9.pdf",
  "mimeType": "application/pdf",
  "status": "ready",
  "createdAt": "2024-06-01T12:00:00Z",
  "kind": "form",
  "downloadUrl": "https://cdn.cloudraker.com/templates/a3f1c9e2-7b4d-4f8a-9c2e-1d2b3f4a5e6f/download",
  "uploadUrl": "",
  "uploadExpiresAt": ""
}
```

**SDK Code**

```python
import requests

url = "https://api.cloudraker.com/v1/templates"

payload = { "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.cloudraker.com/v1/templates';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"url":"https://www.irs.gov/pub/irs-pdf/fw9.pdf"}'
};

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

```go
package main

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

func main() {

	url := "https://api.cloudraker.com/v1/templates"

	payload := strings.NewReader("{\n  \"url\": \"https://www.irs.gov/pub/irs-pdf/fw9.pdf\"\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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
require 'uri'
require 'net/http'

url = URI("https://api.cloudraker.com/v1/templates")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"url\": \"https://www.irs.gov/pub/irs-pdf/fw9.pdf\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.cloudraker.com/v1/templates")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"url\": \"https://www.irs.gov/pub/irs-pdf/fw9.pdf\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.cloudraker.com/v1/templates', [
  'body' => '{
  "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.cloudraker.com/v1/templates");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"url\": \"https://www.irs.gov/pub/irs-pdf/fw9.pdf\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cloudraker.com/v1/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()
```