> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.sevalla.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rotate object storage credentials

> Generate a new access key and secret key for the object storage bucket. The previous credentials can optionally stay valid for a grace period (up to 168 hours) so clients can migrate without downtime. When the grace period elapses, the previous credentials stop working. The new credentials are returned in the response and are the only chance to capture them.



## OpenAPI

````yaml https://api.sevalla.com/v3/openapi.json post /object-storage/{id}/rotate-credentials
openapi: 3.1.0
info:
  title: Sevalla API docs
  version: 1.0.0
servers:
  - url: https://api.sevalla.com/v3
security:
  - bearerAuth: []
paths:
  /object-storage/{id}/rotate-credentials:
    post:
      tags:
        - Object storages
      summary: Rotate object storage credentials
      description: >-
        Generate a new access key and secret key for the object storage bucket.
        The previous credentials can optionally stay valid for a grace period
        (up to 168 hours) so clients can migrate without downtime. When the
        grace period elapses, the previous credentials stop working. The new
        credentials are returned in the response and are the only chance to
        capture them.
      operationId: rotateObjectStorageCredentialsV3
      parameters:
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            example: fb5e5168-4281-4bec-94c5-0d1584e9e657
          in: path
          name: id
          required: true
          description: Object storage bucket identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                old_keys_ttl_hours:
                  default: 0
                  description: >-
                    Number of hours to keep the previous access and secret keys
                    valid after rotation (0-168). Set to 0 to immediately
                    invalidate the previous credentials. Use a non-zero value to
                    give clients time to migrate to the new credentials.
                  example: 24
                  type: integer
                  minimum: 0
                  maximum: 168
              additionalProperties: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    description: Unique identifier for the object storage bucket
                    example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                  company_id:
                    type: string
                    description: >-
                      Identifier of the company that owns this object storage
                      bucket
                    example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                  project_id:
                    anyOf:
                      - type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      - type: 'null'
                    description: >-
                      Identifier of the project this object storage bucket is
                      grouped under
                    example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                  name:
                    type: string
                    description: >-
                      Unique system name used in internal references.
                      Auto-generated from the display name and cannot be changed
                      after creation.
                    example: my-bucket
                  display_name:
                    type: string
                    description: >-
                      Human-readable name shown in the dashboard and API
                      responses
                    example: My Bucket
                  location:
                    type: string
                    enum:
                      - apac
                      - eeur
                      - enam
                      - oc
                      - weur
                      - wnam
                    description: >-
                      Geographic hint for where most data access occurs. `apac`
                      - Asia-Pacific. `eeur` - Eastern Europe. `enam` - Eastern
                      North America. `oc` - Oceania. `weur` - Western Europe.
                      `wnam` - Western North America.
                    example: enam
                  jurisdiction:
                    type: string
                    enum:
                      - default
                      - eu
                      - fedramp
                    description: >-
                      Data residency jurisdiction for the bucket. `default` - no
                      jurisdiction restriction. `eu` - data stored exclusively
                      in the EU. `fedramp` - FedRAMP-compliant storage.
                    example: default
                  status:
                    type: string
                    enum:
                      - active
                      - deleting
                      - deletionFailed
                    description: >-
                      Current lifecycle state of the bucket. `active` - bucket
                      is available for use. `deleting` - deletion is in
                      progress, the bucket is emptied and removed
                      asynchronously. `deletionFailed` - the deletion job
                      failed, contact support to retry.
                    example: active
                  domain:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Public CDN domain for accessing objects in the bucket.
                      Null if public access is not enabled.
                    example: my-bucket.sevalla.storage
                  endpoint:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      S3-compatible API endpoint URL for programmatic access to
                      the bucket
                    example: https://account-id.r2.cloudflarestorage.com
                  access_key:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Access key ID for S3-compatible API authentication. Only
                      returned when the bucket is first created.
                    example: access-key-id
                  secret_key:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Secret access key for S3-compatible API authentication.
                      Only returned when the bucket is first created.
                    example: secret-access-key
                  old_access_key:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Previous access key ID that is still valid until
                      old_keys_expired_at, returned when credentials were
                      rotated with a grace period. Null once the grace period
                      has elapsed.
                    example: old-access-key-id
                  old_secret_key:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Previous secret access key that is still valid until
                      old_keys_expired_at, returned when credentials were
                      rotated with a grace period. Null once the grace period
                      has elapsed.
                    example: old-secret-access-key
                  old_keys_expired_at:
                    anyOf:
                      - type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                      - type: 'null'
                    description: >-
                      Timestamp when the previous credentials stop working, in
                      ISO 8601 format. Null if no grace period is active.
                    example: '2025-01-31T00:00:00.000Z'
                  created_at:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    description: >-
                      Timestamp when the object storage bucket was created, in
                      ISO 8601 format
                    example: '2025-01-30T00:00:00.000Z'
                  updated_at:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    description: >-
                      Timestamp when the object storage bucket was last
                      modified, in ISO 8601 format
                    example: '2025-01-30T00:00:00.000Z'
                required:
                  - id
                  - company_id
                  - project_id
                  - name
                  - display_name
                  - location
                  - jurisdiction
                  - status
                  - domain
                  - endpoint
                  - access_key
                  - secret_key
                  - old_access_key
                  - old_secret_key
                  - old_keys_expired_at
                  - created_at
                  - updated_at
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Bad request
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 400
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Unauthorized
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 401
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Forbidden
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 403
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Not found
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 404
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '429':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Too many requests
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 429
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Internal Server Error
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 500
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Pass your API key as a Bearer token in the
        Authorization header.

````