> ## Documentation Index
> Fetch the complete documentation index at: https://docs.posttu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish workflow

> Promote draft workflow configuration to an active immutable version.

Publishes the current draft state of a workflow as a new immutable version. Workflows require a published version before they can be activated for production live triggers.

### Path Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | **Yes** | Unique identifier of the workflow (`wkf_...`). |

### Request Body

| Field | Type | Required | Description |
| - | - | - | - |
| `note` | `string` | No | Optional changelog or release note (max 500 characters). |

### cURL Example

```bash theme={null}
curl -X POST "https://posttu.com/api/v1/workflow/wkf_abc123/publish" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "note": "Initial production release" }'
```

### Response Example

```json theme={null}
{
  "data": {
    "workflow": {
      "id": "wkf_abc123",
      "name": "Social Auto-Poster",
      "isActive": true,
      "publishedVersionId": "ver_pub_789xyz"
    },
    "version": {
      "id": "ver_pub_789xyz",
      "version": 1,
      "note": "Initial production release",
      "createdAt": "2026-10-23T20:00:00.000Z"
    }
  },
  "success": true
}
```


## OpenAPI

````yaml openapi.json POST /api/v1/workflow/{id}/publish
openapi: 3.1.0
info:
  title: Posttu API
  version: 1.0.0
  description: >-
    Posttu V1 REST API — Workflow automation, social-media post management,
    inbox, tags, and calendar.
servers:
  - url: https://posttu.com
    description: Production
security: []
paths:
  /api/v1/workflow/{id}/publish:
    post:
      tags:
        - Workflow
      summary: Publish a workflow draft
      description: Promote the workflow draft to an active immutable release version.
      parameters:
        - schema:
            type: string
            description: Workflow ID
            example: wkf_123abc
          required: true
          description: Workflow ID
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                note:
                  type: string
                  maxLength: 500
                  description: Publish release note
      responses:
        '200':
          description: Published workflow details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublishWorkflowResponse'
        '400':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '401':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '404':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PublishWorkflowResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            workflow:
              type: object
              properties:
                id:
                  type: string
                name:
                  type: string
                isActive:
                  type: boolean
                publishedVersionId:
                  type:
                    - string
                    - 'null'
              required:
                - id
                - name
                - isActive
            version:
              type: object
              properties:
                id:
                  type: string
                version:
                  type: number
                note:
                  type:
                    - string
                    - 'null'
                createdAt:
                  type: string
              required:
                - id
                - version
                - createdAt
          required:
            - workflow
            - version
        success:
          type: boolean
          default: true
      required:
        - data
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: 'Pass your API key via the Authorization header: `Bearer <api-key>`'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.