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

# Create App

> Create an app with the specified details in the request body.




## OpenAPI

````yaml /api/machines/openapi.json post /v1/apps
openapi: 3.1.0
info:
  title: Machines API
  description: >-
    This site hosts documentation generated from the Fly.io Machines API OpenAPI
    specification. Visit our complete [Machines API
    docs](https://fly.io/docs/machines/api/) for how to get started, more
    information about each endpoint, parameter descriptions, and examples.
  contact: {}
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: https://api.machines.dev
security:
  - FlyBearerAuth: []
tags:
  - name: Apps
    description: >-
      This site hosts documentation generated from the Fly.io Machines API
      OpenAPI specification. Visit our complete [Machines API
      docs](https://fly.io/docs/machines/api/apps-resource/) for details about
      using the Apps resource.
  - name: Machines
    description: >-
      This site hosts documentation generated from the Fly.io Machines API
      OpenAPI specification. Visit our complete [Machines API
      docs](https://fly.io/docs/machines/api/machines-resource/) for details
      about using the Machines resource.
  - name: TLS Certificates
    description: >
      This site hosts documentation generated from the Fly.io Machines API
      OpenAPI specification. Visit our complete [Machines API
      docs](https://fly.io/docs/machines/api/certificates-resource/) for details
      about using the TLS Certificates resource.
  - name: Volumes
    description: >-
      This site hosts documentation generated from the Fly.io Machines API
      OpenAPI specification. Visit our complete [Machines API
      docs](https://fly.io/docs/machines/api/volumes-resource/) for details
      about using the Volumes resource.
  - name: Postgres Clusters
    description: >-
      Create and manage Postgres clusters, including databases, users,
      extensions, backups, and app attachments.
externalDocs:
  url: https://fly.io/docs/machines/working-with-machines/
paths:
  /v1/apps:
    post:
      tags:
        - Apps
      summary: Create App
      description: |
        Create an app with the specified details in the request body.
      operationId: Apps_create
      requestBody:
        description: App body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAppRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAppResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Rejected by validation. status is name_taken when the app name is
            already in use.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateAppRequest:
      type: object
      properties:
        enable_subdomains:
          type: boolean
          description: >-
            Request a wildcard TLS certificate for *.svc.<app-name>.fly.dev.
            Defaults to false. Certificate provisioning is asynchronous; this
            does not create services or configure their routing.
        idempotency_key:
          type: string
          description: >-
            When set, makes a retry of this exact request safe: a

            second create with the same key and the same name (or no name)
            returns

            the app the first request created, instead of erroring on a false
            name

            conflict or creating a duplicate. A second create with the same key

            but a *different* name is rejected outright; it won't silently

            hand back the first app.
        name:
          type: string
          description: Globally unique name for the app. Required.
        network:
          type: string
          description: >-
            Name of the organization's private network to attach the app to.
            Creates the network if it does not exist. Omit, use an empty string,
            or use "default" to select the organization's default network.
        org_slug:
          type: string
          description: >-
            Slug of the organization that will own the app, or "personal" for
            your personal organization. Required.
    CreateAppResponse:
      type: object
      properties:
        created_at:
          type: integer
          description: When the app was created, in Unix milliseconds.
        id:
          type: string
          description: >-
            Name of the new app. Despite the field's name, this is not the app's
            `id` as returned by

            Get App.
    ErrorResponse:
      type: object
      properties:
        details:
          type: object
          description: 'Deprecated: details about some errors. Do not rely on its contents.'
        error:
          type: string
          description: >-
            Human-readable description of the error. Its wording may change; use
            `status` to tell

            errors apart.
        status:
          type: object
          description: >-
            Machine-readable error code, set for some errors, such as
            `insufficient_capacity`,

            `volume_placement_capacity`, `name_taken`, `exec_request_too_large`,
            or

            `exec_output_too_large`.
          allOf:
            - $ref: '#/components/schemas/main.statusCode'
    main.statusCode:
      type: string
      enum:
        - unknown
        - insufficient_capacity
        - volume_placement_capacity
        - exec_request_too_large
        - exec_output_too_large
        - name_taken
      x-enum-varnames:
        - unknown
        - capacityErr
        - volumePlacementCapacityErr
        - execRequestTooLargeErr
        - execOutputTooLargeErr
        - nameTakenErr
  securitySchemes:
    FlyBearerAuth:
      type: http
      scheme: bearer
      description: >-
        A Fly API token with access to the requested organization or resource.
        Send it as `Authorization: Bearer <Fly API token>`.

````