# Start a process

Reports that a new copy of your application started on a device. Seatify registers the process and starts its lease.

`POST /v1/processes/spawn`

## Before the spawn

- The device must claim the license first. A spawn from a device without a binding fails with `not_claimed`. See [Claim a license](../../licenses/claim/).
- The policy must track processes. The answer to the claim shows this in `process_heartbeat.tracked`.
- The license must be valid. A spawn on a suspended license fails. A spawn on an expired license fails only if the policy uses Expire.

## Limit

- The process limit counts the processes of this device whose lease has not ended. Other devices of the license do not count.
- A spawn with a new process ID when the device is at the limit fails with `process_limit_reached`. The refused spawn does not change the running processes.
- A spawn with a process ID that is already running returns the same process. It does not take another slot. It starts the lease again.
- A process whose lease has ended holds no slot. A spawn with its process ID checks the limit again.
- Without a process limit, every spawn succeeds, and Seatify only counts the processes.

See [Limit](../../../concepts/concurrent-runs/#limit).

## Effects

- Seatify registers the process on the device binding and starts its lease. The lease lasts for the process interval plus the process grace.
- A spawn does not start the device lease again. Send [license heartbeats](../../licenses/heartbeat/) for that.
- A spawn does not activate the license. Only a claim does that. See [Activation](../../../concepts/licenses/#activation).
- Seatify records each spawn in the activity of the license, a refused one too. See [Activity](../../../concepts/activity/).

## Authentication

Send the publishable key of the product. See [Authentication](../../authentication/).

## Request

| Header | Required | Description |
| --- | --- | --- |
| `Seatify-Publishable-Key` | Yes | The publishable key of the product. |
| `Content-Type` | Yes | Always `application/json`. |
| `Seatify-Nonce` | No | A new random value that the signature includes. See [Signed responses](../../#signed-responses). |
| `Seatify-Signing-Key` | No | The key ID of the signing key in your application. See [Signed responses](../../#signed-responses). |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | string | Yes | The license key. |
| `device` | object | Yes | The device that the process runs on. |
| `process` | object | Yes | The process. |

The `device` object has these fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `fingerprint` | string | Yes | The fingerprint that the device sent in its claim. The fingerprint is case-sensitive. See [Devices](../../../concepts/seats-and-devices/#devices). |
| `hostname` | string | No | The name of the device. A spawn does not store the name. So your application can send the same `device` object as in the claim. |

The `process` object has these fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `pid` | string | Yes | The process ID. It identifies the copy on the device. The process ID from the operating system works. Send it as a string, such as `"4242"`. The process ID is case-sensitive. See [Process properties](../../../concepts/concurrent-runs/#process-properties). |

A `device` object or a `process` object with no values counts as missing.

## Response

The answer is a [license check object](../../licenses/#license-check-object).

If the spawn succeeds, `process` holds the process. `process.expires_at` is the end of its lease. See [Process object](../#process-object).

`limits.max_processes` is the limit that applies to this device. The `entitlements` array is always empty in the answer to a spawn. Take the entitlements from the answer to the claim or the validation.

## Reasons

A refused spawn answers with the status 200 and a reason. It registers no process.

| Reason | Description |
| --- | --- |
| `license_not_found` | No license has this key. Ask the user to check the key. |
| `product_mismatch` | The license belongs to another product. Ask the user to check the key. |
| `suspended` | The license is suspended. Tell the user. |
| `expired` | The license has expired. Tell the user. |
| `process_tracking_not_enabled` | The policy has no process interval. Stop reporting processes. |
| `not_claimed` | The device has no binding on this license, or its heartbeat lease has ended. Claim the license again, and then spawn again. |
| `process_limit_reached` | All process slots of the device are taken. Tell the user to close another copy. See [When the limit is reached](../../../guides/licensing/limit-concurrent-runs/#when-the-limit-is-reached). |

See [Refused answers](../#refused-answers).

## Errors

| Status | Reason | Description |
| --- | --- | --- |
| 400 | `The request body could not be read.` | The body is not valid JSON, or the process ID is not a string. |
| 400 | `The submitted details are not valid.` | A field is not valid. The `errors` field names it. See the table below. |
| 400 | `The signing key is not known.` | Your organization has no signing key with the ID in `Seatify-Signing-Key`. |
| 400 | `The nonce must be at most 255 characters.` | The value of `Seatify-Nonce` is too long. |
| 401 | `A publishable key is required.` | The request has no `Seatify-Publishable-Key` header, or the header is empty. |
| 401 | `The publishable key is not valid.` | No product has this key. |
| 429 | `There are too many requests. Try again later.` | See [Rate limits](../../#rate-limits). |

These fields can be in `errors`:

| Field | Description |
| --- | --- |
| `key` | The license key is missing or too long. |
| `device` | The request has no device. |
| `device.fingerprint` | The `device` object has no fingerprint, or the fingerprint is too long. |
| `device.hostname` | The hostname is too long. |
| `process` | The request has no process. |
| `process.pid` | The process ID is too long. |

See [Errors](../../#errors).

## Example

{{< tabs >}}
{{< tab name="curl" >}}
```bash
curl https://license.seatify.dev/v1/processes/spawn \
  -H "Seatify-Publishable-Key: $SEATIFY_PUBLISHABLE_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "key": "$LICENSE_KEY",
  "device": { "fingerprint": "$DEVICE_FINGERPRINT" },
  "process": { "pid": "$PROCESS_ID" }
}
EOF
```
{{< /tab >}}
{{< tab name="Swift" >}}
```swift
import Foundation

struct LicenseCheck: Decodable {
    let valid: Bool
    let status: String?
    let reason: String?
}

let processID = String(ProcessInfo.processInfo.processIdentifier)

let body: [String: Any] = [
    "key": licenseKey,
    "device": ["fingerprint": fingerprint],
    "process": ["pid": processID],
]

var request = URLRequest(url: URL(string: "https://license.seatify.dev/v1/processes/spawn")!)
request.httpMethod = "POST"
request.setValue(publishableKey, forHTTPHeaderField: "Seatify-Publishable-Key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try JSONSerialization.data(withJSONObject: body)

let (data, _) = try await URLSession.shared.data(for: request)
let check = try JSONDecoder().decode(LicenseCheck.self, from: data)
```
{{< /tab >}}
{{< tab name="C#" >}}
```csharp
using System.Net.Http.Json;

using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Seatify-Publishable-Key", publishableKey);

var processId = Environment.ProcessId.ToString();

var response = await client.PostAsJsonAsync("https://license.seatify.dev/v1/processes/spawn", new
{
    key = licenseKey,
    device = new { fingerprint },
    process = new { pid = processId },
});
var check = await response.Content.ReadFromJsonAsync<LicenseCheck>();

record LicenseCheck(bool Valid, string? Status, string? Reason);
```
{{< /tab >}}
{{< tab name="Go" >}}
```go
processID := strconv.Itoa(os.Getpid())

body, err := json.Marshal(map[string]any{
	"key":     licenseKey,
	"device":  map[string]string{"fingerprint": fingerprint},
	"process": map[string]string{"pid": processID},
})
if err != nil {
	return err
}

req, err := http.NewRequest("POST", "https://license.seatify.dev/v1/processes/spawn", bytes.NewReader(body))
if err != nil {
	return err
}
req.Header.Set("Seatify-Publishable-Key", publishableKey)
req.Header.Set("Content-Type", "application/json")

res, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer res.Body.Close()

var check struct {
	Valid  bool    `json:"valid"`
	Status *string `json:"status"`
	Reason *string `json:"reason"`
}
err = json.NewDecoder(res.Body).Decode(&check)
```
{{< /tab >}}
{{< tab name="JavaScript" >}}
```javascript
const processId = String(process.pid);

const response = await fetch("https://license.seatify.dev/v1/processes/spawn", {
  method: "POST",
  headers: {
    "Seatify-Publishable-Key": publishableKey,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    key: licenseKey,
    device: { fingerprint },
    process: { pid: processId },
  }),
});
const check = await response.json();
```
{{< /tab >}}
{{< /tabs >}}

```json
{
  "valid": true,
  "status": "active",
  "expired": false,
  "reason": null,
  "license": {
    "id": "<license id>",
    "name": "CIRRUS Team Floating Devices #0007",
    "expires_at": "2026-12-20T00:00:00Z",
    "activated_at": "2026-01-22T01:50:56Z"
  },
  "entitlements": [],
  "limits": {
    "max_devices": 50,
    "max_seats": 25,
    "max_processes": 4
  },
  "device": {
    "id": "<device binding id>",
    "expires_at": "2026-09-26T14:50:43Z"
  },
  "heartbeat": {
    "required": true,
    "interval_seconds": 3600,
    "grace_seconds": 1800
  },
  "process": {
    "id": "<process id>",
    "pid": "4242",
    "expires_at": "2026-09-26T13:27:43Z"
  },
  "process_heartbeat": {
    "tracked": true,
    "interval_seconds": 300,
    "grace_seconds": 120
  }
}
```

