Skip to content

Connect a bucket

POST
/orgs/{orgId}/buckets
curl --request POST \
--url https://example.com/api/v1/orgs/example/buckets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "accessKeyId": "example", "basePath": "example", "bucketName": "example", "caps": { "del": true, "list": true, "pub": true, "read": true, "write": true }, "endpoint": "example", "eventsValue": "example", "maxUploadBytes": 1, "name": "example", "pathStyle": true, "provider": "aws", "publicBaseUrl": "example", "reachability": "public", "region": "example", "secretAccessKey": "example" }'

Connects an S3-compatible bucket, validates its endpoint policy, pings the bucket, and probes .sendcrate/staging/ lifecycle rules. Requires owner or admin role in shared orgs, an org-wide token (or session), and available buckets quota.

orgId
required

Organization ID.

string
Media typeapplication/json
object
accessKeyId
string
basePath

Optional key prefix inside the bucket treated as root.

string
bucketName
required

Underlying bucket name at the S3 provider.

string
>= 1 characters
caps

S3 operations declared permitted for a bucket’s credentials.

object
del
required

Key can delete objects (s3:DeleteObject).

boolean
list
required

Key can list keys (s3:ListBucket).

boolean
pub
required

Key can publish objects via ACL or bucket policy for public links.

boolean
read
required

Key can read objects (s3:GetObject).

boolean
write
required

Key can write objects (s3:PutObject).

boolean
endpoint

S3 API endpoint URL (required for non-AWS providers).

string
eventsValue
Any of:
string
>= 1 characters
maxUploadBytes

Optional maximum upload size in bytes per object.

Any of:
integer
> 0 <= 9007199254740991
name
string
>= 1 characters
pathStyle

Use path-style S3 URLs instead of virtual-hosted-style.

boolean
provider

S3-compatible storage provider (aws, r2, spaces, b2, minio).

string
Allowed values: aws r2 spaces b2 minio
publicBaseUrl

Optional public CDN/custom base URL fronting the bucket.

Any of:
string
>= 1 characters
reachability

Network reachability of the bucket endpoint from recipients: public (internet-reachable) or internal (private network only; disables direct and non-CDN public links).

string
Allowed values: public internal
region
string
secretAccessKey
string

Connected bucket and initial webhook signing secret (when supported by the provider)

Media typeapplication/json
object
bucket
required

Connected S3-compatible bucket and its health, caps, and access.

object
access
required

Who inside the organization can reach a bucket.

object
everyone
required

When true, every non-guest member of the organization can access the bucket.

boolean
grants
required

Explicit team and member grants on the bucket.

Array<object>

Per-member or per-team bucket access grant.

object
id
required

Team ID or organization member ID.

string
kind
required
string
Allowed values: team member
level
required

Bucket permission level: share (browse, download, upload, delete, and create links) or read (browse and download only).

string
Allowed values: share read
basePath
required

Optional key prefix inside the provider bucket that Sendcrate treats as root.

Any of:
string
bucketName
required

Underlying bucket name at the S3 provider.

string
caps
required

S3 operations declared permitted for a bucket’s credentials.

object
del
required

Key can delete objects (s3:DeleteObject).

boolean
list
required

Key can list keys (s3:ListBucket).

boolean
pub
required

Key can publish objects via ACL or bucket policy for public links.

boolean
read
required

Key can read objects (s3:GetObject).

boolean
write
required

Key can write objects (s3:PutObject).

boolean
endpoint
required

S3 API endpoint URL used by Sendcrate.

Any of:
string
eventsSeen
required

ISO-8601 UTC timestamp of the last verified provider webhook event, or null.

Any of:
string
eventsValue
required

Optional provider event-notification metadata value.

Any of:
string
id
required
string
keyAdded
required

ISO-8601 UTC timestamp when credentials were last added or rotated.

Any of:
string
keyIdTail
required

Last 6 characters of the stored S3 access key ID for identification.

Any of:
string
locked
required

When true, this bucket is defined in sendcrate.yml and its connection settings cannot be edited via the API.

