openapi: 3.0.3 info: title: Docupilot accounts APIs ai content_blocks API version: '1.0' description: Docupilot accounts APIs termsOfService: https://docupilot.app/terms-and-conditions/ contact: name: Team Docupilot email: support@docupilot.app tags: - name: content_blocks paths: /dashboard/api/v2/content_blocks/: get: operationId: list_content_blocks summary: Get list of content blocks parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - name: ordering required: false in: query description: Which field to use when ordering the results. schema: type: string - name: page required: false in: query description: A page number within the paginated result set. schema: type: integer - name: search required: false in: query description: A search term. schema: type: string tags: - content_blocks security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedContentBlockList' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' post: operationId: create_content_block summary: Create content_block parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true tags: - content_blocks requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/NewContentBlock' required: true security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/ContentBlock' description: '' '413': content: text/html: schema: description: Uploaded File Is Too Large. description: '' '400': content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' /dashboard/api/v2/content_blocks/{content_block_id}/permissions/: get: operationId: list_content_block_sharing summary: Get all shared permissions for specific content block parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: content_block_id schema: type: integer required: true tags: - content_blocks security: - SessionAuthentication: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/ContentBlockSharing' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' post: operationId: create_content_block_sharing_permission summary: Create content block sharing permission parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: content_block_id schema: type: integer required: true tags: - content_blocks requestBody: content: application/json: schema: type: array items: $ref: '#/components/schemas/ContentBlockSharing' application/x-www-form-urlencoded: schema: type: array items: $ref: '#/components/schemas/ContentBlockSharing' multipart/form-data: schema: type: array items: $ref: '#/components/schemas/ContentBlockSharing' required: true security: - SessionAuthentication: [] responses: '201': content: application/json: schema: type: array items: $ref: '#/components/schemas/ContentBlockSharing' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' /dashboard/api/v2/content_blocks/{content_block_id}/permissions/{id}/: get: operationId: get_content_block_sharing summary: Get specific permission details for given content block parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: content_block_id schema: type: integer required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block sharing setting. required: true tags: - content_blocks security: - SessionAuthentication: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ContentBlockSharing' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' patch: operationId: update_content_block_sharing_permission summary: Update content block content partially parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: content_block_id schema: type: integer required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block sharing setting. required: true tags: - content_blocks requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedUpdateContentBlockSharing' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedUpdateContentBlockSharing' multipart/form-data: schema: $ref: '#/components/schemas/PatchedUpdateContentBlockSharing' security: - SessionAuthentication: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ContentBlockSharing' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' delete: operationId: revoke_content_block_sharing_permission summary: Revoke content block sharing permission parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: content_block_id schema: type: integer required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block sharing setting. required: true tags: - content_blocks security: - SessionAuthentication: [] responses: '204': description: No response body '400': content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' /dashboard/api/v2/content_blocks/{id}/: get: operationId: get_content_block summary: Get one content_block parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block. required: true tags: - content_blocks security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ContentBlock' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' put: operationId: update_content_block summary: Update content_block parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block. required: true tags: - content_blocks requestBody: content: application/json: schema: $ref: '#/components/schemas/ContentBlock' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/ContentBlock' multipart/form-data: schema: $ref: '#/components/schemas/ContentBlock' required: true security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ContentBlock' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' patch: operationId: update_content_block_data summary: Update content block data parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block. required: true tags: - content_blocks requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/PatchedUpdateNewContentBlock' security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ContentBlock' description: '' '413': content: text/html: schema: description: Uploaded File Is Too Large. description: '' '400': content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' delete: operationId: delete_content_block summary: Delete a content block parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block. required: true tags: - content_blocks security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '204': description: No response body '400': content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' /dashboard/api/v2/content_blocks/{id}/copy/: post: operationId: copy_content_block summary: Copy content block parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block. required: true tags: - content_blocks requestBody: content: application/json: schema: $ref: '#/components/schemas/CopyContentBlock' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CopyContentBlock' multipart/form-data: schema: $ref: '#/components/schemas/CopyContentBlock' required: true security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/ContentBlock' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' /dashboard/api/v2/content_blocks/{id}/download/: get: operationId: download_content_block_file summary: Download content block file parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block. required: true tags: - content_blocks security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '200': content: text/html: schema: type: string format: binary application/pdf: schema: type: string format: binary image/png: schema: type: string format: binary application/vnd.openxmlformats-officedocument.wordprocessingml.document: schema: type: string format: binary application/vnd.openxmlformats-officedocument.presentationml.presentation: schema: type: string format: binary application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: schema: type: string format: binary description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' /dashboard/api/v2/content_blocks/{id}/editor_version/: patch: operationId: update_content_block_editor_version summary: Update the content block editor version between v1 and v2 parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block. required: true tags: - content_blocks requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedContentBlockEditorVersion' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedContentBlockEditorVersion' multipart/form-data: schema: $ref: '#/components/schemas/PatchedContentBlockEditorVersion' security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ContentBlockEditorVersion' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' /dashboard/api/v2/content_blocks/{id}/inline_image/: post: operationId: upload_inline_image_of_content_block summary: Upload inline image of content block parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block. required: true tags: - content_blocks requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/UploadContentBlockImage' required: true security: - SessionAuthentication: [] responses: '200': description: No response body '413': content: text/html: schema: description: Uploaded File Is Too Large. description: '' '400': content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' /dashboard/api/v2/content_blocks/{id}/preview/: get: operationId: preview_content_block_file summary: Preview content block file parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: query name: format schema: type: string enum: - json - octet-stream - in: path name: id schema: type: integer description: A unique integer value identifying this content block. required: true tags: - content_blocks security: - SessionAuthentication: [] responses: '200': content: application/octet-stream: schema: type: string format: binary description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' /dashboard/api/v2/content_blocks/{id}/schema/: get: operationId: get_content_block_schema summary: Get content block schema parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block. required: true - name: ordering required: false in: query description: Which field to use when ordering the results. schema: type: string - name: search required: false in: query description: A search term. schema: type: string tags: - content_blocks security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/TemplateSchema' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' /dashboard/api/v2/content_blocks/{id}/templates/: get: operationId: list_content_block_templates summary: List content block templates parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block. required: true - name: ordering required: false in: query description: Which field to use when ordering the results. schema: type: string - name: page required: false in: query description: A page number within the paginated result set. schema: type: integer - name: search required: false in: query description: A search term. schema: type: string tags: - content_blocks security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedTemplateInfoList' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' /dashboard/api/v2/content_blocks/{id}/test/: post: operationId: test_content_block summary: Test a content block parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block. required: true tags: - content_blocks requestBody: content: application/json: schema: type: object additionalProperties: {} security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/TestContentBlock' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' /dashboard/api/v2/content_blocks/{id}/test_data/: get: operationId: get_test_data_for_content_block summary: Get test data used for testing content block parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: path name: id schema: type: integer description: A unique integer value identifying this content block. required: true tags: - content_blocks security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ContentBlock' description: '' '401': content: application/json: schema: $ref: '#/components/schemas/UnauthenticatedError' description: '' '403': content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' /dashboard/api/v2/content_blocks/detail/by-key/: get: operationId: fetch_content_block_detail_by_key summary: Get content block detail by API name (key) parameters: - in: header name: X-Workspace schema: type: string description: Workspace unique_key required: true - in: query name: key schema: type: string description: API name (key) of the content block required: true tags: - content_blocks security: - OAuthAuthentication: [] - SessionAuthentication: [] - tokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ContentBlockDetailByKeyResponse' description: '' '404': content: application/json: schema: $ref: '#/components/schemas/NotFoundError' description: '' components: schemas: NewContentBlock: type: object description: '' properties: name: type: string maxLength: 255 key: type: string maxLength: 255 file: type: string format: binary description: type: string nullable: true maxLength: 255 required: - file - key - name UnauthenticatedError: type: object properties: detail: type: string required: - detail description: '' ContentBlockDetailByKeyResponse: type: object properties: name: type: string type: enum: - docx - html type: string schema: type: array items: $ref: '#/components/schemas/TemplateSchema' required: - name - schema - type description: '' ForbiddenError: type: object properties: detail: type: string required: - detail description: '' UploadContentBlockImage: type: object properties: upload: type: string format: binary required: - upload description: '' ContentBlockSharing: type: object description: '' properties: id: type: integer readOnly: true permission: enum: - read - write - manage type: string user: type: integer required: - id - user TestContentBlock: type: object properties: file_url: type: string format: uri file_name: type: string required: - file_name - file_url description: '' PatchedContentBlockEditorVersion: type: object properties: use_v2_editor: type: boolean description: '' TemplateInfo: type: object properties: id: type: integer readOnly: true name: type: string readOnly: true status: type: string readOnly: true type: type: string readOnly: true required: - id - name - status - type description: '' CopyContentBlock: type: object properties: name: type: string maxLength: 255 description: type: string nullable: true maxLength: 255 key: type: string maxLength: 255 required: - key - name description: '' PaginatedTemplateInfoList: type: object required: - count - results properties: count: type: integer example: 123 next: type: string nullable: true format: uri example: http://api.example.org/accounts/?page=4 previous: type: string nullable: true format: uri example: http://api.example.org/accounts/?page=2 results: type: array items: $ref: '#/components/schemas/TemplateInfo' TemplateSchema: type: object properties: name: type: string type: enum: - string - array - object - generic type: string rType: enum: - content_block type: string generics: enum: - string - array - object - generic type: string fields: type: array items: $ref: '#/components/schemas/TemplateSchema' required: - fields - generics - name - type description: '' ValidationError: type: object properties: errors: type: object additionalProperties: type: array items: type: string non_field_errors: type: array items: type: string required: - errors - non_field_errors description: '' PaginatedContentBlockList: type: object required: - count - results properties: count: type: integer example: 123 next: type: string nullable: true format: uri example: http://api.example.org/accounts/?page=4 previous: type: string nullable: true format: uri example: http://api.example.org/accounts/?page=2 results: type: array items: $ref: '#/components/schemas/ContentBlock' ContentBlockEditorVersion: type: object properties: use_v2_editor: type: boolean description: '' PatchedUpdateContentBlockSharing: type: object description: '' properties: id: type: integer readOnly: true permission: enum: - read - write - manage type: string user: type: integer readOnly: true ContentBlock: type: object description: '' properties: id: type: integer readOnly: true name: type: string maxLength: 255 description: type: string nullable: true maxLength: 255 key: type: string readOnly: true type: enum: - docx - html type: string readOnly: true created_by: type: integer readOnly: true updated_by: type: integer readOnly: true nullable: true created_time: type: string format: date-time readOnly: true updated_time: type: string format: date-time readOnly: true nullable: true use_v2_editor: type: boolean readOnly: true required: - created_by - created_time - id - key - name - type - updated_by - updated_time - use_v2_editor PatchedUpdateNewContentBlock: type: object description: '' properties: name: type: string maxLength: 255 file: type: string format: binary NotFoundError: type: object properties: detail: type: string required: - detail description: '' securitySchemes: OAuthAuthentication: type: http scheme: bearer description: OAuth2 Bearer Token Authentication SessionAuthentication: type: apiKey in: cookie name: sessionid description: browser based login takes care of this externalDocs: description: Help docs on how to use API url: https://help.docupilot.app/developers/api-overview