create storage credential.md

Create Storage Credential

Media API · Storage

POST https://app.mk.io/api/v1/projects/{project_name}/media/storage/{storage_name}/credentials

Creates a Storage Credential. You can add as many Storage Credentials as you like to a Storage instance. We will choose the Storage Credential with the longest expiry time when we need to access the Storage instance. Credentials are immutable once created - but you can create a new Storage Credential record, then delete the old one.

RBAC Capability Required: infra.storagetoken.create

Authentication

Path parameters

Name Type Required Description
project_name string Yes
storage_name string Yes

Request body

Content type: application/json

Example request

curl -X POST "https://app.mk.io/api/v1/projects/{project_name}/media/storage/{storage_name}/credentials" \ 
  -H "Authorization: Bearer <token>" \ 
  -H "Content-Type: application/json" \ 
  -d '{
  "spec": {
    "credential": {
      "accessKeyId": "AKIAEXAMPLE123456789",
      "secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
    },
    "type": "AWS.S3"
  }
}'

Responses

201 — Create a Storage instance Credential.

400 — Bad Request

401 — Unauthorized

403 — Forbidden

404 — Not Found

429 — Too Many Requests

500 — Internal Server Error


Source spec: media-api · operationId: [post]_/api/v1/projects/{project_name}/media/storage/{storage_name}/credentials