---
raw: true
search:
  tags:
    - Builds
    - POST
seo:
  description: >-
    Creates a build that produces a version on success through the… Reference
    for the POST /v1/spaces/{spaceId}/builds endpoint in the Spacefast Partner
    API.
sidebar:
  label: Create a build from a source archive, repository, or managed source
  badge: POST
title: Create a build from a source archive, repository, or managed source
type: openapi-operation
---
Creates a build that produces a version on success through the normal publish path. Repository inputs use the saved connection; source archive inputs receive an upload instruction the new build owns. Naming a managed `source` instead builds it from its connected production repository with the saved settings and live target. The caller cannot select source code, commands, settings, refs, or publish targets, and must send an `Idempotency-Key` header: a managed-source trigger without one fails with 422 `idempotency_key_required`.

`POST /v1/spaces/{spaceId}/builds`

**Request body** (`application/json`, required)

A caller-described build, or a build triggered from a managed source.

Request body example:

```json
{
  "source": "wordpress",
  "sourceUrl": "http://example.com"
}
```

**Responses**

- `200` — Response for status 200
- `201` — Response for status 201
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 200:

```json
{
  "$schema": "http://example.com",
  "data": {
    "build": {
      "capture": {
        "state": "string",
        "previewSummary": {
          "property1": null,
          "property2": null
        },
        "progress": {
          "property1": null,
          "property2": null
        },
        "archiveHash": "string"
      },
      "id": "string",
      "spaceId": "string",
      "status": "waiting_for_source",
      "input": {
        "kind": "url",
        "sourceUrl": "http://example.com"
      },
      "source": null,
      "settingsSnapshot": {
        "rootDirectory": null,
        "installDirectory": null,
        "installCommand": null,
        "buildCommand": null,
        "outputDirectory": null,
        "ignoredBuildCommand": null,
        "frameworkPreset": null,
        "platformPreset": null,
        "allowUnsupportedPlatformFeatures": false,
        "timeoutSeconds": 900
      },
      "target": {
        "channel": null,
        "preview": false
      },
      "retryOfBuildId": null,
      "producedVersionId": "string",
      "reusedVersionId": null,
      "diagnostics": [],
      "createdAt": "2019-08-24T14:15:22Z",
      "startedAt": "2019-08-24T14:15:22Z",
      "finishedAt": "2019-08-24T14:15:22Z"
    },
    "upload": null
  }
}
```
