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

# Create Service

> Create a new service for an app.



## OpenAPI

````yaml https://api.getfloo.com/openapi.json post /v1/apps/{app_id}/services
openapi: 3.1.0
info:
  title: floo API
  version: 0.1.0
servers:
  - url: https://api.getfloo.com
security: []
paths:
  /v1/apps/{app_id}/services:
    post:
      tags:
        - services
      summary: Create Service
      description: Create a new service for an app.
      operationId: services_create_service
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: App Id
        - $ref: '#/components/parameters/X-Floo-Org-Id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateServiceRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  parameters:
    X-Floo-Org-Id:
      name: X-Floo-Org-Id
      in: header
      required: false
      schema:
        type: string
        format: uuid
      description: Organization to act in; defaults to the one joined most recently.
  schemas:
    CreateServiceRequest:
      properties:
        name:
          type: string
          maxLength: 63
          minLength: 2
          pattern: ^[a-z][a-z0-9-]*[a-z0-9]$
          title: Name
        type:
          $ref: '#/components/schemas/ServiceType'
      type: object
      required:
        - name
        - type
      title: CreateServiceRequest
      description: Request body for creating a new service.
    ServiceResponse:
      properties:
        declared:
          anyOf:
            - type: boolean
            - type: string
              const: unknown
          title: Declared
          default: unknown
        applied:
          anyOf:
            - type: boolean
            - type: string
              const: unknown
          title: Applied
          default: unknown
        id:
          type: string
          format: uuid
          title: Id
        app_id:
          type: string
          format: uuid
          title: App Id
        name:
          type: string
          title: Name
        type:
          $ref: '#/components/schemas/ServiceType'
        port:
          anyOf:
            - type: integer
            - type: 'null'
          title: Port
        ingress:
          $ref: '#/components/schemas/IngressMode'
        cloud_run_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Cloud Run Url
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        cloud_run_service_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Cloud Run Service Name
        image_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Uri
        status:
          $ref: '#/components/schemas/ServiceStatus'
        cpu:
          anyOf:
            - type: string
            - type: 'null'
          title: Cpu
        memory:
          anyOf:
            - type: string
            - type: 'null'
          title: Memory
        max_instances:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Instances
        min_instances:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Instances
        instances:
          anyOf:
            - type: integer
            - type: 'null'
          title: Instances
        max_request_body_mb:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Request Body Mb
        runtime_plan:
          anyOf:
            - $ref: '#/components/schemas/RuntimePlanResponse'
            - type: 'null'
        cache_hit:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Cache Hit
        base_image:
          anyOf:
            - type: string
            - type: 'null'
          title: Base Image
        base_image_floo:
          type: boolean
          title: Base Image Floo
          default: false
        repo_full_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Repo Full Name
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - app_id
        - name
        - type
        - port
        - ingress
        - cloud_run_url
        - image_uri
        - status
        - created_at
        - updated_at
      title: ServiceResponse
      description: Response for a single service.
    ErrorResponse:
      properties:
        detail:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Body of every error response except request validation (422).
    ServiceType:
      type: string
      enum:
        - web
        - api
        - worker
        - cron
        - database
        - cache
        - storage
      title: ServiceType
      description: Type of service within an app.
    IngressMode:
      type: string
      enum:
        - public
        - internal
      title: IngressMode
      description: Whether the service accepts public traffic.
    ServiceStatus:
      type: string
      enum:
        - pending
        - deploying
        - running
        - failed
        - stopped
      title: ServiceStatus
      description: Lifecycle status of a service.
    RuntimePlanResponse:
      properties:
        env:
          anyOf:
            - type: string
            - type: 'null'
          title: Env
        service_type:
          $ref: '#/components/schemas/ServiceType'
        availability:
          $ref: '#/components/schemas/AvailabilityMode'
        declared:
          $ref: '#/components/schemas/RuntimeValuesResponse'
        effective:
          $ref: '#/components/schemas/RuntimeValuesResponse'
        sources:
          $ref: '#/components/schemas/RuntimeSourcesResponse'
        components:
          items:
            $ref: '#/components/schemas/RuntimeComponentResponse'
          type: array
          title: Components
        instance_total:
          $ref: '#/components/schemas/RuntimeInstanceTotal'
        cpu_allocation:
          $ref: '#/components/schemas/CpuAllocationMode'
        cpu_allocation_reason:
          type: string
          title: Cpu Allocation Reason
        warnings:
          items:
            type: string
          type: array
          title: Warnings
      type: object
      required:
        - env
        - service_type
        - availability
        - declared
        - effective
        - sources
        - components
        - instance_total
        - cpu_allocation
        - cpu_allocation_reason
        - warnings
      title: RuntimePlanResponse
      description: Server-resolved scaling and CPU contract for one environment.
    ErrorDetail:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
      additionalProperties: true
      type: object
      required:
        - code
        - message
      title: ErrorDetail
      description: Standard error envelope with operation-specific JSON context.
    AvailabilityMode:
      type: string
      enum:
        - on_demand
        - warm
        - fixed
        - paused
      title: AvailabilityMode
      description: >-
        Describe whether runtime capacity is demand-driven, warm, fixed, or
        paused.
    RuntimeValuesResponse:
      properties:
        cpu:
          anyOf:
            - type: string
            - type: 'null'
          title: Cpu
        memory:
          anyOf:
            - type: string
            - type: 'null'
          title: Memory
        min_instances:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Instances
        max_instances:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Instances
        instances:
          anyOf:
            - type: integer
            - type: 'null'
          title: Instances
      type: object
      required:
        - cpu
        - memory
        - min_instances
        - max_instances
        - instances
      title: RuntimeValuesResponse
      description: Expose nullable CPU, memory, and instance scaling values for a service.
    RuntimeSourcesResponse:
      properties:
        cpu:
          anyOf:
            - $ref: '#/components/schemas/ResolutionSource'
            - type: 'null'
        memory:
          anyOf:
            - $ref: '#/components/schemas/ResolutionSource'
            - type: 'null'
        min_instances:
          anyOf:
            - $ref: '#/components/schemas/ResolutionSource'
            - type: 'null'
        max_instances:
          anyOf:
            - $ref: '#/components/schemas/ResolutionSource'
            - type: 'null'
        instances:
          anyOf:
            - $ref: '#/components/schemas/ResolutionSource'
            - type: 'null'
      type: object
      required:
        - cpu
        - memory
        - min_instances
        - max_instances
        - instances
      title: RuntimeSourcesResponse
      description: Identify the resolution source of each service runtime setting.
    RuntimeComponentResponse:
      properties:
        name:
          type: string
          title: Name
        cpu:
          type: string
          title: Cpu
        memory:
          type: string
          title: Memory
        source:
          type: string
          title: Source
      type: object
      required:
        - name
        - cpu
        - memory
        - source
      title: RuntimeComponentResponse
      description: Describe one runtime component's resource allocation and origin.
    RuntimeInstanceTotal:
      properties:
        cpu:
          type: string
          title: Cpu
        memory:
          type: string
          title: Memory
      type: object
      required:
        - cpu
        - memory
      title: RuntimeInstanceTotal
      description: Expose total CPU and memory allocated to one runtime instance.
    CpuAllocationMode:
      type: string
      enum:
        - request_based
        - always_allocated
      title: CpuAllocationMode
      description: Distinguish request-bound CPU from CPU allocated between requests.
    ResolutionSource:
      type: string
      enum:
        - configured
        - platform_default
        - plan_limit
        - platform_limit
        - resource_compatibility
        - max_instances_limit
      title: ResolutionSource
      description: >-
        Identify the configuration, policy, or compatibility constraint that
        resolved a value.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A `floo_` API key.

````

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