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

# Create a workflow

> Creates a future-content cross-post workflow from one source account to one or more target accounts. Use `settings.content_filters` to limit which future posts are eligible.



## OpenAPI

````yaml /openapi/public-api.yaml post /v1/workflows
openapi: 3.1.0
info:
  title: PostOnce Public API
  version: 1.0.0-alpha
  description: Public API for PostOnce paid users
servers:
  - url: https://postonce.to/api/public
security:
  - bearerAuth: []
paths:
  /v1/workflows:
    post:
      summary: Create a workflow
      description: >-
        Creates a future-content cross-post workflow from one source account to
        one or more target accounts. Use `settings.content_filters` to limit
        which future posts are eligible.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - source_account_id
                - target_account_ids
              properties:
                name:
                  type: string
                description:
                  type: string
                  nullable: true
                source_account_id:
                  type: string
                target_account_ids:
                  type: array
                  items:
                    type: string
                is_active:
                  type: boolean
                future_content_enabled:
                  type: boolean
                settings:
                  $ref: '#/components/schemas/WorkflowSettings'
            examples:
              basic:
                value:
                  name: Workflow A to B
                  source_account_id: account-1
                  target_account_ids:
                    - account-2
                  is_active: true
              withFilters:
                value:
                  name: Facebook to LinkedIn
                  source_account_id: account-1
                  target_account_ids:
                    - account-2
                    - account-3
                  is_active: true
                  settings:
                    content_filters:
                      types:
                        text: true
                        image: true
                        quote: false
                        video: true
                      hashtags:
                        include: []
                        exclude: []
      responses:
        '201':
          description: Workflow created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Workflow'
        '401':
          description: Missing, invalid, revoked, or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorResponse'
        '403':
          description: Workflow limit reached for the current plan.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    WorkflowSettings:
      type: object
      properties:
        content_filters:
          type: object
          properties:
            types:
              type: object
              properties:
                text:
                  type: boolean
                image:
                  type: boolean
                quote:
                  type: boolean
                video:
                  type: boolean
            hashtags:
              type: object
              properties:
                include:
                  type: array
                  items:
                    type: string
                exclude:
                  type: array
                  items:
                    type: string
        destination_publish_settings:
          type: object
          additionalProperties:
            type: object
            properties:
              minimum_interval_minutes:
                type: integer
                minimum: 1
              remove_comment_dm_prompts:
                type: boolean
                default: false
                description: >-
                  Remove comment/DM prompts from the original caption before
                  custom before/after text. Supported for Instagram, Threads, X,
                  Facebook, LinkedIn, Bluesky, Pinterest, YouTube and TikTok.
              adapt_caption:
                type: boolean
                default: false
                description: >-
                  Rewrite the caption for this destination with AI at publish
                  time, after comment/DM prompt removal and before custom text.
                  Links are always kept. If the rewrite fails, the original
                  caption is published. Supported on the same platforms as
                  caption_ending.
              adapt_caption_instructions:
                type: string
                maxLength: 1000
                description: >-
                  Optional style instructions for the AI rewrite. When set, they
                  replace the built-in guidance for the destination platform.
              snapchat:
                type: object
                required:
                  - publish_targets
                properties:
                  publish_targets:
                    type: array
                    minItems: 1
                    uniqueItems: true
                    items:
                      type: string
                      enum:
                        - spotlight
                        - public_story
                  locale:
                    type: string
                    pattern: ^[a-z]{2}_[A-Z]{2}$
                    default: en_US
    Workflow:
      type: object
      properties:
        id:
          type: string
        profile_id:
          type: string
        source_account_id:
          type: string
        target_account_ids:
          type: array
          items:
            type: string
        settings:
          $ref: '#/components/schemas/WorkflowSettings'
        is_active:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        name:
          type: string
        description:
          type: string
          nullable: true
        future_content_enabled:
          type: boolean
        last_checked:
          type: string
          format: date-time
          nullable: true
        last_enabled_at:
          type: string
          format: date-time
          nullable: true
    AuthErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_api_key
            message:
              type: string
              example: Invalid API key.
            hint:
              type: string
              description: Suggested action to resolve the error.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: workflow_limit_reached
            message:
              type: string
              example: You have reached the maximum number of workflows for your plan.
            hint:
              type: string
              description: Suggested action to resolve the error.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Scoped API key issued in PostOnce Settings. OAuth authorization grants
        are not currently supported.
      x-scopes:
        accounts:read: List and read connected accounts.
        accounts:write: Connect and disconnect social accounts.
        media:read: Read uploaded media.
        media:write: Upload media.
        posts:read: Read posts and unpublished drafts.
        posts:write: Create, update, publish, cancel, retry, and delete posts and drafts.
        workflows:read: List and read crossposting workflows.
        workflows:write: Create, update, and delete crossposting workflows.

````

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