Skip to content

added openapi spec for manage_templates#2908

Open
jzbahrai wants to merge 1 commit into
mainfrom
task/update-openapi-spec-for-templates
Open

added openapi spec for manage_templates#2908
jzbahrai wants to merge 1 commit into
mainfrom
task/update-openapi-spec-for-templates

Conversation

@jzbahrai

Copy link
Copy Markdown
Collaborator

Summary | Résumé

Added an openapi spec for manage_templates
GET, POST, PATCH, DELETE

Also a GET for template_categories as that is required in order to create a template.

Copilot AI review requested due to automatic review settings June 15, 2026 18:04
@jzbahrai jzbahrai requested a review from jimleroyer as a code owner June 15, 2026 18:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds OpenAPI (English + French) documentation for the v2 “manage templates” API surface, covering template CRUD-style operations plus template category lookup needed for creation.

Changes:

  • Documented new manage-template endpoints: template categories (GET), template by id (GET/PATCH/DELETE), and template creation (POST).
  • Added new component schemas for manage-template payloads and template-category error responses.
  • Added a new Manage Templates tag to group these operations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 18 comments.

File Description
openapi/v2-notifications-api-en.yaml Adds Manage Templates paths, schemas, and tag in English OpenAPI spec
openapi/v2-notifications-api-fr.yaml Adds the same Manage Templates paths, schemas, and tag in French OpenAPI spec

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +736 to +741
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Comment on lines +801 to +818
'404':
description: Template not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
template_not_found:
summary: Template not found
value:
result: "error"
message: "Template not found in database"
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Comment on lines +928 to +939
'404':
description: Template not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Comment on lines +1007 to +1018
'404':
description: Template not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Comment on lines +1137 to +1142
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Comment on lines +1137 to +1142
'500':
description: Erreur interne du serveur
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Comment on lines +1728 to +1750
ManageTemplatePostRequest:
type: object
description: Le champ subject est requis lorsque template_type vaut email.
properties:
name:
type: string
template_type:
type: string
enum: [sms, email]
content:
type: string
subject:
type: string
template_category_id:
$ref: '#/components/schemas/UUID'
parent_folder_id:
$ref: '#/components/schemas/UUID'
required:
- name
- template_type
- content
- template_category_id
additionalProperties: false
Comment on lines +1072 to +1079
missing_required_field:
summary: Champ obligatoire manquant
value:
status_code: 400
errors:
- error: "ValidationError"
message: "template_category_id is a required property"
invalid_parent_folder:
Comment on lines +1105 to +1107
- error: "TemplateCategoryNotFoundError"
message: "template_category_id does not match any current template categories"
template_categories:
Comment on lines +888 to +907
category_not_found:
summary: Catégorie de modèle introuvable
value:
status_code: 400
errors:
- error: "TemplateCategoryNotFoundError"
message: "template_category_id does not match any current template categories"
template_categories:
- template_category_id: "12345678-1234-1234-1234-123456789012"
name: "Mises à jour"
category_invalid:
summary: Valeur de catégorie de modèle invalide
value:
status_code: 400
errors:
- error: "TemplateCategoryValidationError"
message: "template_category_id does not match any current template categories"
template_categories:
- template_category_id: "12345678-1234-1234-1234-123456789012"
name: "Mises à jour"

@smcmurtry smcmurtry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left the same comment a bunch of times and I don't think I got all of the occurences - let me know if that makes sense. Otherwise the english content looks good

description: |
Retrieve all available template categories for manage template operations.

This endpoint requires a NEW API key with the manage_permissions permission (manage_templates).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This endpoint requires a NEW API key with the manage_permissions permission (manage_templates).
This endpoint requires a NEW API key with the manage_templates permission.

description: |
Retrieve a specific template by ID using manage template permissions.

This endpoint requires a NEW API key with the manage_permissions permission (manage_templates).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This endpoint requires a NEW API key with the manage_permissions permission (manage_templates).
This endpoint requires a NEW API key with the manage_templates permission.

schema:
$ref: '#/components/schemas/ValidationErrorResponse'
'403':
description: Forbidden - NEW API key missing required manage_permissions permission (manage_templates)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Forbidden - NEW API key missing required manage_permissions permission (manage_templates)
description: Forbidden - NEW API key missing required manage_templates permission

description: |
Update editable fields on a template, including category and parent folder assignment.

This endpoint requires a NEW API key with the manage_permissions permission (manage_templates).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This endpoint requires a NEW API key with the manage_permissions permission (manage_templates).
This endpoint requires a NEW API key with the manage_templates permission.

schema:
$ref: '#/components/schemas/ValidationErrorResponse'
'403':
description: Forbidden - NEW API key missing required manage_permissions permission (manage_templates)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Forbidden - NEW API key missing required manage_permissions permission (manage_templates)
description: Forbidden - NEW API key missing required manage_templates permission```

description: |
Archive a template and remove it from any folder.

This endpoint requires a NEW API key with the manage_permissions permission (manage_templates).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This endpoint requires a NEW API key with the manage_permissions permission (manage_templates).
This endpoint requires a NEW API key with the manage_templates permission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants