Sub-Users

A sub-user is an additional S3 identity under your account. Each one carries its own accessKey and secretKey, and a list of bucketAccess entries pairing a bucket with a policy statement template.

All requests go to the Storage gateway and need the authentication headers.

Permissions

Two distinct enums exist and their values are not identical — check which one a field expects.

EnumValues
s3_SubUserPermissionREAD, WRITE, READ_WRITE, FULL
s3_SubUserBucketPermissionREAD, WRITE, READ_WRITE, FULL_ACCESS

List Sub-Users

Query · s3_getSubUsers

Returns a paginated list of sub-users.

Arguments

NameTypeRequiredDescription
inputs3_ListSubUsersInputNoPagination, filter and sort

input

FieldTypeRequiredDescription
pagers3_PagerInputNoPage and page size
bucketIdStringNoOnly sub-users with access to this bucket
statementIdStringNoOnly sub-users holding this statement
bucketPermissions3_SubUserBucketPermissionNoFilter by bucket-level permission
permissions3_SubUserPermissionNoFilter by account-level permission
sortBys3_SortByNoASC or DESC
searchStringNoFree-text search

pager

FieldTypeRequiredDescription
pageInt!YesPage number
limitInt!YesItems per page

Response — s3_ListSubUsersResponse

FieldTypeDescription
subUsers[s3_SubUserListItemResponse!]!The page of results
paginations3_Pagination!Pagination metadata

s3_SubUserListItemResponse

FieldTypeDescription
idID!Sub-user identifier
subUIdString!Sub-user UID
permissions3_SubUserPermission!Account-level permission
accessKeyString!The sub-user's S3 access key
secretKeyString!The sub-user's S3 secret key
bucketAccess[s3_SubUserBucketAccessResponse!]!Per-bucket access

s3_SubUserBucketAccessResponse

FieldTypeDescription
bucketIdID!Identifier of the bucket
bucketNameStringName of the bucket
statementIdID!Identifier of the policy statement
statementLabelStringLabel of the policy statement
permissionStringPermission granted on this bucket
actions[String!]!Actions the statement permits
resources[String!]!Resources the statement applies to

s3_Pagination

FieldType
currentPageInt!
lastPageInt!
fromInt!
perPageInt!
toInt!
totalInt!

Variables

{
  "input": {
    "pager": { "page": 1, "limit": 20 },
    "sortBy": "ASC"
  }
}

Request

query getSubUsers($input: s3_ListSubUsersInput) {
  s3_getSubUsers(input: $input) {
    subUsers {
      id
      subUId
      permission
      accessKey
      secretKey
      bucketAccess {
        bucketId
        bucketName
        statementId
        statementLabel
        permission
        actions
        resources
      }
    }
    pagination {
      currentPage
      lastPage
      from
      perPage
      to
      total
    }
  }
}

Policy Statement Templates

Query · s3_getPolicyStatementTemplates

Returns the policy statement templates available when granting a sub-user access to a bucket. A template's id is what you pass as statementId when creating or updating a sub-user. Takes no arguments.

Response — [s3_PolicyStatementTemplate!]!

FieldTypeDescription
idID!Template identifier
labelString!Human-readable template name
descriptionStringWhat the template grants
actions[String!]!Actions the template permits

Request

query getPolicyStatementTemplates {
  s3_getPolicyStatementTemplates {
    id
    label
    description
    actions
  }
}

Create Sub-User

Mutation · s3_createSubUser

Creates a sub-user and issues its key pair.

Arguments

NameTypeRequiredDescription
inputs3_CreateSubUserInput!YesSub-user definition

input

FieldTypeRequiredDescription
subUidString!YesUID for the new sub-user
bucketAccess[s3_CreateSubUserBucketAccessInput!]!YesBucket/statement pairs to grant

bucketAccess

FieldTypeRequiredDescription
bucketIdString!YesBucket to grant access to
statementIdString!YesPolicy statement template to apply

Variables

{
  "input": {
    "subUid": "reporting-service",
    "bucketAccess": [
      {
        "bucketId": "68b571f65f34c302831d923f",
        "statementId": "read-only"
      }
    ]
  }
}

Request

mutation createSubUser($input: s3_CreateSubUserInput!) {
  s3_createSubUser(input: $input) {
    id
    subUId
    accessKey
    secretKey
    permission
    bucketAccess {
      bucketId
      statementId
    }
    createdAt
    updatedAt
  }
}

Response — s3_SubUserResponse

FieldTypeDescription
idID!Sub-user identifier
subUIdString!Sub-user UID
accessKeyString!Newly issued access key
secretKeyString!Newly issued secret key
permissions3_SubUserPermissionAccount-level permission
bucketAccess[s3_SubUserBucketAccess!]!Granted access — bucketId and statementId only
createdAtFloat!Creation timestamp
updatedAtFloat!Last update timestamp

Update Sub-User

Mutation · s3_updateSubUser

Replaces a sub-user's bucket access.

Arguments

NameTypeRequiredDescription
inputs3_UpdateSubUserInput!YesChanges to apply

input

FieldTypeRequiredDescription
idString!YesSub-user to update
bucketAccess[s3_CreateSubUserBucketAccessInput!]NoBucket/statement pairs to grant

Variables

{
  "input": {
    "id": "674ebff6c12192a423b48b2d",
    "bucketAccess": [
      {
        "bucketId": "68b571f65f34c302831d923f",
        "statementId": "read-write"
      }
    ]
  }
}

Request

mutation updateSubUser($input: s3_UpdateSubUserInput!) {
  s3_updateSubUser(input: $input) {
    id
    subUId
    accessKey
    secretKey
    permission
    bucketAccess {
      bucketId
      statementId
    }
    createdAt
    updatedAt
  }
}

Returns s3_SubUserResponse, the same shape as Create Sub-User.


Delete Sub-User

Mutation · s3_deleteSubUser

Removes a sub-user.

Arguments

NameTypeRequiredDescription
inputs3_DeleteSubUserInput!YesSub-user to delete

input

FieldTypeRequiredDescription
idString!YesSub-user to delete

Variables

{
  "input": {
    "id": "674ebff6c12192a423b48b2d"
  }
}

Request

mutation deleteSubUser($input: s3_DeleteSubUserInput!) {
  s3_deleteSubUser(input: $input) {
    message
    success
  }
}

Response — s3_CommonResponse

FieldTypeDescription
messageString!Result message
successBoolean!Whether it worked

Regenerate Sub-User Key

Mutation · s3_regenerateSubUserKey

Issues a new access key and secret key for a sub-user. The previous pair stops working.

Arguments

NameTypeRequiredDescription
inputs3_RegenerateSubUserKeyInput!YesSub-user to re-key

input

FieldTypeRequiredDescription
idString!YesSub-user to re-key

Variables

{
  "input": {
    "id": "674ebff6c12192a423b48b2d"
  }
}

Request

mutation regenerateSubUserKey($input: s3_RegenerateSubUserKeyInput!) {
  s3_regenerateSubUserKey(input: $input) {
    id
    subUId
    accessKey
    secretKey
    createdAt
    updatedAt
  }
}

Returns s3_SubUserResponse carrying the new accessKey and secretKey.