> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cail.health/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cail.health/_mcp/server.

# Get a pathway execution envelope

GET https://staging.cail.health/v1/pathway-executions/{id}

Returns the lifecycle envelope for a pathway execution. The envelope carries identity, pinned pathway version, channel, status, start and end timestamps, and the outcome code when completed. Use this endpoint to recover state after a client restart or to verify that a completion has been recorded. Node state is fetched separately via the current-node endpoint. Returns a 404 when the execution does not exist or is not scoped to the caller.

Reference: https://docs.cail.health/api-references/api-reference/navigate-to-care/get-envelope

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: cail-api
  version: 1.0.0
paths:
  /v1/pathway-executions/{id}:
    get:
      operationId: get-envelope
      summary: Get a pathway execution envelope
      description: >-
        Returns the lifecycle envelope for a pathway execution. The envelope
        carries identity, pinned pathway version, channel, status, start and end
        timestamps, and the outcome code when completed. Use this endpoint to
        recover state after a client restart or to verify that a completion has
        been recorded. Node state is fetched separately via the current-node
        endpoint. Returns a 404 when the execution does not exist or is not
        scoped to the caller.
      tags:
        - subpackage_navigateToCare
      parameters:
        - name: id
          in: path
          description: Stable identifier of the pathway execution.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The execution envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathwayExecutionEnvelope'
servers:
  - url: https://staging.cail.health
    description: https://staging.cail.health
components:
  schemas:
    PathwayExecutionEnvelopeChannel:
      type: string
      enum:
        - mobile
        - web
        - voice
        - call-centre
      description: >-
        Channel the execution is being driven through. Recorded for analytics;
        engine behaviour is identical across channels.
      title: PathwayExecutionEnvelopeChannel
    PathwayExecutionEnvelopeStatus:
      type: string
      enum:
        - in-progress
        - completed
        - abandoned
      description: >-
        Lifecycle state. One-shot transitions: in-progress to completed, or
        in-progress to abandoned.
      title: PathwayExecutionEnvelopeStatus
    PathwayExecutionEnvelope:
      type: object
      properties:
        id:
          type: string
          description: Stable identifier for the pathway execution.
        planDefinitionId:
          type: string
          description: >-
            Stable identifier of the pathway definition this execution is pinned
            to.
        planDefinitionVersionId:
          type: number
          format: double
          description: >-
            Pathway version pinned at start. All subsequent endpoint validation
            runs against this version. A mid-execution republish is invisible to
            in-flight executions.
        channel:
          $ref: '#/components/schemas/PathwayExecutionEnvelopeChannel'
          description: >-
            Channel the execution is being driven through. Recorded for
            analytics; engine behaviour is identical across channels.
        status:
          $ref: '#/components/schemas/PathwayExecutionEnvelopeStatus'
          description: >-
            Lifecycle state. One-shot transitions: in-progress to completed, or
            in-progress to abandoned.
        startedAt:
          type: string
          description: ISO 8601 timestamp at which the execution started.
        endedAt:
          type: string
          description: >-
            ISO 8601 timestamp at which the execution ended. Present when status
            is not `in-progress`.
        outcomeCode:
          type: string
          description: >-
            Outcome code for a completed execution. Mirrors the value recorded
            on the encounter row. Absent on `in-progress` and `abandoned`
            executions.
      required:
        - id
        - planDefinitionId
        - planDefinitionVersionId
        - channel
        - status
        - startedAt
      title: PathwayExecutionEnvelope
  securitySchemes:
    firebaseBearer:
      type: http
      scheme: bearer

```

## Examples

### A mobile execution still in progress



**Response**

```json
{
  "id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "planDefinitionId": "a1b2c3d4-e5f6-4789-9abc-def012345678",
  "planDefinitionVersionId": 42,
  "channel": "mobile",
  "status": "in-progress",
  "startedAt": "2026-05-13T14:21:00.000Z"
}
```

**SDK Code**

```python A mobile execution still in progress
import requests

url = "https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript A mobile execution still in progress
const url = 'https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go A mobile execution still in progress
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby A mobile execution still in progress
require 'uri'
require 'net/http'

url = URI("https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java A mobile execution still in progress
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php A mobile execution still in progress
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp A mobile execution still in progress
using RestSharp;

var client = new RestClient("https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift A mobile execution still in progress
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### A completed execution with a pharmacy outcome



**Response**

```json
{
  "id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "planDefinitionId": "a1b2c3d4-e5f6-4789-9abc-def012345678",
  "planDefinitionVersionId": 42,
  "channel": "mobile",
  "status": "completed",
  "startedAt": "2026-05-13T14:21:00.000Z",
  "endedAt": "2026-05-13T14:23:11.000Z",
  "outcomeCode": "pharmacy"
}
```

**SDK Code**

```python A completed execution with a pharmacy outcome
import requests

url = "https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript A completed execution with a pharmacy outcome
const url = 'https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go A completed execution with a pharmacy outcome
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby A completed execution with a pharmacy outcome
require 'uri'
require 'net/http'

url = URI("https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java A completed execution with a pharmacy outcome
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php A completed execution with a pharmacy outcome
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp A completed execution with a pharmacy outcome
using RestSharp;

var client = new RestClient("https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift A completed execution with a pharmacy outcome
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```