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

# Generate or regenerate the current user's S3 credential

> Generates a new S3 access/secret key pair for the currently logged-in user.

Adhere to the following:
- You receive the secret key only once. Store it securely, you can't retrieve it again.
- If a credential already exists, it's replaced and the old keys stop working.
- Authentication requires a Keycloak token. PSK auth isn't allowed.



## OpenAPI

````yaml post /api/s3-credentials
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/s3-credentials:
    post:
      tags:
        - S3 Credentials
      summary: Generate or regenerate the current user's S3 credential
      description: >-
        Generates a new S3 access/secret key pair for the currently logged-in
        user.


        Adhere to the following:

        - You receive the secret key only once. Store it securely, you can't
        retrieve it again.

        - If a credential already exists, it's replaced and the old keys stop
        working.

        - Authentication requires a Keycloak token. PSK auth isn't allowed.
      operationId: create_s3_credential_api_s3_credentials_post
      responses:
        '201':
          description: Credential generated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/S3CredentialCreatedResponse'
        '403':
          description: Forbidden, Keycloak token required.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    S3CredentialCreatedResponse:
      properties:
        access_key:
          type: string
          title: Access Key
          description: The S3 access key ID.
        secret_key:
          type: string
          title: Secret Key
          description: The S3 secret key. Store this securely, you can't retrieve it again.
        message:
          type: string
          title: Message
          description: Important information about the credential.
      type: object
      required:
        - access_key
        - secret_key
        - message
      title: S3CredentialCreatedResponse
      description: Result of generating/regenerating an S3 credential. Shown only once.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````