Creates a new attachment associated with a project.
Only the following MIME types are allowed: image/jpeg, image/png, image/jpg, application/pdf.
Endpoint: /attachment
Method: POST
{
"project_id": "integer", // Required: ID of the project this attachment belongs to
"name": "string", // Optional
"type": "string", // Required: MIME type (e.g., application/pdf, image/jpeg)
"status": "pending", // Optional
"url": "string" // Required: URL where the attachment is stored
}
Status 201 (Created):
{
"id": 1,
"project_id": 101,
"type": "application/pdf",
"url": "<https://files.example.com/project123/brochure.pdf>",
"created_at": "2024-04-03T10:00:00Z"
}
Status 400 (Bad Request):
{
"message": "Invalid input",
"error": {
"message": "Missing required field 'type'",
"code": "VALIDATION_ERROR",
"details": {}
}
}
Status 403 (Forbidden):
{
"message": "Insufficient credits",
"error": {
"message": "Your plan does not allow adding more attachments",
"code": "LIMIT_EXCEEDED",
"details": {}
}
}
Status 404 (Not Found):
{
"message": "Project not found",
"error": {
"message": "No project with the given ID",
"code": "NOT_FOUND",
"details": {}
}
}
Retrieves a list of all attachments accessible to the service account.
Endpoint: /attachment
Method: GET
Status 200 (Success):
[
{
"id": 1,
"project_id": 101,
"type": "application/pdf",
"url": "<https://files.example.com/project123/brochure.pdf>",
"created_at": "2024-04-03T10:00:00Z"
},
{
"id": 2,
"project_id": 102,
"type": "image/jpeg",
"url": "<https://files.example.com/project456/rendering.jpg>",
"created_at": "2024-04-03T10:05:00Z"
}
]