Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

Create bucket key

POST/v1/buckets/{bucketId}/keysCreate bucket key

Creates a new access key for the given bucket. The secretAccessKey field is returned exactly once in this response and is never stored — copy it immediately.

Parameters

bucketIdstringpathrequired

pattern ^(bkt_)?([cC][^\s-]{8,}|[a-z0-9]+)$

Request body

application/json
object
namestring

Display name for the key. Generated if omitted.

minLength 1

rolestringrequired

Access role for the key: "read" or "read_write".

one of "read", "read_write"

Example request
{
  "name": "string",
  "role": "read"
}

Responses

201Created a new bucket key. The secret is returned once in the response body.application/json
object
dataobjectrequired
Show child attributes
accessKeyIdstringrequired
bucketNamestringrequired
createdAtstring · date-timerequired
endpointstringrequired
idstringrequired

pattern ^(bkey_)([cC][^\s-]{8,}|[a-z0-9]+)$

namestringrequired
rolestringrequired

one of "read", "read_write"

secretAccessKeystringrequired
typestringrequired

const "bucketKey"

valueHintstringrequired
Example response
{
  "data": {
    "accessKeyId": "string",
    "bucketName": "string",
    "createdAt": "2026-06-09T00:00:00Z",
    "endpoint": "string",
    "id": "string",
    "name": "string",
    "role": "read",
    "secretAccessKey": "string",
    "type": "bucketKey",
    "valueHint": "string"
  }
}
400Invalid request parameters.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
401Missing or invalid authorization token.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
404Bucket with the given ID was not found.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
413Request body exceeds this endpoint's size cap.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
Documentation menu