Upload attachment
POST
/v1/api/workspaces/{workspaceId}/attachmentsUploads a file to a workspace so you can attach it to a message. Send the raw file as the body with its media type in Content-Type. Files can be up to 20 MiB.
Authorization
apiKey AuthorizationBearer <token>
An API key that starts with zk_. Create one in the Zuse app.
In: header
Path Parameters
workspaceId*string
Workspace ID.
Header Parameters
X-Zuse-File-Name?string
Original file name, up to 255 characters. Defaults to attachment.
Idempotency-Key?string
Retrying with the same key returns the original result instead of repeating the action. Up to 200 characters.
Length
length <= 200The file's bytes.
TypeScript Definitions
Use the request body type in TypeScript.
body*file
Format
binaryResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/api/workspaces/workspace_Q2x8mN4pR7sT1vWz/attachments" \ -H "Content-Type: application/json" \ -d 'string'{ "asset": { "assetId": "asset_4kQ9mZr2Lp8vTx1nWc6bYs0d", "mimeType": "image/png", "originalName": "error.png", "sizeBytes": 48213 }}{ "error": "invalid_api_key", "detail": "string"}{ "error": "invalid_api_key", "detail": "string"}{ "error": "invalid_api_key", "detail": "string"}{ "error": "invalid_api_key", "detail": "string"}{ "error": "invalid_api_key", "detail": "string"}{ "error": "invalid_api_key", "detail": "string"}