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

# Upload participant document

POST https://api.caresquareapi.com/api/public/v1/participants/{participant_id}/documents
Content-Type: multipart/form-data

Upload one file as a participant document. Send multipart/form-data with the file in the `file` field (max 20 MB). Allowed extensions: csv, doc, docx, eml, gif, jpeg, jpg, msg, pdf, png, txt, webp, xls, xlsx.

Reference: https://docs.caresquareapi.com/api-reference/documents/participant-documents/upload-participant-document

## Authentication

- `Authorization` header (bearer token, required) — API key issued for your account. Send as Bearer token in the Authorization header.
- `X-Plan-Manager-Id` header (required) — Plan manager UUID. Required on all public API requests to scope data access.

## Request

### Path parameters

- `participant_id` (string, required) — Participant UUID

### Body (multipart/form-data)

This endpoint expects a multipart form containing a file.

- `file` (file, required) — File to upload
- `document_name` (string, optional) — Display name (defaults to the file name)
- `document_type` (string, optional) — Document type (defaults to Other)
- `portal_access` (boolean, optional) — Show the document in the participant portal
- `plan_id` (integer, optional) — NDIS plan id to link; must belong to this participant
- `external_id` (string, optional) — External system id

## Response

### 201

Document uploaded

- `id` (string, required) — Document id (bigint as string)
- `created_at` (datetime, optional)
- `participant` (string, optional)
- `document_name` (string, optional)
- `document_type` (string, optional)
- `portal_access` (boolean, optional) — Whether the participant can see it in the portal
- `plan_id` (integer, optional, nullable) — Linked NDIS plan id
- `external_id` (string, optional, nullable)
- `file_system_type` (enum, optional) — Where the file is stored. Only `legacy` documents can be downloaded through the API.
  - Allowed values: `legacy`, `platform`
- `portal_document_status` (enum, optional, nullable) — Set for documents the participant uploaded through the portal (read-only)
  - Allowed values: `pending`, `approved`, `rejected`
- `uploaded_by` (string, optional, nullable) — Portal uploader (read-only)
- `rejection_reason` (string, optional, nullable) — Why a portal upload was rejected (read-only)

## Errors

### 400 Bad Request Error

Invalid request parameters

- `success` (boolean, optional)
- `error` (string, optional) — Error type or code
- `detail` (string, optional) — Human-readable error message

### 403 Forbidden Error

Access denied for plan manager

- `success` (boolean, optional)
- `error` (string, optional) — Error type or code
- `detail` (string, optional) — Human-readable error message

### 404 Not Found Error

Resource not found

- `success` (boolean, optional)
- `error` (string, optional) — Error type or code
- `detail` (string, optional) — Human-readable error message

### 413 Content Too Large Error

File larger than 20 MB

- `success` (boolean, optional)
- `error` (string, optional) — Error type or code
- `detail` (string, optional) — Human-readable error message

### 500 Internal Server Error

Internal server error

- `success` (boolean, optional)
- `error` (string, optional) — Error type or code
- `detail` (string, optional) — Human-readable error message

## Examples

**Request**

```json
{
  "file": "<file: [object Object]>",
  "document_name": {
    "type": "json"
  },
  "document_type": {
    "type": "json"
  },
  "portal_access": {
    "type": "json"
  },
  "plan_id": {
    "type": "json"
  },
  "external_id": {
    "type": "json"
  }
}
```

**Response**

```json
{
  "id": "string",
  "created_at": "2024-01-15T09:30:00Z",
  "participant": "string",
  "document_name": "string",
  "document_type": "string",
  "portal_access": true,
  "plan_id": 1,
  "external_id": "string",
  "file_system_type": "legacy",
  "portal_document_status": "pending",
  "uploaded_by": "string",
  "rejection_reason": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.caresquareapi.com/api/public/v1/participants/participant_id/documents"

files = { "file": "open('[object Object]', 'rb')" }
payload = {
    "document_name": "{
  \"type\": \"json\"
}",
    "document_type": "{
  \"type\": \"json\"
}",
    "portal_access": "{
  \"type\": \"json\"
}",
    "plan_id": "{
  \"type\": \"json\"
}",
    "external_id": "{
  \"type\": \"json\"
}"
}
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.caresquareapi.com/api/public/v1/participants/participant_id/documents';
const form = new FormData();
form.append('file', '[object Object]');
form.append('document_name', '{
  "type": "json"
}');
form.append('document_type', '{
  "type": "json"
}');
form.append('portal_access', '{
  "type": "json"
}');
form.append('plan_id', '{
  "type": "json"
}');
form.append('external_id', '{
  "type": "json"
}');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

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.caresquareapi.com/api/public/v1/participants/participant_id/documents"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"[object Object]\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_name\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"portal_access\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"plan_id\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001--\r\n")

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

	req.Header.Add("Authorization", "Bearer <token>")

	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.caresquareapi.com/api/public/v1/participants/participant_id/documents")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"[object Object]\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_name\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"portal_access\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"plan_id\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001--\r\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.caresquareapi.com/api/public/v1/participants/participant_id/documents")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"[object Object]\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_name\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"portal_access\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"plan_id\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001--\r\n")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.caresquareapi.com/api/public/v1/participants/participant_id/documents', [
  'multipart' => [
    [
        'name' => 'file',
        'filename' => '[object Object]',
        'contents' => null
    ],
    [
        'name' => 'document_name',
        'contents' => '{
  "type": "json"
}'
    ],
    [
        'name' => 'document_type',
        'contents' => '{
  "type": "json"
}'
    ],
    [
        'name' => 'portal_access',
        'contents' => '{
  "type": "json"
}'
    ],
    [
        'name' => 'plan_id',
        'contents' => '{
  "type": "json"
}'
    ],
    [
        'name' => 'external_id',
        'contents' => '{
  "type": "json"
}'
    ]
  ]
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.caresquareapi.com/api/public/v1/participants/participant_id/documents");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"[object Object]\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_name\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"portal_access\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"plan_id\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]
let parameters = [
  [
    "name": "file",
    "fileName": "[object Object]"
  ],
  [
    "name": "document_name",
    "value": "{
  \"type\": \"json\"
}"
  ],
  [
    "name": "document_type",
    "value": "{
  \"type\": \"json\"
}"
  ],
  [
    "name": "portal_access",
    "value": "{
  \"type\": \"json\"
}"
  ],
  [
    "name": "plan_id",
    "value": "{
  \"type\": \"json\"
}"
  ],
  [
    "name": "external_id",
    "value": "{
  \"type\": \"json\"
}"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.caresquareapi.com/api/public/v1/participants/participant_id/documents")! 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()
```