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

# Create a partner organization

> Requires the organizations:create scope (or an administrator token) and the CreateOrganizations entitlement. Creates an Auth0 organization and emails the recipient an invitation to join it as admin. Parenting records attribution and grants no access.

Each call creates a new organization, including retries after a partial failure. An optional API offer is recorded at signup and the trial starts on the first code connection. Retired or repriced offers fall back to the standard trial at activation.

## Prerequisites

The creating organization needs the `CreateOrganizations` entitlement. The API token needs `organizations:create` or `admin` scope. API token management also requires `GitarAPI` access. See [Creating an API Token](/api-reference/overview#creating-an-api-token).

## Signup offers

Use the offer code supplied for the partner integration, or omit `offer_code` for the standard trial. The trial starts when the new organization connects its first code host. Public signup offer codes are not accepted by this endpoint.

## Repeated requests

Each successful request creates a separate organization, even when the email already belongs to a user. Retrying after a timeout or partial failure can create another organization.

The recipient receives an email invitation to join the new organization as an administrator. The invitation expires after 30 days. The parent relationship records who created it and grants no access to the creating partner.


## OpenAPI

````yaml post /external/organizations
openapi: 3.1.0
info:
  title: Gitar External API
  description: API for managing your Gitar installation and integrations
  contact:
    name: Gitar
    url: https://gitar.ai
    email: noreply@gitar.ai
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://api.gitar.ai/v1
security: []
paths:
  /external/organizations:
    post:
      tags:
        - Organizations
      summary: Create a partner organization
      description: >-
        Requires the organizations:create scope (or an administrator token) and
        the CreateOrganizations entitlement. Creates an Auth0 organization and
        emails the recipient an invitation to join it as admin. Parenting
        records attribution and grants no access.


        Each call creates a new organization, including retries after a partial
        failure. An optional API offer is recorded at signup and the trial
        starts on the first code connection. Retired or repriced offers fall
        back to the standard trial at activation.
      operationId: createOrganization
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrganizationRequest'
        required: true
      responses:
        '201':
          description: Organization created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrganizationResponse'
        '400':
          description: Invalid email or unrecognized API offer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseFailure'
        '401':
          description: Invalid or missing bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseFailure'
        '403':
          description: Missing scope or entitlement, or inactive parent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseFailure'
        '404':
          description: Parent organization not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseFailure'
        '500':
          description: Provisioning failed, possibly after partial creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseFailure'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateOrganizationRequest:
      type: object
      required:
        - email
      properties:
        email:
          type: string
        offer_code:
          type:
            - string
            - 'null'
          description: Partner API offer code. Omit for the standard trial.
    CreateOrganizationResponse:
      type: object
      required:
        - organization_id
        - organization_name
        - organization_slug
        - parent_organization_id
      properties:
        organization_id:
          type: string
        organization_name:
          type: string
        organization_slug:
          type: string
        parent_organization_id:
          type: string
    ResponseFailure:
      type: object
      required:
        - message
      properties:
        error_code:
          type:
            - string
            - 'null'
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.