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

# Join Sub-Organization

> Adds the authenticated parent org admin as a member of the specified sub-organization with the given role.



## OpenAPI

````yaml https://api.useinvent.com/openapi.json post /orgs/{org_id}/orgs/{sub_org_id}/join
openapi: 3.1.0
info:
  version: 1.0.0
  title: Invent API
servers:
  - url: https://api.useinvent.com
security:
  - bearerAuth: []
paths:
  /orgs/{org_id}/orgs/{sub_org_id}/join:
    post:
      tags:
        - Orgs Orgs
      summary: Join Sub-Organization
      description: >-
        Adds the authenticated parent org admin as a member of the specified
        sub-organization with the given role.
      parameters:
        - schema:
            type: string
          required: true
          description: The ID of the parent organization
          name: org_id
          in: path
        - schema:
            type: string
          required: true
          description: The ID of the sub-organization
          name: sub_org_id
          in: path
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JoinSubOrgSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/JoinSubOrgSchema'
      responses:
        '200':
          description: The sub-organization after the user has been added as a member.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubOrgSchema'
components:
  schemas:
    JoinSubOrgSchema:
      type: object
      properties:
        role:
          allOf:
            - $ref: '#/components/schemas/OrgMemberRoleSchema'
            - description: Role to assign when joining the sub-organization
      required:
        - role
      description: Schema for joining a sub-organization with a chosen role
    SubOrgSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the sub-organization
        name:
          type: string
          description: Name of the sub-organization
        logo_url:
          type:
            - string
            - 'null'
          description: URL of the sub-organization logo
        plan:
          $ref: '#/components/schemas/OrgSubscriptionPlanSchema'
        balance:
          type: number
          description: Current credit balance
        promo_balance:
          type: number
          description: Current promotional credit balance
        billing:
          $ref: '#/components/schemas/BillingConfigSchema'
        members:
          type: array
          items:
            $ref: '#/components/schemas/OrgMemberSchema'
          description: Members of the sub-organization
        features:
          $ref: '#/components/schemas/OrgFeaturesConfigSchema'
        config:
          $ref: '#/components/schemas/OrgConfigSchema'
        spending_cap_used:
          type: number
          description: Amount spent in the current month
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the sub-organization was created
      required:
        - id
        - name
        - logo_url
        - plan
        - balance
        - promo_balance
        - billing
        - members
        - spending_cap_used
        - created_at
      description: Summary information about a sub-organization
    OrgMemberRoleSchema:
      type: string
      enum:
        - ADMIN
        - DEVELOPER
        - MANAGER
        - STAFF
      description: Role of the org member within the org
    OrgSubscriptionPlanSchema:
      type: string
      enum:
        - free
        - business
      description: Type of subscription plan
    BillingConfigSchema:
      type: object
      properties:
        auto_recharge:
          type: object
          properties:
            enabled:
              type: boolean
              description: Flag to enable/disable auto reload
            recharge_threshold:
              type: number
              minimum: 5
              maximum: 500
              description: Threshold to auto reload credits at
            recharge_amount:
              type: number
              minimum: 5
              maximum: 500
              description: Amount to auto reload credits by
          required:
            - enabled
            - recharge_threshold
            - recharge_amount
        use_parent_balance:
          type: boolean
          description: Use the parent balance when it's a sub-org
        spending_cap:
          $ref: '#/components/schemas/SpendingCapConfigSchema'
        payment_method:
          $ref: '#/components/schemas/PaymentMethodSchema'
        last_low_balance_notification_at:
          type:
            - string
            - 'null'
          format: date-time
        last_out_of_balance_notification_at:
          type:
            - string
            - 'null'
          format: date-time
        last_spending_cap_notification_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - auto_recharge
      description: Schema for updating payment configuration
    OrgMemberSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the org member
        name:
          type:
            - string
            - 'null'
          description: Name of the org member
        email:
          type: string
          format: email
          description: Email address of the org member
        avatar:
          type:
            - string
            - 'null'
          description: Avatar URL of the org member
        role:
          $ref: '#/components/schemas/OrgMemberRoleSchema'
        status:
          $ref: '#/components/schemas/OrgMemberStatusSchema'
        org_id:
          type: string
          description: Identifier of the org to which the member belongs
        user_id:
          type: string
          description: Identifier of the user associated with the org member
        preferences:
          $ref: '#/components/schemas/OrgMemberPreferencesSchema'
        roles:
          type: array
          items:
            $ref: '#/components/schemas/CustomRoleSchema'
          description: Custom roles assigned to the member
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the org member was created
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the org member was last updated
        seen_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the user was last seen
      required:
        - id
        - name
        - email
        - avatar
        - role
        - status
        - org_id
        - user_id
        - preferences
        - roles
        - created_at
        - updated_at
        - seen_at
      description: Detailed information about an org member
    OrgFeaturesConfigSchema:
      type: object
      properties:
        enterprise:
          type: boolean
        allow_overdraft:
          type: boolean
        workflows:
          type: boolean
        enable_japifon:
          type: boolean
        slack_access:
          type: boolean
        emails:
          type: boolean
        templates:
          type: boolean
        org_chats:
          type: boolean
      description: Org gate-keeping features configuration
    OrgConfigSchema:
      type: object
      properties:
        email:
          type: string
          maxLength: 128
          format: email
          description: Organization contact email
        address:
          type: string
          maxLength: 128
          description: Physical address
        terms_url:
          type: string
          maxLength: 1024
          format: uri
          description: Terms of service URL
        privacy_url:
          type: string
          maxLength: 1024
          format: uri
          description: Privacy policy URL
        access:
          $ref: '#/components/schemas/OrgAccessConfigSchema'
        modules:
          $ref: '#/components/schemas/OrgModulesConfigSchema'
      description: Organization configuration settings
    SpendingCapConfigSchema:
      type: object
      properties:
        enabled:
          type: boolean
          description: Flag to enable/disable the monthly spending cap
        amount:
          type: number
          minimum: 0
          maximum: 100000
          description: Monthly spending limit in USD
        reset_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp of last accumulator reset
      required:
        - enabled
        - amount
      description: Schema for spending cap configuration
    PaymentMethodSchema:
      type: object
      properties:
        type:
          type: string
        payment_method_id:
          type: string
        brand:
          type: string
        last4:
          type: string
        inactive:
          type: boolean
        failed_at:
          type: string
          format: date-time
        failed_message:
          type: string
      required:
        - type
        - payment_method_id
      description: Schema for a payment method
    OrgMemberStatusSchema:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
      description: Status of the org member
    OrgMemberPreferencesSchema:
      type: object
      properties:
        notifications:
          $ref: '#/components/schemas/OrgMemberNotificationsSchema'
        canned_responses:
          type: array
          items:
            $ref: '#/components/schemas/OrgMemberCannedResponseSchema'
          maxItems: 20
          description: Saved reply snippets for the assist composer
      required:
        - notifications
      description: Preferences of the org member
    CustomRoleSchema:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        color:
          $ref: '#/components/schemas/ColorNameSchema'
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/OrgPermissionSchema'
      required:
        - id
        - name
        - description
        - color
        - permissions
      description: A user-created org role and its permissions
    OrgAccessConfigSchema:
      type: object
      properties:
        session_ttl_seconds:
          anyOf:
            - type: number
              enum:
                - 0
            - type: integer
              minimum: 60
              maximum: 315360000
          description: >-
            Session lifetime in seconds for SSO logins. Use 0 to disable
            expiration (session never expires). Any non-zero value must be at
            least 60 seconds. Defaults to 0 (disabled).
        allow_google:
          type: boolean
          description: >-
            Whether Google sign-in is allowed for users whose email matches an
            SSO domain on this org (verified, with or without IdP). Defaults to
            true when unset.
        allow_microsoft:
          type: boolean
          description: >-
            Whether Microsoft sign-in is allowed for users whose email matches
            an SSO domain on this org (verified, with or without IdP). Defaults
            to true when unset.
        allow_email_code:
          type: boolean
          description: >-
            Whether email code sign-in is allowed for users whose email matches
            an SSO domain on this org (verified, with or without IdP). Defaults
            to true when unset.
        allow_invites:
          type: boolean
          description: >-
            Whether org admins can manually invite new members. Org-wide toggle,
            does not require a verified domain. Defaults to true when unset.
      description: >-
        Org-wide access policy. Governs how users authenticate and join the org.
        Only applies when at least one verified SSO is enabled.
    OrgModulesConfigSchema:
      type: object
      properties:
        enable_inbox:
          type: boolean
        enable_analytics:
          type: boolean
        enable_assistants:
          type: boolean
        enable_knowledge_base:
          type: boolean
        enable_broadcasts:
          type: boolean
        enable_workflows:
          type: boolean
        enable_audience:
          type: boolean
        enable_tables:
          type: boolean
        enable_pages:
          type: boolean
        enable_balance_credits:
          type: boolean
      description: >-
        Per-module visibility toggles. Honored on sub-orgs only; ignored on
        parent orgs. Missing keys default to enabled on the client.
    OrgMemberNotificationsSchema:
      type: object
      properties:
        assigned_to_me:
          $ref: '#/components/schemas/OrgMemberNotificationSchema'
        billing:
          $ref: '#/components/schemas/OrgMemberNotificationSchema'
      required:
        - assigned_to_me
        - billing
      description: Notifications of the org member
    OrgMemberCannedResponseSchema:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          maxLength: 128
        text:
          type: string
          minLength: 1
          maxLength: 1000
      required:
        - id
        - text
      description: A saved reply snippet the member can insert into the composer
    ColorNameSchema:
      type: string
      enum:
        - red
        - orange
        - amber
        - yellow
        - lime
        - green
        - teal
        - cyan
        - sky
        - blue
        - indigo
        - violet
        - purple
        - fuchsia
        - pink
        - rose
        - neutral
      description: The name of the color to use in the UI
    OrgPermissionSchema:
      type: string
      enum:
        - org:write
        - admin:write
        - members:read
        - members:invite
        - members:write
        - members.roles.system:write
        - inbox:read
        - inbox:write
        - analytics:read
        - contacts:read
        - contacts:write
        - segments:write
        - broadcasts:read
        - broadcasts:write
        - assistants:read
        - assistants:write
        - assistants.agents:write
        - knowledge:read
        - knowledge:write
        - skills:read
        - skills:write
        - workflows:write
        - connections:write
        - keys:write
        - tables:read
        - tables:write
        - tables.records:write
        - pages:read
        - pages:write
        - audit_logs:read
        - sso:write
        - domains:write
        - emails:write
        - billing:write
        - variables:write
        - templates:write
        - orgs:write
      description: An org permission (`resource:action`).
    OrgMemberNotificationSchema:
      type: object
      properties:
        enabled:
          type: boolean
        notified_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - enabled
      description: Notification of the org member
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Bearer token authentication using your API key

````