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

# Create baseline

> **Preview.** Available to teams with the `baselines_api` feature flag.

Create a baseline in the team. A baseline can target all servers, a custom set (when the
plan is not yet known), or one or more specific platforms. When it targets platforms, the
disk layout is validated by the same rules a deploy applies — against the smallest of the
selected platforms — so a baseline that saves here can be dispatched verbatim.




## OpenAPI

````yaml https://spec.speakeasy.com/latitude/latitude/latitude-sh-api-with-code-samples post /baselines
openapi: 3.0.1
info:
  title: Latitude.sh API
  version: '2023-06-01'
  description: >-
    The Latitude.sh API is a RESTful API to manage your Latitude.sh account. It
    allows you to perform the same actions as the Latitude.sh dashboard.
servers:
  - url: https://api.latitude.sh
    variables:
      latitude_api_key:
        default: <insert your api key here>
  - url: http://api.latitude.sh
    variables:
      latitude_api_key:
        default: <insert your api key here>
security: []
tags:
  - name: API keys
  - name: Baselines (Preview)
    description: >-
      Preview. Available to teams with the `baselines_api` feature flag. The
      shape of these endpoints may change before general availability.
  - name: Billing
  - name: Elastic Ips
  - name: Events
  - name: Firewalls
  - name: IP Addresses
  - name: Kubernetes Clusters
  - name: Operating Systems
  - name: Plans
  - name: Prefixes
  - name: Private Networks
  - name: Projects
  - name: Regions
  - name: Roles
  - name: SSH Keys
  - name: Servers
  - name: Block Storage
  - name: Filesystem Storage
  - name: Object Storage
  - name: Tags
  - name: Teams
  - name: Team members
  - name: Traffic
  - name: User data
  - name: User profile
  - name: VPN Sessions
  - name: Virtual machines
  - name: Virtual machine backups
  - name: Virtual machine restores
