/storage/locationsCreate Storage Location
Registers one of the customer's own object stores as a storage location for the project.
Both region (the platform region, checked against the project's data residency) and providerRegion (the bucket's own region at its provider) are required, and neither is derived from the other.
A region outside the project's residency set is refused.
The credential is referenced, never sent in the request.
The change is audited as data.write.org.settings_updated.
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| provider * | "s3" | "s3_compatible" | "gcs" | "azure_blob" | "minio" | "r2" | "b2" | The storage provider. |
| bucketName * | string | The bucket or container name at the provider. |
| region * | string | The platform region the data belongs to. It must be in the project's residency set, or the request is refused. |
| providerRegion * | string | The bucket's region at its provider, used for signing and the endpoint host: |
| endpointOverride | string | A custom endpoint URL, for S3-compatible providers and MinIO. |
| credentialRef * | string | A reference to a credential you created beforehand, Any other string is refused. |
| custodyMode | "PLATFORM_MANAGED" | "BYOK" | "HYOK" | Who holds the encryption keys for data written to the location. Default |
| providerParams | object | Non-secret settings the provider's credential exchange needs, as string keys with string values (each value at most 512 characters, at most 16 keys). The keys read per provider:
Never put a secret here: the secret lives in the credential that |
| HTTP | K9O Code | Description |
|---|---|---|
| 201 | Created | |
| 400 | K9O_INVALID_REQUEST_SHAPE | The request body failed schema validation, for example a provider value outside the supported vendor list; context.detail lists the failing fields. |
| 400 | K9O_INVALID_FIELD_VALUE | The credentialRef is not a valid kibo://byos-creds/<secId> reference; pre-create the credential secret and bind its reference. |
| 403 | K9O_ACCESS_DENIED | Your role does not permit provisioning storage locations for this project. |
| 403 | K9O_CREDENTIAL_CUSTODY_MISMATCH | The requested credential access mode does not match the custody mode configured for this project. |
| data * | object | A storage location: a bucket at an outside provider that the project's storage writes to. |
| id * | string | The location id ( |
| projectId * | string | The project the location belongs to ( |
| provider * | "s3" | "s3_compatible" | "gcs" | "azure_blob" | "minio" | "r2" | "b2" | The storage provider. |
| bucketName * | string | The bucket or container name at the provider. |
| region * | string | The platform region the data belongs to. |
| providerRegion * | string | The bucket's region at its provider. |
| endpointOverride * | any | The custom endpoint URL, or null when none is set. |
| One of: string | ||
| or: null | ||
| credentialRef * | string | The credential reference ( The secret itself is never returned. |
| custodyMode * | "PLATFORM_MANAGED" | "BYOK" | "HYOK" | Who holds the encryption keys for data written to the location. |
| providerParams * | object | The non-secret provider settings as stored, string keys with string values; an empty object when none were given. |
| createdAt * | string <date-time> | When the location was created. |
| retiredAt * | any | When the location was retired, or null while it is active. List results are always active; a read by id also returns a retired location. |
| One of: string <date-time> | ||
| or: null | ||
| meta * | any | |
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.storage.locations.create({})Showing example in TypeScript
{
"provider": "s3",
"bucketName": "string",
"region": "string",
"providerRegion": "string",
"endpointOverride": "string",
"credentialRef": "string",
"custodyMode": "PLATFORM_MANAGED"
}{
"data": {
"id": "string",
"projectId": "string",
"provider": "s3",
"bucketName": "string",
"region": "string",
"providerRegion": "string",
"endpointOverride": "string",
"credentialRef": "string",
"custodyMode": "PLATFORM_MANAGED",
"createdAt": "string",
"retiredAt": "string"
}
}