## `GET /sop/:name/schema`

**Get process schema** — Returns the full YAML-parsed definition of a process. Useful for inspecting inputs, outputs, and steps before starting an instance. Defaults to the latest published version.

> **Auth:** Requires `X-SOP-Token` header. See [Authentication](/api-docs/guides/authentication.md).

### Path parameters

- `name` (string, required) — The process name as defined in the YAML `process.name` field.

### Query parameters

- `version` (string, optional) — Semver version string. Omit to get the latest published version.

### Response

`200 application/json` — Full process definition object.

```json
{
  "name":        "customer-onboarding",
  "version":     "1.0",
  "description": "Onboard a new business customer",
  "inputs":      [...],
  "steps":       [...]
}
```

### Errors

| Status | Code | Meaning |
|--------|------|---------|
| 404 | `not_found` | No process with that name (or version) exists. |

### Code examples

#### curl

```bash
curl https://api.opensop.dev/sop/customer-onboarding/schema \
  -H "X-SOP-Token: $OPENSOP_TOKEN"
```

#### Node

```js
const res = await fetch(
  "https://api.opensop.dev/sop/customer-onboarding/schema",
  { headers: { "X-SOP-Token": process.env.OPENSOP_TOKEN } }
);
```

#### Python

```python
resp = requests.get(
  "https://api.opensop.dev/sop/customer-onboarding/schema",
  headers={"X-SOP-Token": os.environ["OPENSOP_TOKEN"]}
)
```

#### Ruby

```ruby
Net::HTTP.start("api.opensop.dev", use_ssl: true) do |h|
  req = Net::HTTP::Get.new("/sop/customer-onboarding/schema")
  req["X-SOP-Token"] = ENV["OPENSOP_TOKEN"]
  puts h.request(req).body
end
```

