Skip to Content
Notification APIDocs
Attachments

Upload an attachment

POST
/api/v1/companies/{companyId}/projects/{projectId}/attachments

Uploads one file (multipart/form-data, field 'file') to the storage registration in 'projectStorageProviderId', or to the project's default storage.

Required permission: attachments.write. See the guide for details.

Error codes:

  • 400 validation.failed (file name or content type), or a missing file field
  • 413 file larger than the upload limit
  • 422 attachment.empty, attachment.too_large, attachment.type_not_allowed, attachment.rejected, storage.no_default, storage.inactive, storage.credentials_missing, storage.request_failed

Every endpoint can also answer 401 (missing or invalid key), 403 (route outside the key's project or permission) and 429 rate_limit.exceeded.

Authorization

ApiKey
headerX-Api-Key<token>

Project API key: nb_<prefix>_<secret>.

Path Parameters

companyId*string

Id of the company that owns the project (shown with the API key in the dashboard).

Formatuuid
projectId*string

Id of the project the API key belongs to.

Formatuuid

Request Body

multipart/form-data
  1. body
file?IFormFile
Formatbinary
projectStorageProviderId?string
Formatuuid

Response Body

Created

application/json
  1. response
id*string
Formatuuid
projectId*string
Formatuuid
projectStorageProviderId*string

Storage the file was written to (the project default at upload time).

Formatuuid
fileName*string
contentType*string
sizeBytes*integer
Formatint64
sha256*string

Lowercase hex SHA-256 of the file content.

createdAt*string
Formatdate-time
Example Request
curl -X POST 'https://api.gbnotification.dokploy.geobilgi.net/api/v1/companies/497f6eca-6276-4993-bfeb-53cbbbba6f08/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/attachments'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8",  "projectStorageProviderId": "f526b023-22f0-42b4-99b8-c66d0ac32634",  "fileName": "string",  "contentType": "string",  "sizeBytes": 0,  "sha256": "string",  "createdAt": "2019-08-24T14:15:22Z"}