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

# Create a new SQL user.



## OpenAPI

````yaml /openapi/cloud/2022-03-31.json post /api/v1/clusters/{cluster_id}/sql-users
openapi: 3.0.0
info:
  title: CockroachDB Cloud API
  description: >-
    This is an early access, experimental version of the Cloud API. The
    interface and output is subject to change, and there may be bugs.


    # Authentication


    <!-- ReDoc-Inject: <security-definitions> -->
  version: '2022-03-31'
  contact:
    name: Cockroach Labs Support
    url: https://support.cockroachlabs.com
    email: support@cockroachlabs.com
servers:
  - url: https://cockroachlabs.cloud
security:
  - Bearer: []
tags:
  - name: CockroachCloud
externalDocs:
  description: Use the CockroachDB Cloud API
  url: https://www.cockroachlabs.com/docs/cockroachcloud/cloud-api
paths:
  /api/v1/clusters/{cluster_id}/sql-users:
    post:
      tags:
        - CockroachCloud
      summary: Create a new SQL user.
      operationId: CockroachCloud_CreateSQLUser
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                name: example_username
                password: example_password
              properties:
                name:
                  type: string
                password:
                  type: string
              title: CreateSQLUserRequest
              required:
                - name
                - password
        required: true
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SQLUser'
        '400':
          description: Returned when a request field is invalid.
          content:
            application/json:
              schema: {}
        '401':
          description: Returned when the token bearer cannot be authenticated.
          content:
            application/json:
              schema: {}
        '403':
          description: >-
            Returned when the user does not have permission to access the
            resource.
          content:
            application/json:
              schema: {}
        '404':
          description: Returned when the resource does not exist.
          content:
            application/json:
              schema: {}
        5XX:
          description: Server error
          content:
            application/json:
              schema: {}
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --request POST \
              --url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/sql-users \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"name":"example_username","password":"example_password"}'
components:
  schemas:
    SQLUser:
      type: object
      properties:
        name:
          type: string
      required:
        - name
    Status:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/Any'
    Any:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties: {}
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````