> 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.

# Acknowledge a completed pathway execution

POST https://staging.cail.health/v1/pathway-executions/{id}/complete
Content-Type: application/json

Optional telemetry acknowledgement that the client has displayed the terminal. The engine has already transitioned the execution to `completed` on the prior `submitAnswer` response that returned a terminal node; this endpoint exists for symmetry with the legacy navigation-session lifecycle and to record an optional `selectedProviderId` for analytics. Returns the lifecycle envelope reflecting the completed state.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: cail-api
  version: 1.0.0
paths:
  /v1/pathway-executions/{id}/complete:
    post:
      operationId: complete
      summary: Acknowledge a completed pathway execution
      description: >-
        Optional telemetry acknowledgement that the client has displayed the
        terminal. The engine has already transitioned the execution to
        `completed` on the prior `submitAnswer` response that returned a
        terminal node; this endpoint exists for symmetry with the legacy
        navigation-session lifecycle and to record an optional
        `selectedProviderId` for analytics. Returns the lifecycle envelope
        reflecting the completed state.
      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 envelope after completion.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathwayExecutionEnvelopeResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompletePathwayExecutionRequest'
servers:
  - url: https://staging.cail.health
    description: https://staging.cail.health
components:
  schemas:
    CompletePathwayExecutionRequest:
      type: object
      properties:
        selectedProviderId:
          type: string
          description: >-
            Stable identifier of a provider the member selected from the
            follow-up routing results. Analytics-only.
      title: CompletePathwayExecutionRequest
    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
    PathwayExecutionEnvelopeResponse:
      type: object
      properties:
        envelope:
          $ref: '#/components/schemas/PathwayExecutionEnvelope'
          description: Lifecycle envelope reflecting the updated execution.
      required:
        - envelope
      title: PathwayExecutionEnvelopeResponse
  securitySchemes:
    firebaseBearer:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "envelope": {
    "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 Execution acknowledged with a selected provider
import requests

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

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Execution acknowledged with a selected provider
const url = 'https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f/complete';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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

```go Execution acknowledged with a selected provider
package main

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

func main() {

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

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby Execution acknowledged with a selected provider
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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

```java Execution acknowledged with a selected provider
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f/complete")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php Execution acknowledged with a selected provider
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f/complete', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Execution acknowledged with a selected provider
using RestSharp;

var client = new RestClient("https://staging.cail.health/v1/pathway-executions/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f/complete");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Execution acknowledged with a selected provider
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

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

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()
```