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

# 创建企业版剧本

<div id="permissions">
  ## 权限
</div>

需要在 Enterprise 级别拥有 `ManageAccountPlaybooks` 权限的服务用户。


## OpenAPI

````yaml zh/v3-openapi.yaml POST /v3/enterprise/playbooks
openapi: 3.1.0
info:
  description: 采用 Service User 身份验证和 RBAC 的 Devin v3 API
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/enterprise/playbooks:
    post:
      tags:
        - playbooks
      summary: 创建企业版剧本
      operationId: handle_create_playbook_v3_enterprise_playbooks_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlaybookCreateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlaybookResponse'
          description: 成功响应
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 验证错误
components:
  schemas:
    PlaybookCreateRequest:
      properties:
        body:
          title: Body
          type: string
        macro:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            playbook
            宏标识符。必须以“!”开头，后跟一个或多个字母、数字、下划线或连字符。示例：“!my_macro”或“!my-macro”
          title: Macro
        structured_output_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            使用此 playbook 的会话将按结构化输出生成的 JSON Schema（Draft 7）。最大 64KB。必须是自包含的（不含外部
            $ref）。
          title: Structured Output Schema
        title:
          title: Title
          type: string
      required:
        - title
        - body
      title: PlaybookCreateRequest
      type: object
    PlaybookResponse:
      properties:
        access_type:
          enum:
            - enterprise
            - org
          title: Access Type
          type: string
        body:
          title: Body
          type: string
        created_at:
          title: Created At
          type: integer
        created_by:
          title: Created By
          type: string
        macro:
          anyOf:
            - type: string
            - type: 'null'
          title: Macro
        org_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Id
        playbook_id:
          title: Playbook Id
          type: string
        structured_output_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Structured Output Schema
        title:
          title: Title
          type: string
        updated_at:
          title: Updated At
          type: integer
        updated_by:
          title: Updated By
          type: string
      required:
        - playbook_id
        - title
        - body
        - macro
        - created_by
        - updated_by
        - created_at
        - updated_at
        - access_type
        - org_id
      title: PlaybookResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearerAuth:
      description: 服务用户凭据（前缀：cog_）
      scheme: bearer
      type: http

````