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

# Create a sub-account

> Creates a sub-account under the authenticated master account. Returns the sub-account with its generated `api_key`.



## OpenAPI

````yaml https://wavix.github.io/wavix-openapi/wavix-api.yaml post /v1/sub-organizations
openapi: 3.1.0
info:
  title: Wavix APIs
  description: >-
    Wavix provides robust APIs that let you integrate voice and text messaging
    features directly into your app. Send text, place calls, and access detailed
    reports  programmatically.
  termsOfService: https://wavix.com/terms-and-conditions
  license:
    name: MIT
    identifier: MIT
  contact:
    name: Wavix
    url: https://wavix.com
    email: support@wavix.com
  version: '1.0'
servers:
  - url: https://api.wavix.com
    description: https://api.wavix.com
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: SIP trunks
    description: SIP trunks
  - name: Buy
    description: Numbers
  - name: Cart
    description: Numbers
  - name: My numbers
    description: Numbers
  - name: Billing
    description: Billing, transactions, and invoices
  - name: Profile
    description: Account profile and customer information
  - name: CDRs
    description: Call detail records and call history
  - name: Speech Analytics
    description: Call transcription and speech analytics
  - name: SMS and MMS
    description: Messaging
  - name: Number Validator
    description: Phone number validation
  - name: Link shortener
    description: Short link and click metrics
  - name: 2FA
    description: Two-factor authentication
  - name: 10DLC
    description: 10DLC Campaigns and Brands
  - name: API Keys
    description: API key management
  - name: Call webhooks
    description: Webhook configuration for call events
  - name: Call control
    description: Programmable Voice
  - name: Call streaming
    description: Real-time call audio streaming over WebSocket
  - name: Call recording
    description: Call recording
  - name: Sub-accounts
    description: Sub-account management
  - name: Voice campaigns
    description: Outbound voice campaigns
  - name: Wavix Embeddable
    description: WebRTC embeddable widget
paths:
  /v1/sub-organizations:
    post:
      tags:
        - Sub-accounts
      summary: Create a sub-account
      description: >-
        Creates a sub-account under the authenticated master account. Returns
        the sub-account with its generated `api_key`.
      operationId: sub_accounts_create
      parameters: []
      requestBody:
        description: Attributes for the new sub-account.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubAccountsCreateRequest'
            example:
              name: Company
              default_destinations:
                sms_endpoint: https://examples.com/sms
                dlr_endpoint: https://examples.com/dlr
        required: true
      responses:
        '200':
          description: Returns the created sub-account.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubOrganizationResponse'
              examples:
                success:
                  summary: Successful response
                  value:
                    id: 123
                    created_at: '2023-06-15T10:30:00Z'
                    name: My sub-account
                    api_key: abc123def456
                    master_organization: 456
                    status: enabled
                    default_destinations:
                      sms_endpoint: https://examples.com/sms
                      dlr_endpoint: https://examples.com/dlr
        '400':
          description: Returns when a required parameter is missing or invalid.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
              examples:
                success:
                  summary: Successful response
                  value:
                    success: false
                    message: Missing or invalid parameter <param_name>
        '403':
          $ref: '#/components/responses/ForbiddenErrorResponse'
        '422':
          $ref: '#/components/responses/ValidationErrorResponse'
      deprecated: false
      security:
        - bearerAuth:
            - subaccounts:write
components:
  schemas:
    SubAccountsCreateRequest:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          description: Sub-account name.
          maxLength: 255
          example: Company name
        default_destinations:
          type: object
          additionalProperties: false
          description: Default webhook URLs for inbound messages and delivery reports.
          properties:
            sms_endpoint:
              type: string
              format: uri
              description: Inbound messages webhook URL.
              example: https://examples.com/sms
            dlr_endpoint:
              type: string
              format: uri
              description: Delivery report webhook URL.
              example: https://examples.com/dlr
    SubOrganizationResponse:
      title: SubOrganizationResponse
      required:
        - id
        - created_at
        - name
        - api_key
        - master_organization
        - status
        - default_destinations
      type: object
      description: Sub-account details including API key and webhook configurations.
      additionalProperties: false
      properties:
        id:
          type: integer
          format: int32
          description: Sub-account ID.
          example: 123
        created_at:
          type: string
          format: date-time
          description: Date and time the sub-account was created in ISO 8601 format.
          example: '2023-06-15T10:30:00Z'
        name:
          type: string
          description: Sub-account name.
          example: My sub-account
        api_key:
          type: string
          description: Sub-account API key.
          example: abc123def456
        master_organization:
          type: integer
          format: int32
          description: Master account ID.
          example: 456
        status:
          type: string
          description: >-
            Status of the subaccount. One of `enabled` (the subaccount is active
            and can be used) or `disabled` (the subaccount is suspended).
          enum:
            - enabled
            - disabled
          example: enabled
        default_destinations:
          type: object
          additionalProperties: false
          description: Default webhook URLs for inbound messages and delivery reports.
          required:
            - sms_endpoint
            - dlr_endpoint
          properties:
            sms_endpoint:
              type: string
              format: uri
              description: Inbound messages webhook URL.
              example: https://examples.com/sms
            dlr_endpoint:
              type: string
              format: uri
              description: Delivery report webhook URL.
              example: https://examples.com/dlr
      example:
        id: 123
        created_at: '2023-06-15T10:30:00Z'
        name: My sub-account
        api_key: abc123def456
        master_organization: 456
        status: enabled
        default_destinations:
          sms_endpoint: https://examples.com/sms
          dlr_endpoint: https://examples.com/dlr
    ValidationErrorResponse:
      title: ValidationErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: >-
            Human-readable description naming the missing or invalid request
            parameter.
          example: Missing or invalid parameter <param_name>
    ForbiddenErrorResponse:
      title: ForbiddenErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: Human-readable description of why access is forbidden.
          example: The service is not provisioned for your account.
  responses:
    ForbiddenErrorResponse:
      description: Request failed. The feature is disabled for your account.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenErrorResponse'
    ValidationErrorResponse:
      description: Validation error
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Wavix API key. Pass as `Authorization: Bearer <api_key>`. Keys support
        per-resource scopes (none / read / write). See [Restricted keys and
        scopes](https://docs.wavix.com/api-reference/authentication#restricted-keys-and-scopes).

````