Create workspace asset upload
Generate a presigned URL for a workspace asset upload. To attach a file to a workspace page, set entity_type to PAGE_DESCRIPTION and pass the page UUID as entity_identifier. The page must be editable, unlocked, and active.
Path Parameters
workspace_slug:requiredstringThe workspace_slug represents the unique workspace identifier for a workspace in Plane. It can be found in the URL. For example, in the URL https://app.plane.so/my-team/projects/, the workspace slug is my-team.
Body Parameters
name:requiredstringOriginal filename of the asset
type:optionalstringMIME type of the file
size:requiredintegerFile size in bytes
project_id:optionalstringUUID of the project to associate with the asset
entity_type:optionalstringAsset context. Use PAGE_DESCRIPTION for a workspace page attachment; when you do, entity_identifier is also required.
entity_identifier:optionalstringUUID of the workspace page. This value and entity_type are required together for a PAGE_DESCRIPTION attachment.
external_id:optionalstringExternal identifier for the asset (for integration tracking)
external_source:optionalstringExternal source system (for integration tracking)
Scopes
assets:write
curl -X POST \
"https://api.plane.so/api/v1/workspaces/my-workspace/assets/" \
-H "X-API-Key: $PLANE_API_KEY" \
# Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Example Name",
"type": "image/jpeg",
"size": 1024000,
"entity_type": "PAGE_DESCRIPTION",
"entity_identifier": "4d2f6f7e-9b4a-4d6a-8f4a-1c3f7c0f4a10",
"external_id": "550e8400-e29b-41d4-a716-446655440000",
"external_source": "github"
}'import requests
response = requests.post(
"https://api.plane.so/api/v1/workspaces/my-workspace/assets/",
headers={"X-API-Key": "your-api-key"},
json={
"name": "Example Name",
"type": "image/jpeg",
"size": 1024000,
"entity_type": "PAGE_DESCRIPTION",
"entity_identifier": "4d2f6f7e-9b4a-4d6a-8f4a-1c3f7c0f4a10",
"external_id": "550e8400-e29b-41d4-a716-446655440000",
"external_source": "github"
}
)
print(response.json())// Run this example server-side. Browser apps must call your backend to keep the API key secret.
const response = await fetch("https://api.plane.so/api/v1/workspaces/my-workspace/assets/", {
method: "POST",
headers: {
"X-API-Key": process.env.PLANE_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Example Name",
type: "image/jpeg",
size: 1024000,
entity_type: "PAGE_DESCRIPTION",
entity_identifier: "4d2f6f7e-9b4a-4d6a-8f4a-1c3f7c0f4a10",
external_id: "550e8400-e29b-41d4-a716-446655440000",
external_source: "github",
}),
});
const data = await response.json();{
"asset_id": "550e8400-e29b-41d4-a716-446655440000",
"asset_url": "/api/v1/workspaces/my-workspace/pages/4d2f6f7e-9b4a-4d6a-8f4a-1c3f7c0f4a10/attachments/550e8400-e29b-41d4-a716-446655440000/",
"upload_data": {
"url": "https://uploads.example.com/plane-bucket",
"fields": {
"Content-Type": "image/png",
"key": "workspace-assets/550e8400-e29b-41d4-a716-446655440000/workspace-image.png",
"x-amz-algorithm": "AWS4-HMAC-SHA256",
"x-amz-credential": "example/20240101/us-east-1/s3/aws4_request",
"x-amz-date": "20240101T000000Z",
"policy": "example-policy",
"x-amz-signature": "example-signature"
}
}
}
