# Get an SOP

> One SOP and the version the lab works from right now, with its steps — what a bench station shows the person at the hood.

Source: https://docs.xplantpro.com/docs/api/sops/get-sop

`GET https://app.xplantpro.com/api/v1/sops/{id}`

- Required scope: `read:sops`
- Credentials: workspace API key (`xpk_`)
- Idempotency-Key: ignored on this endpoint

Only the version in force is returned, never a draft or a version waiting to take effect. When the SOP has no version in force, `version` is null: the procedure exists, but there is nothing approved to follow yet, and it cannot be run.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | Yes | The record's id. |

## Example

**curl**

```bash
curl https://app.xplantpro.com/api/v1/sops/9d2c4b6a-8e1f-4a3b-b5c7-d9e1f3a5b7c9 \
  -H "Authorization: Bearer $XPLANT_API_KEY"
```

**JavaScript**

```js
import { XPlantClient } from "@shmaplex/xplant-sdk";

const client = new XPlantClient({ apiKey: process.env.XPLANT_API_KEY });

const sop = await client.sops.get("9d2c4b6a-8e1f-4a3b-b5c7-d9e1f3a5b7c9");
if (!sop.version) {
  // No version is in force yet, so there are no steps to run.
}
```

**Python**

```python
import os
import requests

resp = requests.get(
    "https://app.xplantpro.com/api/v1/sops/9d2c4b6a-8e1f-4a3b-b5c7-d9e1f3a5b7c9",
    headers={"Authorization": f"Bearer {os.environ['XPLANT_API_KEY']}"},
    timeout=10,
)
body = resp.json()
if not body["ok"]:
    raise RuntimeError(f"{resp.status_code} {body['code']}: {body['error']}")
sop = body["data"]
```

## Response

`200` with `{ "ok": true, "data": … }`. `data` holds the result.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | Yes | — |
| `title` | string | Yes | — |
| `description` | string \| null | Yes | — |
| `category` | string \| null | Yes | The kind of procedure, such as `media-prep`, `sterilization` or `tissue-culture`. |
| `status` | string \| null | Yes | `draft`, `active` or `archived`. |
| `level` | string \| null | Yes | Who it is written for: `beginner`, `intermediate`, `advanced` or `expert`. |
| `tags` | string[] | Yes | — |
| `equipment` | string[] | Yes | Equipment the procedure calls for. |
| `estimatedTimeMinutes` | number \| null | Yes | How long one run is expected to take, in minutes. |
| `durationHours` | number \| null | Yes | The procedure's duration in hours, as the lab recorded it. |
| `currentVersion` | integer | Yes | The newest version number. It can be a draft; the version the lab works from is the one Get an SOP returns. |
| `updatedAt` | string \| null | Yes | — |
| `createdAt` | string \| null | Yes | — |
| `version` | object \| null | Yes | The version in force — the one the lab works from — with its steps. Null when no version has been put into force, and then there are no steps to follow: a draft is never returned. |

```json title="Response"
{
  "ok": true,
  "data": {
    "id": "2e4f6a8c-0b1d-4e3f-9a5b-7c9d1e3f5a7b",
    "title": "Phalaenopsis flower-stalk node initiation",
    "description": "Surface-sterilise nodes from a healthy flower stalk and place them onto initiation medium.",
    "category": "tissue-culture",
    "status": "active",
    "level": "intermediate",
    "tags": [
      "initiation",
      "orchid"
    ],
    "equipment": [
      "laminar flow hood",
      "autoclave"
    ],
    "estimatedTimeMinutes": 45,
    "durationHours": null,
    "currentVersion": 3,
    "updatedAt": "2026-09-18T11:04:52.000Z",
    "createdAt": "2026-06-02T08:30:00.000Z",
    "version": {
      "version": 2,
      "lifecycleStatus": "effective",
      "effectiveAt": "2026-08-12T00:00:00+00:00",
      "approvedAt": "2026-08-11T16:20:00+00:00",
      "steps": [
        {
          "id": "step-1",
          "instruction": "Wipe the hood down and let it run for 15 minutes before starting.",
          "estimatedMinutes": 15
        },
        {
          "id": "step-2",
          "instruction": "Cut single nodes from the flower stalk, leaving a short section either side.",
          "notes": "Discard any node with a split or browned bract."
        },
        {
          "id": "step-3",
          "instruction": "Place each node onto initiation medium and label the vessel."
        }
      ],
      "title": "Phalaenopsis flower-stalk node initiation",
      "description": "Surface-sterilise nodes from a healthy flower stalk and place them onto initiation medium."
    }
  }
}
```

| Response header | Meaning |
| --- | --- |
| `X-Request-Id` | Identifies this request. Include it when you contact support. |

## Errors

| Status | Code | When |
| --- | --- | --- |
| `401` | `UNAUTHORIZED` | The key is missing, malformed or revoked, or its owner is no longer a member of the workspace. |
| `402` | `PAID_PLAN_REQUIRED` | The workspace's plan does not include the API. The full API is included with xPlant+ Teams and Enterprise; on Hobby and Pro Lab, keys can connect devices only. |
| `403` | `FORBIDDEN` | The key lacks a scope this operation requires, or its owner's current role in the workspace cannot use it — a key never does more than its owner can in xPlant. `error` names the scope, and for a role, the role it needs. |
| `403` | `DEVICE_TOKEN_NOT_ACCEPTED` | A device token was sent; this operation needs a workspace API key. |
| `404` | `NOT_FOUND` | No SOP with this id exists in the key's workspace, or `id` is not a well-formed id. |
| `429` | `RATE_LIMIT_EXCEEDED` | Too many requests for this key, device token or workspace. Wait `Retry-After` seconds. |
| `500` | `SOP_QUERY_FAILED` | The SOP could not be read. Retry later. |

Branch on `code`, never on the `error` text. See [Errors](https://docs.xplantpro.com/docs/errors.md).
