Skip to content

Get a presigned URL to upload a task attachment

POST
/uploads/url
Code sample: Shell / cURL
curl --request POST \
--url https://example.com/api/v1/uploads/url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "contentType": "example", "fileName": "example", "purpose": "task", "size": 1 }'

For a client that can run an HTTP PUT itself: the file never passes through this API. Takes fileName, contentType (the type derived from the file name) and the exact size (at most 25 MB), and refuses what POST /uploads/file refuses (empty, over 25 MB, executables by extension) before signing anything. Returns a short-lived uploadUrl that signs the content type and the length: PUT the bytes to it with the headers given. The object waits under the caller’s own pending prefix; pass the returned url as fileUrl to POST /tasks/{id}/attachments, which reads the stored object back, refuses (and deletes) one whose size is not the declared size, an executable, or an image or PDF whose bytes are not its type, and only the member who asked for the URL can attach it. A pending upload nobody attaches is deleted after 24 hours. MCP: create-upload-url.

Media typeapplication/json
object
contentType
required

MIME type the file will be sent with. It must equal the type the server derives from the file name (the response’s mimeType); a different value is refused with the expected one

string
>= 1 characters <= 255 characters
fileName
required

Original file name including its extension

string
>= 1 characters <= 500 characters
purpose

“task” (default): a task attachment. A deal’s file goes through upload-file with purpose “deal”

string
Allowed values: task
size
required

Exact size of the file in bytes; at most 25 MB. The upload must be this long

integer
> 0 <= 26214400

Upload URL issued.

Media typeapplication/json
object
data
required

A presigned upload URL and the reference that attaches the uploaded file to a task.

object
expiresAt
required

ISO 8601 instant after which uploadUrl stops working.

string
fileName
required

File name as given.

string
fileSize
required

Declared size in bytes.

integer
>= -9007199254740991 <= 9007199254740991
fileUrl
required

Alias of url accepted directly by POST /tasks/{id}/attachments.

string
headers
required

The header the upload must carry, byte for byte; the URL signs it and the length.

object
Content-Type
required
string
method
required
string
Allowed value: PUT
mimeType
required

Server-derived MIME type, the value of headers.Content-Type.

string
uploadUrl
required

Short-lived presigned URL. Send the file to it with an HTTP PUT, for example curl -T <file> -H "Content-Type: <headers.Content-Type>" "<uploadUrl>".

string
url
required

Reference to pass as fileUrl to POST /tasks/{id}/attachments once the upload is done. Only the member who asked for it can use it, and only until the pending upload is swept (24 hours).

string

Example

{
"data": {
"method": "PUT"
}
}

Validation error. Parse failures include field paths and expectations.

Media typeapplication/json

Validation error with safe field paths and expected values; submitted values are never returned.

object
error
required
object
code
required

Stable machine-readable error code.

string
issues
Array<object>
object
expected
required
string
message
required
string
path
required
Array<string | number>
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.