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

# Create Service Account

> Creates a service account for the specified organization.

<Note>
  The response includes the `client_id` and `client_secret`, which are used to authenticate subsequent API calls.
</Note>

<Warning>
  Store the `client_secret` in a secure location. It is only shown once at creation time.
</Warning>


## OpenAPI

````yaml POST /api/v1/organizations/{org_id}/service-accounts
openapi: 3.1.0
info:
  title: Organization Management API
  version: 1.0.0
servers:
  - url: https://anaconda.com
    description: Anaconda Cloud
security: []
paths:
  /api/v1/organizations/{org_id}/service-accounts:
    post:
      tags:
        - organizations
      summary: Create Service Account
      description: Creates a service account for the specified organization.
      operationId: create_service_account
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
          description: >-
            Your organization ID, found in your organization's URL:
            `anaconda.com/app/organizations/<ORG_ID>/`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrganizationServiceAccountRequest'
      responses:
        '200':
          description: Service account created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationServiceAccountWithSecret'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Organization Admin: []
components:
  schemas:
    CreateOrganizationServiceAccountRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 64
          description: >-
            The name for the new service account. Must use lowercase letters,
            numbers, hyphens, or underscores only.
    OrganizationServiceAccountWithSecret:
      type: object
      required:
        - name
        - client_id
        - org_id
        - client_secret
      properties:
        name:
          type: string
          description: The name of the service account.
        client_id:
          type: string
          description: The unique client identifier for the service account.
        org_id:
          type: string
          description: The organization ID the service account belongs to.
        client_secret:
          type: string
          description: >-
            The client secret for authenticating as this service account. This
            value is only shown once at creation time.
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          description: A list of validation errors.
          items:
            $ref: '#/components/schemas/ValidationError'
    ValidationError:
      type: object
      required:
        - loc
        - msg
        - type
      properties:
        loc:
          type: array
          items:
            type: string
          description: >-
            The location of the validation error (for example, `["body",
            "name"]`).
        msg:
          type: string
          description: A human-readable validation error message.
        type:
          type: string
          description: The type of validation error.
  securitySchemes:
    Organization Admin:
      bearerFormat: JWT
      description: >-
        Bearer token obtained by authenticating with your organization admin's
        email and password (`grant_type=password`).


        See the [Getting
        started](/anaconda-platform/admin/org-management-api/org-management-api)
        page for the full authentication flow.
      scheme: bearer
      type: http

````