---
title: "Create an upload for a reply"
url: https://docs.corefinity.com/api/reference/support/create-support-ticket-upload
type: endpoint
last_updated: 2026-11-13
feature: support
related:
  - https://docs.corefinity.com/guides/support/raise-and-follow-a-ticket.md
---
# Create an upload for a reply

Opens an upload for one file a reply will carry, for a caller that cannot send a multipart form. Send the file
with a `PUT` to the `url` this answers, which carries no token, then name the `upload_id` in the reply's
`upload_ids`; a file nobody attaches is deleted a day after its upload was opened.

```http
POST /api/support/ticket-uploads
```

- Scope: `write`
- Rate limit: 60 a minute
- Try it in the console: off. It has not been cleared for the console. Copy the request and run it yourself when you are sure.

## Body

- `filename` (string, required): The file's name, of a type the ticket page takes.
- `size_bytes` (integer, required): The size of the file, exactly. At most the `max_bytes` an upload answers, which is never more than 512 MB.

## Request

### curl

```bash
curl -X POST https://manage.corefinity.com/api/support/ticket-uploads \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "checkout-error.png",
    "size_bytes": 184320
  }'
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->post('https://manage.corefinity.com/api/support/ticket-uploads', [
        'filename' => 'checkout-error.png',
        'size_bytes' => 184320,
    ]);

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/support/ticket-uploads', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    filename: 'checkout-error.png',
    size_bytes: 184320,
  }),
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.post(
    "https://manage.corefinity.com/api/support/ticket-uploads",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "filename": "checkout-error.png",
        "size_bytes": 184320,
    },
)

data = res.json() if res.content else None
```

## Responses

### 201 The upload is open.

```json
{
  "expires_at": "2026-11-04T16:40:11Z",
  "lines": {
    "note": "Send the whole file in one request, exactly size_bytes long, before url_expires_at. Then pass upload_id in upload_ids when you reply to the ticket.",
    "one_request": "curl --fail -X PUT --upload-file 'checkout-error.png' 'https://manage.corefinity.com/api/support/ticket-uploads/0d9c1a4e-6f1b-4f5e-9b8a-2d7c3e4f5a6b?expires=1792604411&signature=0000000000000000000000000000000000000000000000000000000000000000'"
  },
  "max_bytes": 104857600,
  "method": "PUT",
  "upload_id": "0d9c1a4e-6f1b-4f5e-9b8a-2d7c3e4f5a6b",
  "url": "https://manage.corefinity.com/api/support/ticket-uploads/0d9c1a4e-6f1b-4f5e-9b8a-2d7c3e4f5a6b?expires=1792604411&signature=0000000000000000000000000000000000000000000000000000000000000000",
  "url_expires_at": "2026-11-03T17:40:11Z"
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the `write` scope (`scope_required`).

```json
{
  "code": "scope_required",
  "message": "This access token does not have the destructive scope this needs. Use a token with the destructive scope.",
  "reason": "scope_required",
  "scope": "destructive"
}
```

### 422 `filename` or `size_bytes` is missing or wrong, or the file is of a type the ticket page refuses. `field` names it.

```json
{
  "code": "invalid",
  "errors": {
    "filename": [
      "Letters, digits, spaces, dots, dashes and underscores, starting with a letter or a digit."
    ]
  },
  "field": "filename",
  "message": "Letters, digits, spaces, dots, dashes and underscores, starting with a letter or a digit.",
  "reason": "invalid"
}
```

### 429 Too many requests (`rate_limited`). Wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | Send a valid token as `Authorization: Bearer <token>`. |
| 403 | `scope_required` | Use a token with the scope named in `scope`. |
| 422 | `invalid` | Fix the field named in `field`; `errors` says why. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Support tickets](https://docs.corefinity.com/guides/support/raise-and-follow-a-ticket.md)
