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

# Publish a pathway draft

POST https://staging.cail.health/v1/plan-definitions/{id}/publish

Promotes a draft pathway to `active`. New navigation sessions started after publication are pinned to this version; existing sessions remain on the version they were started against. Once published, the row cannot be re-edited. Returns the new active version metadata.

Reference: https://docs.cail.health/api-references/api-reference/understand-coverage/publish

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: cail-api
  version: 1.0.0
paths:
  /v1/plan-definitions/{id}/publish:
    post:
      operationId: publish
      summary: Publish a pathway draft
      description: >-
        Promotes a draft pathway to `active`. New navigation sessions started
        after publication are pinned to this version; existing sessions remain
        on the version they were started against. Once published, the row cannot
        be re-edited. Returns the new active version metadata.
      tags:
        - subpackage_understandCoverage
      parameters:
        - name: id
          in: path
          description: Stable identifier of the draft pathway to publish.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The active pathway acknowledgement.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublishPlanDefinitionResponse'
servers:
  - url: https://staging.cail.health
    description: https://staging.cail.health
components:
  schemas:
    PublishedPlanDefinitionStatus:
      type: string
      enum:
        - draft
        - active
        - retired
      description: Lifecycle status after publication.
      title: PublishedPlanDefinitionStatus
    PublishedPlanDefinition:
      type: object
      properties:
        id:
          type: string
          description: Stable identifier of the published pathway.
        versionId:
          type: number
          format: double
          description: New version number assigned at publication.
        status:
          $ref: '#/components/schemas/PublishedPlanDefinitionStatus'
          description: Lifecycle status after publication.
        publishedAt:
          type: string
          description: ISO 8601 timestamp at which the pathway was published.
      required:
        - id
        - versionId
        - status
        - publishedAt
      title: PublishedPlanDefinition
    PublishPlanDefinitionResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/PublishedPlanDefinition'
        message:
          type: string
          description: Human-readable acknowledgement.
      required:
        - data
        - message
      title: PublishPlanDefinitionResponse
  securitySchemes:
    auth0Bearer:
      type: http
      scheme: bearer

```

## Examples



**Response**

```json
{
  "data": {
    "id": "a1b2c3d4-e5f6-4789-9abc-def012345678",
    "versionId": 9,
    "status": "active",
    "publishedAt": "2026-05-13T14:23:00.000Z"
  },
  "message": "Pathway published successfully"
}
```

**SDK Code**

```python Draft published as active
import requests

url = "https://staging.cail.health/v1/plan-definitions/a1b2c3d4-e5f6-4789-9abc-def012345678/publish"

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

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

print(response.json())
```

```javascript Draft published as active
const url = 'https://staging.cail.health/v1/plan-definitions/a1b2c3d4-e5f6-4789-9abc-def012345678/publish';
const options = {method: 'POST', 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 Draft published as active
package main

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

func main() {

	url := "https://staging.cail.health/v1/plan-definitions/a1b2c3d4-e5f6-4789-9abc-def012345678/publish"

	req, _ := http.NewRequest("POST", 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 Draft published as active
require 'uri'
require 'net/http'

url = URI("https://staging.cail.health/v1/plan-definitions/a1b2c3d4-e5f6-4789-9abc-def012345678/publish")

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

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

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

```java Draft published as active
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://staging.cail.health/v1/plan-definitions/a1b2c3d4-e5f6-4789-9abc-def012345678/publish")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Draft published as active
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://staging.cail.health/v1/plan-definitions/a1b2c3d4-e5f6-4789-9abc-def012345678/publish', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Draft published as active
using RestSharp;

var client = new RestClient("https://staging.cail.health/v1/plan-definitions/a1b2c3d4-e5f6-4789-9abc-def012345678/publish");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Draft published as active
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://staging.cail.health/v1/plan-definitions/a1b2c3d4-e5f6-4789-9abc-def012345678/publish")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```