Skip to content
Connect an agent

Organisations

Add a bucket

Adds a keyless bucket that trusts Plotwork’s issuer for this organisation.

POST/orgs/{org}/storage

TL;DR

QuestionAnswer
What does it do?Add a bucket.
What does it take?A JSON body of type CreateStorageBody.
What does it return?Status 201 with a body of type StorageDestination.
What can go wrong?400 a field is not in the form the bucket needs (storage.invalid); 401 not signed in; 403 not the owner or an admin (orgs.forbidden), the plan does not include it (plan.storage_not_included), or the origin may not make changes; 404 no such organisation or destination, or the caller is not a member; 409 that kind is already set up (storage.exists); 429 too many requests; 503 sending to your storage is not available on this server (storage.unavailable). Every failure uses the one error envelope.

What it does

Adds a keyless bucket that trusts Plotwork’s issuer for this organisation. It sends nothing until it is turned on. One of each kind.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.

Request body

The body has the type CreateStorageBody.

FieldTypeRequiredDescription
type"s3" | "azure_blob" | "gcs"yesA bucket. Google Drive is added by signing in with Google.
targetStorageS3Target | StorageAzureBlobTarget | StorageGcsTargetyes
sendStorageSendno
send.foldersarray | nullyesLibrary folders to send, each with the folders inside it; null for every folder that has no access rule.
send.formats("svg" | "source")[]yessvg sends the picture; source sends the .diagram text the picture carries, when it carries one.
send.scheme"published" | "light" | "dark"yesA picture that follows the reader’s color scheme is sent as it is, or pinned to light or dark.
send.mirrorDeletionsbooleanyesRemove a file when its diagram is deleted from the library or moved out of what is sent.
send.skipConfidentialbooleanyesLeave out diagrams labelled Confidential.

Responses

StatusMeaningBody
201The destination, in setup.StorageDestination
400A field is not in the form the bucket needs (storage.invalid).ErrorResponse
401Not signed in.ErrorResponse
403Not the owner or an admin (orgs.forbidden), the plan does not include it (plan.storage_not_included), or the origin may not make changes.ErrorResponse
404No such organisation or destination, or the caller is not a member.ErrorResponse
409That kind is already set up (storage.exists).ErrorResponse
429Too many requests.ErrorResponse
503Sending to your storage is not available on this server (storage.unavailable).ErrorResponse

Response body

A 201 answer has the type StorageDestination.

FieldTypeRequiredDescription
idstringyes
type"google_drive" | "s3" | "azure_blob" | "gcs"yesgoogle_drive, s3, azure_blob or gcs.
state"setup" | "on" | "paused"yessetup while the steps are not done (nothing is sent), on, or paused.
connectedbooleanyesFalse for Google Drive until a Google account has granted access; true for a bucket.
targetStorageGoogleDriveTarget | StorageS3Target | StorageAzureBlobTarget | StorageGcsTargetyes
sendStorageSendyes
send.foldersarray | nullyesLibrary folders to send, each with the folders inside it; null for every folder that has no access rule.
send.formats("svg" | "source")[]yessvg sends the picture; source sends the .diagram text the picture carries, when it carries one.
send.scheme"published" | "light" | "dark"yesA picture that follows the reader’s color scheme is sent as it is, or pinned to light or dark.
send.mirrorDeletionsbooleanyesRemove a file when its diagram is deleted from the library or moved out of what is sent.
send.skipConfidentialbooleanyesLeave out diagrams labelled Confidential.
subjectstring | nullyesThe subject Plotwork’s issuer signs for this destination, which the bucket’s trust names. Null for Google Drive.
createdAtintegeryes
updatedAtintegeryes
statusStorageStatusyes
status.queuedintegeryes
status.deliveredintegeryes
status.droppedintegeryes
status.droppedLast24hintegeryes
status.filesintegeryesDiagrams the destination holds a copy of now.
status.lastSuccessAtinteger | nullyes
status.lastErrorAtinteger | nullyes
status.lastErrorstring | nullyesWhat failed last, in our words. Never what the destination answered.
status.nextAttemptAtinteger | nullyes
status.failingSinceinteger | nullyes

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools