> ## 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
              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.
    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.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````