added openapi spec for manage_templates#2908
Conversation
There was a problem hiding this comment.
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 Templatestag 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.
| '500': | ||
| description: Internal server error | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/Error' |
| '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' |
| '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' |
| '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' |
| '500': | ||
| description: Internal server error | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/Error' |
| '500': | ||
| description: Erreur interne du serveur | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/Error' |
| 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 |
| 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: |
| - error: "TemplateCategoryNotFoundError" | ||
| message: "template_category_id does not match any current template categories" | ||
| template_categories: |
| 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
left a comment
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
| 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). |
There was a problem hiding this comment.
| 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) |
There was a problem hiding this comment.
| 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). |
There was a problem hiding this comment.
| 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) |
There was a problem hiding this comment.
| 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). |
There was a problem hiding this comment.
| 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. |
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.