---
title: "Add a template by URL, or get a presigned upload URL"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

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

Path: CloudRaker Paperwork API › Templates

`POST /v1/templates`

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

The two request shapes match [POST /v1/files](https://docs.cloudraker.com/paperwork/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/paperwork/api/capabilities/fill) as `template: { "id": "…" }`.

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

## Authentication

- `bearerAuth`, http, header `Authorization`

## Request body

_Required._

Any of:

- `object`
  - `url` (`createTemplate.1.url`; string, required)
    - format `uri`; example `"https://example.com/w9.pdf"`
  - `name` (`createTemplate.1.name`; string, optional)
    - minLength 1
- `object`
  - `name` (`createTemplate.2.name`; string, required)
    - minLength 1; example `"w9.pdf"`
  - `mimeType` (`createTemplate.2.mimeType`; string, required)
    - minLength 1; example `"application/pdf"`

## Example request

```json
{
  "url": "https://example.com/w9.pdf",
  "name": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.cloudraker.com/v1/templates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://example.com/w9.pdf",
  "name": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/v1/templates';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({url: 'https://example.com/w9.pdf', name: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

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

payload = {
    "url": "https://example.com/w9.pdf",
    "name": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 201

The template.

#### Example

```json
{
  "object": "template",
  "id": "string",
  "name": "string",
  "mimeType": "string",
  "kind": "string",
  "status": "uploading",
  "createdAt": "string",
  "downloadUrl": "string",
  "uploadUrl": "string",
  "uploadExpiresAt": "string"
}
```

- `object` (`createTemplate.response.201.object`; string, required)
- `id` (`createTemplate.response.201.id`; string, required)
- `name` (`createTemplate.response.201.name`; string, required)
- `mimeType` (`createTemplate.response.201.mimeType`; string, required)
- `status` (`createTemplate.response.201.status`; string, required)
  - one of `"uploading"`, `"processing"`, `"ready"`, `"failed"`
- `createdAt` (`createTemplate.response.201.createdAt`; string, required)
- `kind` (`createTemplate.response.201.kind`; string, optional)
- `downloadUrl` (`createTemplate.response.201.downloadUrl`; string, optional)
- `uploadUrl` (`createTemplate.response.201.uploadUrl`; string, optional)
- `uploadExpiresAt` (`createTemplate.response.201.uploadExpiresAt`; string, optional)

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`createTemplate.response.400.success`; boolean, required)
  - one of `false`
- `error` (`createTemplate.response.400.error`; array<unknown>, required)
- `data` (`createTemplate.response.400.data`; unknown, required)

### 422

The URL could not be fetched (`file_fetch_failed`).

### 429

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`.

#### Example

```json
{
  "code": "rate_limited",
  "message": "string",
  "retryable": true,
  "requestId": "string",
  "docUrl": "string"
}
```

- `code` (`createTemplate.response.429.code`; string, required)
  - one of `"rate_limited"`
- `message` (`createTemplate.response.429.message`; string, required)
- `retryable` (`createTemplate.response.429.retryable`; boolean, required)
  - one of `true`
- `requestId` (`createTemplate.response.429.requestId`; string, required)
- `docUrl` (`createTemplate.response.429.docUrl`; string, optional)


Source: https://docs.cloudraker.com/paperwork/api/templates/create-template/index.md
