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

# Set Action Step Completion

> Record which of an action's steps are done. Each entry names one action and either sets `completed` for every step it holds, or lists the steps to write; a step in turn either sets `completed` for all of its options or names them individually, each with its own value, so one call can tick some and untick others. An action is all or nothing: anything Peec cannot apply leaves every step on it untouched and comes back under `skipped` or `rejected`, so a partly-written action is never a state you have to read back. Other actions in the same call are unaffected. The action's own status is never changed by this endpoint, including when every step on it is complete. An action that is already deleted reads as absent unless the key is a platform admin one. A content optimisation is reachable only on a project with content optimisation enabled; elsewhere its id is returned in `skipped`.



## OpenAPI

````yaml https://api.peec.ai/customer/v1/openapi/json post /actions/steps/completion
openapi: 3.0.3
info:
  title: Peec AI Customer API
  description: Development documentation
  version: 1.0.0
  contact:
    name: Peec AI Team
    email: support@peec.ai
servers:
  - url: https://api.peec.ai/customer/v1
security: []
paths:
  /actions/steps/completion:
    post:
      tags:
        - Actions
      summary: Set Action Step Completion
      description: >-
        Record which of an action's steps are done. Each entry names one action
        and either sets `completed` for every step it holds, or lists the steps
        to write; a step in turn either sets `completed` for all of its options
        or names them individually, each with its own value, so one call can
        tick some and untick others. An action is all or nothing: anything Peec
        cannot apply leaves every step on it untouched and comes back under
        `skipped` or `rejected`, so a partly-written action is never a state you
        have to read back. Other actions in the same call are unaffected. The
        action's own status is never changed by this endpoint, including when
        every step on it is complete. An action that is already deleted reads as
        absent unless the key is a platform admin one. A content optimisation is
        reachable only on a project with content optimisation enabled; elsewhere
        its id is returned in `skipped`.
      operationId: postActionsStepsCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  description: Required if using a company api key
                  example: or_f45b94ba-5e35-4982-93ed-285e72ee14eb
                  type: string
                actions:
                  minItems: 1
                  maxItems: 50
                  type: array
                  items:
                    type: object
                    properties:
                      action_id:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        example: 01a0422f-e0c4-7820-85a1-31515a321f15
                        description: >-
                          The action the steps belong to. Name it once and list
                          every step written on it, rather than repeating the
                          action per step.
                      completed:
                        description: >-
                          Sets every option the action holds. Naming steps is
                          how to write part of an action, and is also the only
                          form that fails loudly on a step id Peec has
                          regenerated — setting the whole action applies to
                          whatever it holds at the time of the write.
                        type: boolean
                      steps:
                        minItems: 1
                        maxItems: 50
                        type: array
                        items:
                          type: object
                          properties:
                            step_id:
                              type: string
                              example: 3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10
                              description: >-
                                A step id from the action detail read. Steps are
                                addressed by id rather than by position, so an
                                action Peec has since regenerated fails as
                                `step_not_found` instead of writing the wrong
                                work.
                            completed:
                              description: >-
                                Sets every option in the step at once, which is
                                what the step's own checkbox does.
                              type: boolean
                            options:
                              description: >-
                                Sets named options individually, each with its
                                own value, so one call can tick some and untick
                                others.
                              minItems: 1
                              maxItems: 50
                              type: array
                              items:
                                type: object
                                properties:
                                  option_id:
                                    type: string
                                    example: 9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84
                                    description: An option id from the action detail read.
                                  completed:
                                    type: boolean
                                    description: >-
                                      `true` marks this option done, `false`
                                      puts it back.
                                required:
                                  - option_id
                                  - completed
                          required:
                            - step_id
                    required:
                      - action_id
              required:
                - actions
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                project_id:
                  description: Required if using a company api key
                  example: or_f45b94ba-5e35-4982-93ed-285e72ee14eb
                  type: string
                actions:
                  minItems: 1
                  maxItems: 50
                  type: array
                  items:
                    type: object
                    properties:
                      action_id:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        example: 01a0422f-e0c4-7820-85a1-31515a321f15
                        description: >-
                          The action the steps belong to. Name it once and list
                          every step written on it, rather than repeating the
                          action per step.
                      completed:
                        description: >-
                          Sets every option the action holds. Naming steps is
                          how to write part of an action, and is also the only
                          form that fails loudly on a step id Peec has
                          regenerated — setting the whole action applies to
                          whatever it holds at the time of the write.
                        type: boolean
                      steps:
                        minItems: 1
                        maxItems: 50
                        type: array
                        items:
                          type: object
                          properties:
                            step_id:
                              type: string
                              example: 3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10
                              description: >-
                                A step id from the action detail read. Steps are
                                addressed by id rather than by position, so an
                                action Peec has since regenerated fails as
                                `step_not_found` instead of writing the wrong
                                work.
                            completed:
                              description: >-
                                Sets every option in the step at once, which is
                                what the step's own checkbox does.
                              type: boolean
                            options:
                              description: >-
                                Sets named options individually, each with its
                                own value, so one call can tick some and untick
                                others.
                              minItems: 1
                              maxItems: 50
                              type: array
                              items:
                                type: object
                                properties:
                                  option_id:
                                    type: string
                                    example: 9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84
                                    description: An option id from the action detail read.
                                  completed:
                                    type: boolean
                                    description: >-
                                      `true` marks this option done, `false`
                                      puts it back.
                                required:
                                  - option_id
                                  - completed
                          required:
                            - step_id
                    required:
                      - action_id
              required:
                - actions
          multipart/form-data:
            schema:
              type: object
              properties:
                project_id:
                  description: Required if using a company api key
                  example: or_f45b94ba-5e35-4982-93ed-285e72ee14eb
                  type: string
                actions:
                  minItems: 1
                  maxItems: 50
                  type: array
                  items:
                    type: object
                    properties:
                      action_id:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        example: 01a0422f-e0c4-7820-85a1-31515a321f15
                        description: >-
                          The action the steps belong to. Name it once and list
                          every step written on it, rather than repeating the
                          action per step.
                      completed:
                        description: >-
                          Sets every option the action holds. Naming steps is
                          how to write part of an action, and is also the only
                          form that fails loudly on a step id Peec has
                          regenerated — setting the whole action applies to
                          whatever it holds at the time of the write.
                        type: boolean
                      steps:
                        minItems: 1
                        maxItems: 50
                        type: array
                        items:
                          type: object
                          properties:
                            step_id:
                              type: string
                              example: 3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10
                              description: >-
                                A step id from the action detail read. Steps are
                                addressed by id rather than by position, so an
                                action Peec has since regenerated fails as
                                `step_not_found` instead of writing the wrong
                                work.
                            completed:
                              description: >-
                                Sets every option in the step at once, which is
                                what the step's own checkbox does.
                              type: boolean
                            options:
                              description: >-
                                Sets named options individually, each with its
                                own value, so one call can tick some and untick
                                others.
                              minItems: 1
                              maxItems: 50
                              type: array
                              items:
                                type: object
                                properties:
                                  option_id:
                                    type: string
                                    example: 9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84
                                    description: An option id from the action detail read.
                                  completed:
                                    type: boolean
                                    description: >-
                                      `true` marks this option done, `false`
                                      puts it back.
                                required:
                                  - option_id
                                  - completed
                          required:
                            - step_id
                    required:
                      - action_id
              required:
                - actions
      responses:
        '200':
          description: Per-item completion results
          content:
            application/json:
              schema:
                type: object
                properties:
                  updated:
                    type: array
                    items:
                      type: object
                      properties:
                        action_id:
                          type: string
                      required:
                        - action_id
                  skipped:
                    type: array
                    items:
                      type: object
                      properties:
                        action_id:
                          type: string
                        reason:
                          type: string
                          enum:
                            - not_found
                      required:
                        - action_id
                        - reason
                  rejected:
                    type: array
                    items:
                      type: object
                      properties:
                        action_id:
                          type: string
                        reason:
                          type: string
                          enum:
                            - step_not_found
                            - option_not_found
                            - duplicate_id
                            - duplicate_step_id
                            - not_completable
                          description: >-
                            `step_not_found` and `option_not_found` name a step
                            or option the action does not hold — usually an id
                            from before Peec regenerated it. `duplicate_id` and
                            `duplicate_step_id` mean the same action, or the
                            same step within one action, appeared more than once
                            in this call. `not_completable` is a content brief,
                            whose steps are the material the brief was written
                            from rather than work to do.
                        message:
                          type: string
                      required:
                        - action_id
                        - reason
                        - message
                required:
                  - updated
                  - skipped
                  - rejected
                description: Per-item completion results
        '400':
          description: Response for status 400
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
      security:
        - APIKeyHeader: []
        - APIKeyQuery: []
        - BearerAuth: []
components:
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    APIKeyQuery:
      type: apiKey
      in: query
      name: api_key
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````