paths:
  /baselines:
    post:
      tags:
        - Baselines (Preview)
      summary: Create baseline
      description: >
        **Preview.** Available to teams with the `baselines_api` feature flag.


        Create a baseline in the team. A baseline can target all servers, a
        custom set (when the

        plan is not yet known), or one or more specific platforms. When it
        targets platforms, the

        disk layout is validated by the same rules a deploy applies — against
        the smallest of the

        selected platforms — so a baseline that saves here can be dispatched
        verbatim.
      operationId: create-baseline
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - baselines
                    attributes:
                      type: object
                      properties:
                        name:
                          type: string
                          description: Name of the baseline
                        description:
                          type: string
                          nullable: true
                          description: Description of the baseline
                        target_type:
                          type: string
                          enum:
                            - all_servers
                            - custom
                            - platforms
                          description: >-
                            Baseline target: all servers, a custom set (plan
                            unknown), or specific platforms
                        operating_system:
                          type: string
                          description: >-
                            Slug of the operating system the baseline expects
                            the server to run (required)
                        platforms:
                          type: array
                          items:
                            type: string
                          description: >-
                            Slugs of the plans this baseline applies to.
                            Required when target_type is "platforms"
                        ssh_key_ids:
                          type: array
                          items:
                            type: string
                          description: SSH keys the baseline expects on the server
                        user_data_id:
                          type: string
                          nullable: true
                          description: User data the baseline expects to run on first boot
                        disk_layout:
                          type: array
                          description: Expected disk layout
                          items:
                            $ref: '#/components/schemas/baseline_disk_layout_group'
                        bios:
                          type: object
                          description: Expected BIOS settings, keyed by setting id
                      required:
                        - name
                        - target_type
                        - operating_system
            examples:
              Created:
                summary: Created
                value:
                  data:
                    type: baselines
                    attributes:
                      name: web-fleet-v3
                      description: Standard build for the public web tier
                      target_type: platforms
                      operating_system: ubuntu_22_04_x64_lts
                      platforms:
                        - g3-l40s-small-76
                      ssh_key_ids:
                        - ssh_RLYV8DZ2D5QoE
                      user_data_id: ud_r0MK4O4kDa95w
                      disk_layout:
                        - role: os
                          count: 2
                          raid_level: raid-1
                        - role: storage
                          count: 2
                          filesystem: ext4
                          mount_point: /data
                      bios:
                        smt: true
                        cstates: false
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - baselines
                    attributes:
                      type: object
                      properties:
                        name:
                          type: string
                          description: Name of the baseline
                        description:
                          type: string
                          nullable: true
                          description: Description of the baseline
                        target_type:
                          type: string
                          enum:
                            - all_servers
                            - custom
                            - platforms
                          description: >-
                            Baseline target: all servers, a custom set (plan
                            unknown), or specific platforms
                        operating_system:
                          type: string
                          description: >-
                            Slug of the operating system the baseline expects
                            the server to run (required)
                        platforms:
                          type: array
                          items:
                            type: string
                          description: >-
                            Slugs of the plans this baseline applies to.
                            Required when target_type is "platforms"
                        ssh_key_ids:
                          type: array
                          items:
                            type: string
                          description: SSH keys the baseline expects on the server
                        user_data_id:
                          type: string
                          nullable: true
                          description: User data the baseline expects to run on first boot
                        disk_layout:
                          type: array
                          description: Expected disk layout
                          items:
                            $ref: '#/components/schemas/baseline_disk_layout_group'
                        bios:
                          type: object
                          description: Expected BIOS settings, keyed by setting id
                      required:
                        - name
                        - target_type
                        - operating_system
            examples:
              Created:
                summary: Created
                value:
                  data:
                    type: baselines
                    attributes:
                      name: web-fleet-v3
                      description: Standard build for the public web tier
                      target_type: platforms
                      operating_system: ubuntu_22_04_x64_lts
                      platforms:
                        - g3-l40s-small-76
                      ssh_key_ids:
                        - ssh_RLYV8DZ2D5QoE
                      user_data_id: ud_r0MK4O4kDa95w
                      disk_layout:
                        - role: os
                          count: 2
                          raid_level: raid-1
                        - role: storage
                          count: 2
                          filesystem: ext4
                          mount_point: /data
                      bios:
                        smt: true
                        cstates: false
        required: true
      responses:
        '201':
          description: Created
          content:
            application/vnd.api+json:
              examples:
                Created:
                  value:
                    data:
                      id: bl_VaNmodjeObE8W
                      type: baselines
                      attributes:
                        name: web-fleet-v3
                        description: Standard build for the public web tier
                        target_type: platforms
                        operating_system: ubuntu_22_04_x64_lts
                        platforms:
                          - id: plan_1R3zq24bOWxyn
                            slug: g3-l40s-small-76
                            name: g3.l40s.small-76
                        ssh_keys:
                          - id: ssh_RLYV8DZ2D5QoE
                            name: lindgren.example
                            fingerprint: 45:de:3e:19:41:1d:0e:8d:c8:22:70:34:db:5f:67:4b
                        user_data:
                          id: ud_r0MK4O4kDa95w
                          description: >-
                            Two buttermilk waffles, topped with whipped cream
                            and maple syrup, a side of two eggs served any
                            style, and your choice of smoked bacon or smoked
                            ham.
                        disk_layout:
                          - count: 2
                            role: os
                            raid_level: raid-1
                          - count: 2
                            role: storage
                            filesystem: ext4
                            mount_point: /data
                        bios:
                          smt: true
                          cstates: false
                        created_at: '2026-07-30T16:21:19.430Z'
              schema:
                $ref: '#/components/schemas/baseline'
      security:
        - Bearer: []
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Latitudesh } from "latitudesh-typescript-sdk";

            const latitudesh = new Latitudesh({
              bearer: process.env["LATITUDESH_BEARER"] ?? "",
            });

            async function run() {
              const result = await latitudesh.baselinesPreview.createBaseline({
                data: {
                  type: "baselines",
                  attributes: {
                    name: "web-fleet-v3",
                    description: "Standard build for the public web tier",
                    targetType: "platforms",
                    operatingSystem: "ubuntu_22_04_x64_lts",
                    platforms: [
                      "g3-l40s-small-76",
                    ],
                    sshKeyIds: [
                      "ssh_RLYV8DZ2D5QoE",
                    ],
                    userDataId: "ud_r0MK4O4kDa95w",
                    diskLayout: [
                      {
                        role: "os",
                        count: 2,
                        raidLevel: "raid-1",
                      },
                      {
                        role: "storage",
                        count: 2,
                        filesystem: "ext4",
                        mountPoint: "/data",
                      },
                    ],
                    bios: {},
                  },
                },
              });

              console.log(result);
            }

            run();
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tlatitudeshgosdk \"github.com/latitudesh/latitudesh-go-sdk\"\n\t\"github.com/latitudesh/latitudesh-go-sdk/models/operations\"\n\t\"github.com/latitudesh/latitudesh-go-sdk/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := latitudeshgosdk.New(\n        latitudeshgosdk.WithSecurity(os.Getenv(\"LATITUDESH_BEARER\")),\n    )\n\n    res, err := s.BaselinesPreview.CreateBaseline(ctx, operations.CreateBaselineBaselinesPreviewRequestBody{\n        Data: &operations.CreateBaselineData{\n            Type: operations.CreateBaselineTypeBaselines.ToPointer(),\n            Attributes: &operations.CreateBaselineAttributes{\n                Name: \"web-fleet-v3\",\n                Description: latitudeshgosdk.Pointer(\"Standard build for the public web tier\"),\n                TargetType: operations.CreateBaselineTargetTypePlatforms,\n                OperatingSystem: \"ubuntu_22_04_x64_lts\",\n                Platforms: []string{\n                    \"g3-l40s-small-76\",\n                },\n                SSHKeyIds: []string{\n                    \"ssh_RLYV8DZ2D5QoE\",\n                },\n                UserDataID: latitudeshgosdk.Pointer(\"ud_r0MK4O4kDa95w\"),\n                DiskLayout: []components.BaselineDiskLayoutGroup{\n                    components.BaselineDiskLayoutGroup{\n                        Role: components.BaselineDiskLayoutGroupRoleOs.ToPointer(),\n                        Count: latitudeshgosdk.Pointer[int64](2),\n                        RaidLevel: components.RaidLevelRaid1.ToPointer(),\n                    },\n                    components.BaselineDiskLayoutGroup{\n                        Role: components.BaselineDiskLayoutGroupRoleStorage.ToPointer(),\n                        Count: latitudeshgosdk.Pointer[int64](2),\n                        Filesystem: components.FilesystemExt4.ToPointer(),\n                        MountPoint: latitudeshgosdk.Pointer(\"/data\"),\n                    },\n                },\n                Bios: &operations.CreateBaselineBios{},\n            },\n        },\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Baseline != nil {\n        // handle response\n    }\n}"
components:
  schemas:
    baseline_disk_layout_group:
      type: object
      properties:
        role:
          type: string
          enum:
            - os
            - storage
            - raw
          description: Purpose of the disk group
        count:
          type: integer
          description: Number of disks in the group
        raid_level:
          type: string
          nullable: true
          enum:
            - raid-0
            - raid-1
          description: >-
            RAID level for the group. Only valid for the 'os' and 'storage'
            roles
        filesystem:
          type: string
          nullable: true
          enum:
            - ext4
          description: >-
            Filesystem to format the group with. Only valid for the 'storage'
            role
        mount_point:
          type: string
          nullable: true
          description: Where the group is mounted. Required for the 'storage' role
    baseline:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/baseline_data'
        meta:
          type: object
    baseline_data:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - baselines
        attributes:
          type: object
          properties:
            name:
              type: string
              description: Name of the baseline
            description:
              type: string
              nullable: true
              description: Description of the baseline
            target_type:
              type: string
              enum:
                - all_servers
                - custom
                - platforms
              description: >-
                Target of the baseline: all servers, a custom set (plan
                unknown), or specific platforms
            operating_system:
              type: string
              nullable: true
              description: >-
                Slug of the operating system the baseline expects the server to
                run
            platforms:
              type: array
              description: >-
                The plans this baseline applies to (only populated when
                target_type is "platforms")
              items:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  slug:
                    type: string
            ssh_keys:
              type: array
              description: SSH keys the baseline expects on the server
              items:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  fingerprint:
                    type: string
            user_data:
              type: object
              nullable: true
              description: User data the baseline expects to run on first boot
              properties:
                id:
                  type: string
                description:
                  type: string
                  nullable: true
            disk_layout:
              type: array
              description: Expected disk layout
              items:
                $ref: '#/components/schemas/baseline_disk_layout_group'
            bios:
              type: object
              description: Expected BIOS settings, keyed by setting id
            created_at:
              type: string
              nullable: true
              description: Date the baseline was created
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header

````