Create Storage Credential – Media API – MediaKind

Create Storage Credential

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

Authorization Bearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

project_name string Required

storage_name string Required

Request

This endpoint expects an object.

spec object Required

The specification of the credential.

Show 3 variants Hide 3 variants

Discriminated by type. Select one variant:

Microsoft.Storage

object AzureCredentialSpecCreate

credential object AzureCredentialCreate Required

The credential for the Azure Storage Account

Show 1 property Hide 1 property

SAS Token for Azure Storage Account, including leading ?

The type of the credential.

Allowed values: Microsoft.Storage, AWS.S3, Google.Storage

AWS.S3

object AWSCredentialSpec

credential object AWSCredential Required

The credential for the AWS S3 bucket.

Show 2 properties Hide 2 properties

The access key ID for the bucket.

The secret access key for the bucket.

The type of the credential.

Allowed values: Microsoft.Storage, AWS.S3, Google.Storage

Google.Storage

object GoogleCredentialSpec

credential object GoogleCredential Required

The credential for the Google Storage bucket.

Show 1 property Hide 1 property

Google Application Credentials in JSON format.

You can generate this from the command line with gcloud iam service-accounts keys create key.json --iam-account=<service_account>@<project>.iam.gserviceaccount.com

Or download it from the GCP console.

Show value schema Hide value schema

- [any key] string

The type of the credential.

Allowed values: Microsoft.Storage, AWS.S3, Google.Storage

Response

201 Create a Storage instance Credential.

metadata object SasTokenMetadataSchema Required

Metadata about the credential.

Show 7 properties Hide 7 properties

The time when the resource was created

ID of the user who created the resource

Email of the user who created the resource

The ID of the resource

The time when the resource was last updated

ID of the user who last updated the resource

Email of the user who last updated the resource

The specification of the credential.

Show 3 variants Hide 3 variants

Discriminated by type. Select one variant:

Microsoft.Storage

object AzureCredentialSpecRead

credential object AzureCredentialRead Required

The credential for the Azure Storage Account

Show 3 properties Hide 3 properties

SAS Token for Azure Storage Account, including leading ?

The expiry time of the token.

The start time of the token.

The type of the credential.

Allowed values: Microsoft.Storage, AWS.S3, Google.Storage

AWS.S3

object AWSCredentialSpec

credential object AWSCredential Required

The credential for the AWS S3 bucket.

Show 2 properties Hide 2 properties

The access key ID for the bucket.

The secret access key for the bucket.

The type of the credential.

Allowed values: Microsoft.Storage, AWS.S3, Google.Storage

Google.Storage

object GoogleCredentialSpec

credential object GoogleCredential Required

The credential for the Google Storage bucket.

Show 1 property Hide 1 property

Google Application Credentials in JSON format.

Or download it from the GCP console.

Show value schema Hide value schema

- [any key] string

The type of the credential.

Allowed values: Microsoft.Storage, AWS.S3, Google.Storage

Errors

400 Bad Request

error object ErrorDetail Required

Pertinent information about the error

Show 3 properties Hide 3 properties

The error code.

The error message.

Extra information regarding this error.

Show value schema Hide value schema

- [any key] any

A reference to the request that caused the error.

The HTTP status code

401 Unauthorized

error object ErrorDetail Required

Pertinent information about the error

Show 3 properties Hide 3 properties

The error code.

The error message.

Extra information regarding this error.

Show value schema Hide value schema

- [any key] any

A reference to the request that caused the error.

The HTTP status code

403 Forbidden

error object ErrorDetail Required

Pertinent information about the error

Show 3 properties Hide 3 properties

The error code.

The error message.

Extra information regarding this error.

Show value schema Hide value schema

- [any key] any

A reference to the request that caused the error.

The HTTP status code

404 Not Found

error object ErrorDetail Required

Pertinent information about the error

Show 3 properties Hide 3 properties

The error code.

The error message.

Extra information regarding this error.

Show value schema Hide value schema

- [any key] any

A reference to the request that caused the error.

The HTTP status code

429 Too Many Requests

error object ErrorDetail Required

Pertinent information about the error

Show 3 properties Hide 3 properties

The error code.

The error message.

Extra information regarding this error.

Show value schema Hide value schema

- [any key] any

A reference to the request that caused the error.

The HTTP status code

500 Internal Server Error

error object ErrorDetail Required

Pertinent information about the error

Show 3 properties Hide 3 properties

The error code.

The error message.

Extra information regarding this error.

Show value schema Hide value schema

- [any key] any

A reference to the request that caused the error.

The HTTP status code