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

# Patch Workflows by ID

> Updates fields of a workflow specified by workflow_id. Requires JWT and x-api-key.



## OpenAPI

````yaml patch /workflows/{workflow_id}
openapi: 3.1.0
info:
  title: Playbook API Documentation
  description: >-
    This is the documentation for the Playbook API. You can use this API to use
    our service programmatically, this is done by using your API key. <br/> You
    can view your API key using the 'User' tab on https://beta.playbook3d.com/.
  version: '1.0'
servers: []
security: []
tags: []
paths:
  /workflows/{workflow_id}:
    patch:
      tags:
        - workflows
      summary: Update an Existing Workflow
      description: >-
        Updates fields of a workflow specified by workflow_id. Requires JWT and
        x-api-key.
      operationId: update_workflow
      parameters:
        - name: workflow_id
          in: path
          description: The UUID of the workflow to update.
          required: true
          schema:
            type: string
            format: uuid
        - name: x-api-key
          in: header
          description: >-
            Your API key. This is required by most endpoints to access the API
            programmatically. You can view your x-api-key using the 'Profile'
            tab on the website.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer token for authentication (JWT).
          required: true
          schema:
            type: string
      requestBody:
        required: true
        description: JSON fields to update on the specified workflow.
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: New workflow name.
                team_id:
                  type: string
                  description: UUID of the team to which the workflow will be reassigned.
                owner_id:
                  type: string
                  description: >-
                    UUID of the new owner of this workflow (if your code allows
                    updating ownership).
                is_external:
                  type: boolean
                  description: Whether this workflow is marked as external.
                canvas_type:
                  type: integer
                  description: Canvas type (0 for basic, etc.).
              example:
                name: 'Updated Workflow #4'
                team_id: 41480ee5-14ff-4f9e-89bf-91b0a8e50e77
                owner_id: ab7dafe2-4f19-4570-bad0-a88e70ad2c11
                is_external: false
                canvas_type: 0
      responses:
        '200':
          description: Successfully updated workflow. Returns the updated workflow JSON.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The workflow’s UUID.
                  name:
                    type: string
                    description: Updated workflow name.
                  team_id:
                    type: string
                    description: Current team UUID after update.
                  owner_id:
                    type: string
                    description: Current owner UUID after update (if changed).
                example:
                  id: 123e4567-e89b-12d3-a456-426614174000
                  name: 'Updated Workflow #4'
                  team_id: 41480ee5-14ff-4f9e-89bf-91b0a8e50e77
                  owner_id: ab7dafe2-4f19-4570-bad0-a88e70ad2c11
                  canvas_type: 0
                  is_external: false
        '400':
          description: Bad Request. Possibly invalid JSON or missing fields.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    description: Bad Request. Possibly invalid JSON or missing fields.
                example:
                  description: Bad Request. Possibly invalid JSON or missing fields.
        '401':
          description: Unauthorized. Check your JWT or API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    description: >-
                      Unauthorized. The Bearer token or API key is invalid or
                      missing.
                example:
                  description: >-
                    Unauthorized. The Bearer token or API key is invalid or
                    missing.
        '403':
          description: >-
            Forbidden. The user does not have permission to update this
            workflow.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    description: Forbidden. The user does not have permission.
                example:
                  description: Forbidden. The user does not have permission.
        '404':
          description: Not Found. The workflow ID does not exist.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    description: Not Found. The workflow ID does not exist.
                example:
                  description: Not Found. The workflow ID does not exist.
        '500':
          description: Internal Server Error. Something went wrong on the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    description: Internal Server Error. Something went wrong on the server.
                example:
                  description: Internal Server Error. Something went wrong on the server.
      x-codeSamples:
        - lang: cURL
          source: |-
            curl -X PATCH \
              -H 'Authorization: Bearer $API_KEY' \
              -H 'x-api-key: $API_KEY' \
              -H 'Content-Type: application/json' \
              -H 'Accept: application/json' \
              -d '{"name": "Updated Workflow #4", "team_id": "41480ee5-14ff-4f9e-89bf-91b0a8e50e77", "owner_id": "ab7dafe2-4f19-4570-bad0-a88e70ad2c11", "is_external": false, "canvas_type": 0}' \
              '$BASE_URL/workflows/$workflow_id'
        - lang: Python
          source: >-
            import requests


            headers = {
              'x-api-key': '<YOUR_API_KEY>',
              'Authorization': 'Bearer <YOUR_JWT_TOKEN>',
              'Content-Type': 'application/json',
              'Accept': 'application/json'
            }

            data = {
              'name': 'Updated Workflow #4',
              'team_id': '41480ee5-14ff-4f9e-89bf-91b0a8e50e77',
              'owner_id': 'ab7dafe2-4f19-4570-bad0-a88e70ad2c11',
              'is_external': False,
              'canvas_type': 0
            }


            resp =
            requests.patch(f"https://accounts.playbook3d.com/workflows/{{workflow_id}}",
            json=data, headers=headers)

            print(resp.status_code, resp.json())
        - lang: JavaScript
          source: |-
            fetch(`https://accounts.playbook3d.com/workflows/${workflow_id}`, {
              method: 'PATCH',
              headers: {
                'x-api-key': '<YOUR_API_KEY>',
                'Authorization': 'Bearer <YOUR_JWT_TOKEN>',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              },
              body: JSON.stringify({
                name: 'Updated Workflow #4',
                team_id: '41480ee5-14ff-4f9e-89bf-91b0a8e50e77',
                owner_id: 'ab7dafe2-4f19-4570-bad0-a88e70ad2c11',
                is_external: false,
                canvas_type: 0
              })
            })
              .then(res => res.json())
              .then(data => console.log(data))
              .catch(err => console.error(err));
        - lang: C#
          source: >-
            // Using HttpClient

            HttpClient client = new HttpClient();

            client.DefaultRequestHeaders.Add("x-api-key", "<YOUR_API_KEY>");

            client.DefaultRequestHeaders.Authorization = new
            AuthenticationHeaderValue("Bearer", "<YOUR_JWT_TOKEN>");


            var updateFields = new {
                name = "Updated Workflow #4",
                team_id = "41480ee5-14ff-4f9e-89bf-91b0a8e50e77",
                owner_id = "ab7dafe2-4f19-4570-bad0-a88e70ad2c11",
                is_external = false,
                canvas_type = 0
            };


            var content = new StringContent(
                JsonConvert.SerializeObject(updateFields), Encoding.UTF8, "application/json");
            var response = await
            client.PatchAsync($"https://accounts.playbook3d.com/workflows/{workflow_id}",
            content);

            string respContent = await response.Content.ReadAsStringAsync();

            Console.WriteLine(response.StatusCode);

            Console.WriteLine(respContent);

````