---
title: "Register an org-level template file and 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.

# Register an org-level template file and get a presigned upload URL

Path: CloudRaker Workspace API › Organization Templates

`POST /organization/templates`

Reserves a template file metadata record parented to the caller’s organization (not any space) and returns { id, uploadUrl, uploadExpiresAt, file }. `uploadUrl` is a secure PUT URL valid for 15 minutes (see `uploadExpiresAt`, ISO 8601). Two-step upload: PUT the raw bytes to `uploadUrl` with a `Content-Type` request header EXACTLY equal to the `mimeType` you sent, then poll `getOrgTemplate` until `status` reaches `stored`. Request body: `fileName` (required), `mimeType` (required), `size` (bytes, optional). `parentType`/`parentId` in the body are ignored: the API forces the parent to this organization. No processing is requested (templates are filled, not parsed). Authorization: org admin (denied → 403).

## Authentication

- `bearerAuth`, http, header `Authorization`

## Request body

_Required._

- `fileName` (`createOrgTemplate.fileName`; string, required)
  - minLength 1; example `"w9.pdf"`
- `mimeType` (`createOrgTemplate.mimeType`; string, required)
  - minLength 1; example `"application/pdf"`
- `size` (`createOrgTemplate.size`; integer, optional)
  - min 0; max 9007199254740991

## Example request

```json
{
  "fileName": "w9.pdf",
  "mimeType": "application/pdf",
  "size": 9007199254740991
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.cloudraker.com/organization/templates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fileName": "w9.pdf",
  "mimeType": "application/pdf",
  "size": 9007199254740991
}
'
```

### TypeScript

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

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/organization/templates"

payload = {
    "fileName": "w9.pdf",
    "mimeType": "application/pdf",
    "size": 9007199254740991
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 201

Template record created, with its presigned upload URL.

#### Example

```json
{
  "id": "string",
  "uploadUrl": "string",
  "uploadExpiresAt": "2019-08-24T14:15:22Z",
  "file": {
    "id": "a1b2c3d4",
    "fileName": "invoice.pdf",
    "parentType": "space",
    "parentId": "string",
    "mimeType": "application/pdf",
    "size": 0,
    "status": "waiting",
    "processingKind": "doc-simple",
    "processingError": "string",
    "processingProgress": {
      "state": "queued",
      "pagesTotal": -9007199254740991,
      "pagesDone": -9007199254740991
    },
    "parentFileId": "string",
    "artifacts": [
      "string"
    ],
    "indexVectors": true,
    "indexOntology": true,
    "createdAt": "2019-08-24T14:15:22Z",
    "storedAt": "2019-08-24T14:15:22Z",
    "processedAt": "2019-08-24T14:15:22Z",
    "urls": {
      "file": "string",
      "processedJson": "string",
      "processedMd": "string",
      "previewPdf": "string"
    }
  }
}
```

- `id` (`createOrgTemplate.response.201.id`; string, required)
- `uploadUrl` (`createOrgTemplate.response.201.uploadUrl`; string, required) — Presigned upload URL, valid 15 minutes. PUT the raw bytes there with a `Content-Type` header EXACTLY equal to the `mimeType` sent at create.
- `uploadExpiresAt` (`createOrgTemplate.response.201.uploadExpiresAt`; string, required)
  - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
- `file` (`createOrgTemplate.response.201.file`; object, required)
  - `id` (`createOrgTemplate.response.201.file.id`; string, required)
    - example `"a1b2c3d4"`
  - `fileName` (`createOrgTemplate.response.201.file.fileName`; string, required)
    - example `"invoice.pdf"`
  - `parentType` (`createOrgTemplate.response.201.file.parentType`; string, required)
    - example `"space"`
  - `parentId` (`createOrgTemplate.response.201.file.parentId`; string, required)
  - `mimeType` (`createOrgTemplate.response.201.file.mimeType`; string, required)
    - example `"application/pdf"`
  - `size` (`createOrgTemplate.response.201.file.size`; number | null, required) — Size in bytes, null until stored.
  - `status` (`createOrgTemplate.response.201.file.status`; string, required) — Terminal values are `stored` (uploaded, no processing requested), `processed` and `failed`; `waiting` and `processing` mean keep polling.
    - one of `"waiting"`, `"stored"`, `"processing"`, `"processed"`, `"failed"`
  - `processingKind` (`createOrgTemplate.response.201.file.processingKind`; any of, required)
    - any of:
      - `string`: one of `"doc-simple"`, `"doc-ocr"`, `"doc-auto"`, `"audio-transcribe"`, `"audio-transcribe-and-diarize"`
      - `null`
  - `createdAt` (`createOrgTemplate.response.201.file.createdAt`; string, required)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
  - `processingError` (`createOrgTemplate.response.201.file.processingError`; string, optional)
  - `processingProgress` (`createOrgTemplate.response.201.file.processingProgress`; object, optional) — Present while `status` is `processing`. `queued` means that the organization is at its concurrent parse limit and no page of this file is in parse.
    - `state` (`createOrgTemplate.response.201.file.processingProgress.state`; string, required)
      - one of `"queued"`, `"processing"`
    - `pagesTotal` (`createOrgTemplate.response.201.file.processingProgress.pagesTotal`; integer, required)
      - min -9007199254740991; max 9007199254740991
    - `pagesDone` (`createOrgTemplate.response.201.file.processingProgress.pagesDone`; integer, required)
      - min -9007199254740991; max 9007199254740991
  - `parentFileId` (`createOrgTemplate.response.201.file.parentFileId`; string, optional) — Source file this one was generated from (e.g. a redacted or signed copy).
  - `artifacts` (`createOrgTemplate.response.201.file.artifacts`; array<string>, optional) — Parsing byproducts present, e.g. `structured`, `transcript`.
  - `indexVectors` (`createOrgTemplate.response.201.file.indexVectors`; boolean, optional)
  - `indexOntology` (`createOrgTemplate.response.201.file.indexOntology`; boolean, optional)
  - `storedAt` (`createOrgTemplate.response.201.file.storedAt`; string, optional)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
  - `processedAt` (`createOrgTemplate.response.201.file.processedAt`; string, optional)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
  - `urls` (`createOrgTemplate.response.201.file.urls`; object, optional) — Minted download links, each valid ~1 hour. Present on single-file reads only — list responses mint none.
    - `file` (`createOrgTemplate.response.201.file.urls.file`; string, optional) — The stored original.
    - `processedJson` (`createOrgTemplate.response.201.file.urls.processedJson`; string, optional) — Structured/grounded JSON.
    - `processedMd` (`createOrgTemplate.response.201.file.urls.processedMd`; string, optional) — Extracted markdown.
    - `previewPdf` (`createOrgTemplate.response.201.file.urls.previewPdf`; string, optional)


Source: https://docs.cloudraker.com/workspace/api/organization-templates/create-org-template/index.md
