get storage credential.md
Get Storage Credential
Media API · Storage
GET https://app.mk.io/api/v1/projects/{project_name}/media/storage/{storage_name}/credentials/{credential_id}
Returns a single Storage Credential. Any secret data will be sanitized in the response.
RBAC Capability Required: infra.storagetoken.get
Authentication
Authorizationheader — Bearer authentication of the formBearer <token>.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
project_name |
string | Yes | — |
storage_name |
string | Yes | — |
credential_id |
string | Yes | format: uuid |
Example request
curl -X GET "https://app.mk.io/api/v1/projects/{project_name}/media/storage/{storage_name}/credentials/{credential_id}" \
-H "Authorization: Bearer <token>"
Responses
200 — A single Storage Credential.
metadata· object · Required — Metadata about the credential.created· string · Optional · format: date-time — The time when the resource was createdcreatedBy· string · Optional · format: uuid — ID of the user who created the resourcecreatedByEmail· string · Optional — Email of the user who created the resourceid· string · Required · format: uuid — The ID of the resourceupdated· string · Optional · format: date-time — The time when the resource was last updatedupdatedBy· string · Optional · format: uuid — ID of the user who last updated the resourceupdatedByEmail· string · Optional — Email of the user who last updated the resource
spec· object · Required — The specification of the credential.- One of the following variants, selected by
type:- Microsoft.Storage (object)
credential· object · Required — The credential for the Azure Storage AccountsasToken· string · Required · pattern: ^\?([a-z]+=[^&]+)(&[a-z]+=[^&]+)+$ — SAS Token for Azure Storage Account, including leading ?signedExpiry· string · Required · format: date-time — The expiry time of the token.signedStart· string or null · Required · format: date-time — The start time of the token.
type· enum or null · Required — The type of the credential.- Allowed values:
Microsoft.Storage,AWS.S3,Google.Storage
- Allowed values:
- AWS.S3 (object)
credential· object · Required — The credential for the AWS S3 bucket.accessKeyId· string · Required · pattern: ^A[KS]IA[0-9A-Z]{16}$ — The access key ID for the bucket.secretAccessKey· string · Required · pattern: ^[A-Za-z0-9+/=]{40}$ — The secret access key for the bucket.
type· enum or null · Required — The type of the credential.- Allowed values:
Microsoft.Storage,AWS.S3,Google.Storage
- Allowed values:
- Google.Storage (object)
credential· object · Required — The credential for the Google Storage bucket.gac· map from strings to string · Required — Google Application Credentials in JSON format. You can generate this from the command line withgcloud iam service-accounts keys create key.json --iam-account=<service_account>@<project>.iam.gserviceaccount.comOr download it from the GCP console.[any key]· string — map of additional properties
type· enum or null · Required — The type of the credential.- Allowed values:
Microsoft.Storage,AWS.S3,Google.Storage
- Allowed values:
- Microsoft.Storage (object)
- One of the following variants, selected by
Example:
{
"metadata": {
"created": "2024-01-01T00:00:00Z",
"createdBy": "00000000-0000-0000-0000-000000000000",
"createdByEmail": "string",
"id": "00000000-0000-0000-0000-000000000000",
"updated": "2024-01-01T00:00:00Z",
"updatedBy": "00000000-0000-0000-0000-000000000000",
"updatedByEmail": "string"
},
"spec": {
"type": "Microsoft.Storage",
"credential": {
"sasToken": "?sv=2022-11-02&ss=bfqt&srt=co&sp=rwdlacupiyx&se=2024-11-12T00:05:04Z&st=2024-11-11T16:05:04Z&spr=https&sig=<redacted>",
"signedExpiry": "2024-11-12T00:05:04Z",
"signedStart": "2024-11-11T16:05:04Z"
}
}
}
400 — Bad Request
error· object · Required — Pertinent information about the errorcode· string · Required — The error code.detail· string · Required — The error message.extraDetail· map from strings to any · Optional — Extra information regarding this error.[any key]· any — map of additional properties
ref· string · Required — A reference to the request that caused the error.status· integer · Required — The HTTP status code
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
401 — Unauthorized
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
403 — Forbidden
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
404 — Not Found
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
429 — Too Many Requests
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
500 — Internal Server Error
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
Source spec: media-api · operationId: [get]_/api/v1/projects/{project_name}/media/storage/{storage_name}/credentials/{credential_id}