iam.access-keys.create

Create an access key and return its secret once

POST /iam/api/access-keysIAM iam:CreateAccessKeyChanges state

The secret is in the response and nowhere else. The key signs Deutsche Cloud API calls (`Authorization: EWS-ACCESS-KEY id:secret`) and S3 requests (SigV4: id as the access key id, secret as the secret access key). Every key expires: `expiresAt` is in the response. With `scopePolicy` the key can do only what both the principal and the scope allow.

Request syntax

POST /iam/api/access-keys
{
  "iamUserId": "string",
  "expiresInDays": "number",
  "description": "string",
  "scopePolicy": "string",
  "actAsMember": "boolean"
}

Request body

  • iamUserIdOptional

    string

    The ID of the IAM user the key signs in as; omitted: yourself

    Constraints: uuid

  • expiresInDaysOptional

    number

    Days until the key expires; default the organization’s default (90), at most its maximum (365)

    Constraints: integer, 1-3650

  • descriptionOptional

    string

    What the key is for

    Constraints: max 256 chars

  • scopePolicyOptional

    string

    A policy document (JSON text) that caps the key: a request needs the principal’s policies AND this document to allow it. E.g. S3 on one bucket: {"Version":"2024-01-01","Statement":[{"Effect":"Allow","Action":["s3:ListObjects","s3:GetObject"],"Resource":["rn:ews::<org>:s3:bucket/<name>","rn:ews::<org>:s3:bucket/<name>/object/*"]}]}

    Constraints: max 10240 chars

  • actAsMemberOptional

    boolean

    Must be true when iamUserId is another person’s own IAM user: everything done with the key is recorded as that person, and the audit entry names both

Response

201 with the key: id, orgId, iamUserId, accessKeyId, status, createdAt, lastUsedAt, expiresAt, description, scopePolicy, s3 and secretKey, which is shown only in this response.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow iam:CreateAccessKey on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud iam access-keys create

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_iam_access-keys_create.