openapi: 3.0.3 info: title: Stytch B2B Authentication Application Email Template API version: 2.0.0 description: Stytch's B2B API for multi-tenant authentication. Supports Organizations, Members, SSO (SAML/OIDC), Magic Links, OTP, OAuth, Discovery, Sessions, B2B RBAC, SCIM, TOTP, Recovery Codes, Passwords, Impersonation, and the B2B IDP. contact: name: Stytch url: https://stytch.com/docs license: name: Proprietary servers: - url: https://api.stytch.com description: Production - url: https://test.stytch.com description: Test tags: - name: Email Template paths: /pwa/v3/projects/:project_slug/email_templates: post: summary: Create operationId: pwa_email_template_v3_Create tags: - Email Template description: Create creates an email template for a project. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/pwa_email_template_v3_CreateRequest' parameters: - name: project_slug in: path required: true schema: type: string responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/pwa_email_template_v3_CreateResponse' '400': description: Bad request '401': description: Unauthorized content: application/json: example: status_code: 401 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: unauthorized_credentials error_message: Unauthorized credentials. error_url: https://stytch.com/docs/api/errors/401 '429': description: Too Many Requests content: application/json: example: status_code: 429 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: too_many_requests error_message: Too many requests have been made. error_url: https://stytch.com/docs/api/errors/429 '500': description: Internal server error content: application/json: example: status_code: 500 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: internal_server_error error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong. error_url: https://stytch.com/docs/api/errors/500 get: summary: Getall operationId: pwa_email_template_v3_GetAll tags: - Email Template description: GetAll retrieves all email templates for a project. parameters: - name: project_slug in: path required: true schema: type: string responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/pwa_email_template_v3_GetAllResponse' '400': description: Bad request '401': description: Unauthorized content: application/json: example: status_code: 401 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: unauthorized_credentials error_message: Unauthorized credentials. error_url: https://stytch.com/docs/api/errors/401 '429': description: Too Many Requests content: application/json: example: status_code: 429 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: too_many_requests error_message: Too many requests have been made. error_url: https://stytch.com/docs/api/errors/429 '500': description: Internal server error content: application/json: example: status_code: 500 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: internal_server_error error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong. error_url: https://stytch.com/docs/api/errors/500 /pwa/v3/projects/:project_slug/email_templates/:template_id: get: summary: Get operationId: pwa_email_template_v3_Get tags: - Email Template description: Get retrieves an email template for a project. parameters: - name: project_slug in: path required: true schema: type: string - name: template_id in: path required: true schema: type: string responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/pwa_email_template_v3_GetResponse' '400': description: Bad request '401': description: Unauthorized content: application/json: example: status_code: 401 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: unauthorized_credentials error_message: Unauthorized credentials. error_url: https://stytch.com/docs/api/errors/401 '429': description: Too Many Requests content: application/json: example: status_code: 429 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: too_many_requests error_message: Too many requests have been made. error_url: https://stytch.com/docs/api/errors/429 '500': description: Internal server error content: application/json: example: status_code: 500 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: internal_server_error error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong. error_url: https://stytch.com/docs/api/errors/500 put: summary: Update operationId: pwa_email_template_v3_Update tags: - Email Template description: Update updates an email template for a project. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/pwa_email_template_v3_UpdateRequest' parameters: - name: project_slug in: path required: true schema: type: string - name: template_id in: path required: true schema: type: string responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/pwa_email_template_v3_UpdateResponse' '400': description: Bad request '401': description: Unauthorized content: application/json: example: status_code: 401 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: unauthorized_credentials error_message: Unauthorized credentials. error_url: https://stytch.com/docs/api/errors/401 '429': description: Too Many Requests content: application/json: example: status_code: 429 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: too_many_requests error_message: Too many requests have been made. error_url: https://stytch.com/docs/api/errors/429 '500': description: Internal server error content: application/json: example: status_code: 500 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: internal_server_error error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong. error_url: https://stytch.com/docs/api/errors/500 delete: summary: Delete operationId: pwa_email_template_v3_Delete tags: - Email Template description: Delete deletes an email template for a project. parameters: - name: project_slug in: path required: true schema: type: string - name: template_id in: path required: true schema: type: string responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/pwa_email_template_v3_DeleteResponse' '400': description: Bad request '401': description: Unauthorized content: application/json: example: status_code: 401 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: unauthorized_credentials error_message: Unauthorized credentials. error_url: https://stytch.com/docs/api/errors/401 '429': description: Too Many Requests content: application/json: example: status_code: 429 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: too_many_requests error_message: Too many requests have been made. error_url: https://stytch.com/docs/api/errors/429 '500': description: Internal server error content: application/json: example: status_code: 500 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: internal_server_error error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong. error_url: https://stytch.com/docs/api/errors/500 /pwa/v3/projects/:project_slug/default_email_templates/:email_template_type: post: summary: Setdefault operationId: pwa_email_template_v3_SetDefault tags: - Email Template description: SetDefault sets the default email template for a specific template type in a project. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/pwa_email_template_v3_SetDefaultRequest' parameters: - name: project_slug in: path required: true schema: type: string - name: email_template_type in: path required: true schema: $ref: '#/components/schemas/pwa_email_template_v3_TemplateType' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/pwa_email_template_v3_SetDefaultResponse' '400': description: Bad request '401': description: Unauthorized content: application/json: example: status_code: 401 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: unauthorized_credentials error_message: Unauthorized credentials. error_url: https://stytch.com/docs/api/errors/401 '429': description: Too Many Requests content: application/json: example: status_code: 429 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: too_many_requests error_message: Too many requests have been made. error_url: https://stytch.com/docs/api/errors/429 '500': description: Internal server error content: application/json: example: status_code: 500 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: internal_server_error error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong. error_url: https://stytch.com/docs/api/errors/500 get: summary: Getdefault operationId: pwa_email_template_v3_GetDefault tags: - Email Template description: GetDefault retrieves the default email template for a specific template type in a project. parameters: - name: project_slug in: path required: true schema: type: string - name: email_template_type in: path required: true schema: $ref: '#/components/schemas/pwa_email_template_v3_TemplateType' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/pwa_email_template_v3_GetDefaultResponse' '400': description: Bad request '401': description: Unauthorized content: application/json: example: status_code: 401 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: unauthorized_credentials error_message: Unauthorized credentials. error_url: https://stytch.com/docs/api/errors/401 '429': description: Too Many Requests content: application/json: example: status_code: 429 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: too_many_requests error_message: Too many requests have been made. error_url: https://stytch.com/docs/api/errors/429 '500': description: Internal server error content: application/json: example: status_code: 500 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: internal_server_error error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong. error_url: https://stytch.com/docs/api/errors/500 delete: summary: Unsetdefault operationId: pwa_email_template_v3_UnsetDefault tags: - Email Template description: UnsetDefault removes the default email template for a specific template type in a project. parameters: - name: project_slug in: path required: true schema: type: string - name: email_template_type in: path required: true schema: $ref: '#/components/schemas/pwa_email_template_v3_TemplateType' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/pwa_email_template_v3_UnsetDefaultResponse' '400': description: Bad request '401': description: Unauthorized content: application/json: example: status_code: 401 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: unauthorized_credentials error_message: Unauthorized credentials. error_url: https://stytch.com/docs/api/errors/401 '429': description: Too Many Requests content: application/json: example: status_code: 429 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: too_many_requests error_message: Too many requests have been made. error_url: https://stytch.com/docs/api/errors/429 '500': description: Internal server error content: application/json: example: status_code: 500 request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141 error_type: internal_server_error error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong. error_url: https://stytch.com/docs/api/errors/500 components: schemas: pwa_email_template_v3_FontFamily: type: string enum: - ARIAL - BRUSH_SCRIPT_MT - COURIER_NEW - GEORGIA - HELVETICA - TAHOMA - TIMES_NEW_ROMAN - TREBUCHET_MS - VERDANA pwa_email_template_v3_SenderInformation: type: object properties: from_local_part: type: string from_domain: type: string from_name: type: string reply_to_local_part: type: string reply_to_name: type: string pwa_email_template_v3_PrebuiltCustomization: type: object properties: button_border_radius: type: number format: float button_color: type: string button_text_color: type: string font_family: $ref: '#/components/schemas/pwa_email_template_v3_FontFamily' text_alignment: $ref: '#/components/schemas/pwa_email_template_v3_TextAlignment' pwa_email_template_v3_CreateRequest: type: object properties: template_id: type: string name: type: string sender_information: $ref: '#/components/schemas/pwa_email_template_v3_SenderInformation' prebuilt_customization: $ref: '#/components/schemas/pwa_email_template_v3_PrebuiltCustomization' custom_html_customization: $ref: '#/components/schemas/pwa_email_template_v3_CustomHTMLCustomization' description: Request type required: - template_id pwa_email_template_v3_UpdateResponse: type: object properties: request_id: type: string email_template: $ref: '#/components/schemas/pwa_email_template_v3_EmailTemplate' status_code: type: integer format: int32 description: Response type required: - request_id - email_template - status_code pwa_email_template_v3_CreateResponse: type: object properties: request_id: type: string email_template: $ref: '#/components/schemas/pwa_email_template_v3_EmailTemplate' status_code: type: integer format: int32 description: Response type required: - request_id - email_template - status_code pwa_email_template_v3_GetDefaultResponse: type: object properties: request_id: type: string template_id: type: string status_code: type: integer format: int32 description: Response type required: - request_id - template_id - status_code pwa_email_template_v3_GetResponse: type: object properties: request_id: type: string email_template: $ref: '#/components/schemas/pwa_email_template_v3_EmailTemplate' status_code: type: integer format: int32 description: Response type required: - request_id - email_template - status_code pwa_email_template_v3_TemplateType: type: string enum: - LOGIN - SIGNUP - INVITE - RESET_PASSWORD - ONE_TIME_PASSCODE - ONE_TIME_PASSCODE_SIGNUP - VERIFY_EMAIL_PASSWORD_RESET - UNLOCK - PREBUILT pwa_email_template_v3_SetDefaultResponse: type: object properties: request_id: type: string status_code: type: integer format: int32 description: Response type required: - request_id - status_code pwa_email_template_v3_DeleteResponse: type: object properties: request_id: type: string status_code: type: integer format: int32 description: Response type required: - request_id - status_code pwa_email_template_v3_UnsetDefaultResponse: type: object properties: request_id: type: string status_code: type: integer format: int32 description: Response type required: - request_id - status_code pwa_email_template_v3_UpdateRequest: type: object properties: name: type: string sender_information: $ref: '#/components/schemas/pwa_email_template_v3_SenderInformation' prebuilt_customization: $ref: '#/components/schemas/pwa_email_template_v3_PrebuiltCustomization' custom_html_customization: $ref: '#/components/schemas/pwa_email_template_v3_CustomHTMLCustomization' description: Request type pwa_email_template_v3_EmailTemplate: type: object properties: template_id: type: string name: type: string sender_information: $ref: '#/components/schemas/pwa_email_template_v3_SenderInformation' prebuilt_customization: $ref: '#/components/schemas/pwa_email_template_v3_PrebuiltCustomization' custom_html_customization: $ref: '#/components/schemas/pwa_email_template_v3_CustomHTMLCustomization' required: - template_id pwa_email_template_v3_CustomHTMLCustomization: type: object properties: template_type: $ref: '#/components/schemas/pwa_email_template_v3_TemplateType' html_content: type: string plaintext_content: type: string subject: type: string pwa_email_template_v3_SetDefaultRequest: type: object properties: template_id: type: string description: Request type required: - template_id pwa_email_template_v3_TextAlignment: type: string enum: - LEFT - CENTER pwa_email_template_v3_GetAllResponse: type: object properties: request_id: type: string email_templates: type: array items: $ref: '#/components/schemas/pwa_email_template_v3_EmailTemplate' status_code: type: integer format: int32 description: Response type required: - request_id - email_templates - status_code securitySchemes: basicAuth: type: http scheme: basic