---
title: "A presigned PUT for one file. The type and size are checked here so the composer can say no before uploading; they are checked again against the stored bytes at send time, since a presigned PUT can't enforce either."
method: POST
path: "/message-attachments/upload-url"
tags: ["MessageAttachments"]
---

# A presigned PUT for one file. The type and size are checked here so the composer can say no before uploading; they are checked again against the stored bytes at send time, since a presigned PUT can't enforce either.

`POST /message-attachments/upload-url`

## Request

- Base URL: `https://api.clinicos.vet/backend/business`
- URL: `https://api.clinicos.vet/backend/business/message-attachments/upload-url`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/clinicos/apis/pawthosx-business-api-v1/docs/message-attachments/upload-url/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- CreateAttachmentUploadRequest: Request an upload URL for one staff attachment.
  - `fileName` string, required
  - `contentType` string, required
  - `sizeBytes` union, required
    - integer
    - string, int64
  - `clientId` string, nullable: The client being messaged. The upload is bound to them and refused on another client's conversation. Omitted for a message to a new contact.

## Response `200`

OK

- AttachmentUploadTicketDto: A staged attachment the browser still has to upload: PUT the bytes to string AttachmentUploadTicketDto.UploadUrl with exactly string StagedAttachmentDto.ContentType as the Content-Type header.
  - `uploadUrl` string, required
  - `expiresAt` string, date-time, required
  - `attachmentId` string, required
  - `fileName` string, required
  - `contentType` string, required
  - `sizeBytes` union, required
    - integer
    - string, int64

## Other responses

- `400`: Bad Request

## Changes

- **2026-10-28** `099cf36186e0`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/clinicos/apis/pawthosx-business-api-v1/changes/message-attachments/upload-url/post.md)

---

[API](https://skmtc.dev/clinicos/apis/pawthosx-business-api-v1.md) - [All operations](https://skmtc.dev/clinicos/apis/pawthosx-business-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/clinicos/apis/pawthosx-business-api-v1/revisions/099cf36186e0?raw)