boolean
maxUploadBytes
required

Optional per-object upload limit in bytes enforced before presigning.

Any of:
number
myLevel
required

The caller’s effective permission level on this bucket.

Any of:

Bucket permission level: share (browse, download, upload, delete, and create links) or read (browse and download only).

string
Allowed values: share read
name
required

Display name of the bucket inside Sendcrate.

string
orgId
required
string
pathStyle
required

Whether S3 requests use path-style URLs instead of virtual-hosted-style.

boolean
provider
required

S3-compatible storage provider (aws, r2, spaces, b2, minio).

string
Allowed values: aws r2 spaces b2 minio
providerLabel
required

Human-readable provider name.

string
providerShort
required

Short provider label.

string
publicBaseUrl
required

Optional public CDN or custom base URL fronting the bucket for public links.

Any of:
string
reachability
required

Network reachability of the bucket endpoint from recipients: public (internet-reachable) or internal (private network only; disables direct and non-CDN public links).

string
Allowed values: public internal
region
required
Any of:
string
rootShared
required

Whether an active share link targets the entire bucket root.

boolean
stagingAbortRule
required

Whether the probed lifecycle config aborts incomplete multipart uploads under .sendcrate/staging/, or null if unknown.

Any of:
boolean
stagingLifecycle
required

Whether the probed lifecycle config expires objects under .sendcrate/staging/, or null if unknown.

Any of:
boolean
status
required

Last observed connection health of the bucket (ok, limited, unreachable).

string
Allowed values: ok limited unreachable
statusNote
required

Diagnostic message explaining a limited or unreachable status.

Any of:
string
webhookUrl
required

Signed provider event webhook URL for providers that push events, or null.

Any of:
string
webhookSecret
required
Any of:
string

Example

{
"bucket": {
"access": {
"grants": [
{
"kind": "team",
"level": "share"
}
]
},
"myLevel": "share",
"provider": "aws",
"reachability": "public",
"status": "ok"
}
}

Invalid request input or rule violation.

Media typeapplication/json

Error returned when request input fails schema validation or violates a domain rule.

object
code
required
string
Allowed values: BAD_REQUEST
data
object
issues
required

Field-level validation failures, present when schema validation fails.

Array<object>
object
message
required
string
path
required

Dot-separated field path.

string
message
required

Human-readable error explanation.

string

Example

{
"code": "BAD_REQUEST"
}

Authentication required or credentials invalid.

Media typeapplication/json

Standard REST error envelope.

object
code
required

Machine-readable error code.

string
data

Optional structured error details.

message
required

Human-readable error explanation.

string

Example generated

{
"code": "example",
"data": "example",
"message": "example"
}

Plan or license entitlement required.

Media typeapplication/json

Error returned when an organization lacks a required plan or license entitlement.

object
code
required
string
Allowed values: PAYMENT_REQUIRED
data
object
entitlement
required

Feature or quota gate enforced by the active plan or license.

string
Allowed values: audit buckets customDomains multiUser policies proxiedDelivery sso
message
required

Human-readable error explanation.

string

Example

{
"code": "PAYMENT_REQUIRED",
"data": {
"entitlement": "audit"
}
}

Insufficient role, bucket grant, or token scope.

Media typeapplication/json

Standard REST error envelope.

object
code
required

Machine-readable error code.

string
data

Optional structured error details.

message
required

Human-readable error explanation.

string

Example generated

{
"code": "example",
"data": "example",
"message": "example"
}

Unexpected server error. Quote data.requestId when you report it.

Media typeapplication/json

Error returned when Sendcrate or one of its providers fails (5xx).

object
code
required
string
Allowed values: INTERNAL_SERVER_ERROR PROVIDER_FAILED
data
object
debug

Error chain with stack traces. Present only when the server runs in development mode.

Array
requestId

Request reference to quote when you report the error.

string
message
required

Human-readable error explanation.

string

Example

{
"code": "INTERNAL_SERVER_ERROR"
}