openapi: 3.1.0
info:
  title: Transactional Email API
  description: |-
    Transactional Email is a platform that allows you to send transactional emails. Unlike marketing emails, (which are mass distributions of the same marketing message to multiple recipients), transactional emails are personalized emails sent to individuals in response to events they have triggered (e.g. password recovery, billing information, delivery updates, etc).

    With Transactional Email, you can:
    - register a domain from which to send emails
    - send transactional emails via an SMTP relay
    - send transactional emails via a REST API
    - view your email's delivery status
    - cancel emails that you no longer wish to send




    ## Concepts

    Refer to our [dedicated concepts page](https://www.scaleway.com/en/docs/managed-services/transactional-email/concepts/) to find definitions of the different terms referring to Transactional Email.



    ## Quickstart

    1. **Configure your environment variables.**

        <Message type="note">
          This is an optional step that seeks to simplify your usage of the API.
        </Message>


        ```bash
        export SCW_ACCESS_KEY="<API access key>"
        export SCW_SECRET_KEY="<API secret key>"
        export SCW_PROJECT_ID="<Scaleway Project ID>"
        ```

    2. **Register your domain**. Run the following command to register your domain. Make sure you note down the `dkim_config` that displays in the output, as you will need it for the next steps.

        ```bash
        curl -X POST "https://api.scaleway.com/transactional-email/v1alpha1/regions/$REGION/domains" \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -d "{\"domain_name\":\"my.domain.example.com\",\"project_id\":\"$PROJECT_ID\"}"
        ```

    3. **Create an SPF and a DKIM record**.


        Find out [how to create your SPF and DKIM records](https://www.scaleway.com/en/docs/managed-services/transactional-email/how-to/add-spf-dkim-records-to-your-domain/) in our documentation.

        <Message type="note">
          The DKIM private key is discarded when your domain is revoked. You must update the corresponding DKIM record if you register that domain again.
        </Message>


    4. **Create an MX record**

        <Message type="note">
          Adding an MX record is not mandatory but we recommend you do it to avoid getting your emails rejected.
        </Message>

        Find out [how to add an MX record](https://www.scaleway.com/en/docs/managed-services/transactional-email/how-to/add-mx-record-to-your-domain/) in our documentation.


    5. **Perform a check of your domain**. Run the following commands to query your domain and then perform a check of your domain.

        ```bash
        curl -X POST "https://api.scaleway.com/transactional-email/v1alpha1/regions/$REGION/domains/<domain-id>/check" \
            -H "X-Auth-Token: $TOKEN" \
            -d "{}"

        # Wait a few seconds,then run

        curl -X GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/$REGION/domains/<domain-id>" \
            -H "X-Auth-Token: $TOKEN"
        ```

        <Message type="note">
          If the check fails, `last_error` will describe what happened. Perform another check request once you have fixed the problem. To ensure good scoring, your DNS must be correctly set up before sending any emails. The domain check is performed asynchronously.
        </Message>

    6. **Send an email via the REST API**. Run the following command to send an email using the REST API.

        <Message type="note">
          The attachment content must be base64 encoded and is limited to 2MB. In the following example, both `html` and `attachments` fields are optional.
        </Message>

        ```bash
        cat > mail.json <<EOF
        {
            "from": {
                "name": "Alice",
                "email": "alice@my.domain.example.com"
            },
            "to": [
                {
                    "name": "Bob",
                    "email": "bob@caramail.fr"
                }
            ],
            "subject": "Some subject",
            "text": "Some text.",
            "html": "<p>Some <span style=\"font-weight:bold\">HTML</span>.</p>",
            "project_id": "<project-id>",
            "attachments": [
                {
                    "name": "file.html",
                    "type": "text/html; charset=\"utf8\"",
                    "content": "PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KICAgIDxoZWFkPgogICAgICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04Ij4KICAgICAgICA8dGl0bGU+dGl0bGU8L3RpdGxlPgogICAgPC9oZWFkPgogICAgPGJvZHk+CiAgICAgICAgPHA+SGVsbG8gPHNwYW4gc3R5bGU9ImNvbG9yOmJsdWUiPndvcmxkPC9zcGFuPiE8L3A+CiAgICA8L2JvZHk+CjwvaHRtbD4="
                }
            ],
            "additional_headers": [
                {
                    "key": "Reply-To",
                    "value": "admin@my.domain.example.com"
                },
                {
                    "key": "x-project-tracker",
                    "value": "1234"
                }
            ]
        }
        EOF

        curl -X POST "https://api.scaleway.com/transactional-email/v1alpha1/regions/$REGION/emails" \
            -H "X-Auth-Token: $TOKEN" \
            -d @mail.json
        ```
    7. **Send an email via SMTP**.

        An SMTP relay is available at `smtp.tem.scaleway.com` on ports `25`, `587`, `2587`, `465` (TLS) and `2465` (TLS).

        Use your `project_id` to authenticate as username and your token as a password.


    <Message type="requirement">
     - You have a [Scaleway account](https://console.scaleway.com/)
     - You are the owner of the domain name you want to use
     - You have your [Organization and your Project ID](https://console.scaleway.com/project/settings)
     - You have created an [API key](https://www.scaleway.com/en/docs/iam/how-to/create-api-keys/) and that the API key has sufficient [IAM permissions](https://www.scaleway.com/en/docs/iam/reference-content/permission-sets/) to perform the actions described on this page.
     - You have [installed `curl`](https://curl.se/download.html)
    </Message>


    ## Technical information
    ### Regions

    Scaleway's infrastructure spans different [regions and Availability Zones](https://www.scaleway.com/en/docs/console/account/reference-content/products-availability/).

    Transactional Email is available in the Paris region, which is represented by the following path parameter: `fr-par`.

    ## Technical limitations

    * Transactional Email's attachment types are limited to:
      - `application/acad-template`
      - `application/acad`
      - `application/autocad_dwg`
      - `application/autocad_dxf`
      - `application/dwf`
      - `application/dxf`
      - `application/ics`
      - `application/pdf`
      - `application/pkcs10`
      - `application/pkcs7-mime`
      - `application/pkcs7-signature`
      - `application/vnd.dwt`
      - `application/vnd.ms-excel`
      - `application/vnd.ms-powerpoint`
      - `application/vnd.oasis.opendocument.spreadsheet`
      - `application/vnd.openxmlformats-officedocument.presentationml.presentation`
      - `application/vnd.openxmlformats-officedocument.presentationml.slideshow`
      - `application/vnd.openxmlformats-officedocument.presentationml.template`
      - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`
      - `application/vnd.openxmlformats-officedocument.spreadsheetml.template`
      - `application/x-dwf`
      - `application/x-dwg`
      - `application/x-dwt`
      - `application/x-dxf`
      - `application/x-pdf`
      - `application/x-pkcs12`
      - `application/x-pkcs7-certificates`
      - `application/x-pkcs7-certreqresp`
      - `application/x-pkcs7-crl`
      - `application/x-pkcs7-mime`
      - `application/x-pkcs7-signature`
      - `application/xml`
      - `image/gif`
      - `image/jpeg`
      - `image/jpg`
      - `image/png`
      - `image/svg+xml`
      - `image/vnd.dwg`
      - `image/vnd.dxf`
      - `model/vnd.dwf`
      - `text/calendar`
      - `text/csv`
      - `text/html`
      - `text/plain`
      - `text/xml`
    * Attachment size is limited to 2 MB via API and 50 MB via SMTP.
    * The recursive SPF include directive is not supported

    ##  Going further

    For more information about Transactional Email, you can check out the following pages:

    * [Transactional Email Documentation](https://www.scaleway.com/en/docs/managed-services/transactional-email/)
    * [Scaleway Slack Community](https://scaleway-community.slack.com/) join the #transactional-email channel
    * [Contact our support team](https://console.scaleway.com/support/tickets).
  version: v1alpha1
servers:
- url: https://api.scaleway.com
tags:
- name: Emails
  description: |
    This section lists your emails and shows you how to manage them.
- name: Domains
  description: |
    This section lists your domains, shows you to manage them, and gives you information about them.
- name: Statistics
  description: This section gives you information about your emails' statuses.
- name: Webhooks
  description: |
    Webhooks enable real-time communication and automation between systems by sending messages through all protocols supported by SNS, such as HTTP, HTTPS, and Serverless Functions, allowing for immediate updates and actions based on specific events. This feature is in beta. You can request quotas from the [Scaleway betas page](https://www.scaleway.com/fr/betas/#email-webhooks).
- name: Project Settings
  description: |
    Project settings allow you to manage the configuration of your projects.
- name: Blocklist
  description: |
    This section allows you to manage the blocklist of your emails.
- name: offers
  description: |
    This section allows you to manage and get get subscribed information about your project email offer.
- name: Project Consumption
  description: |
    Project consumption allow you to see your project consumption.
components:
  schemas:
    google.protobuf.Int32Value:
      type: integer
      format: int32
      nullable: true
    scaleway.transactional_email.v1alpha1.Blocklist:
      type: object
      properties:
        id:
          type: string
          description: ID of the blocklist.
        domain_id:
          type: string
          description: Domain ID linked to the blocklist.
        created_at:
          type: string
          description: Date and time of the blocklist creation. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        updated_at:
          type: string
          description: Date and time of the blocklist's last update. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        ends_at:
          type: string
          description: Date and time when the blocklist ends. Empty if the blocklist
            has no end. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        email:
          type: string
          description: Email blocked by the blocklist.
        type:
          type: string
          description: Type of block for this email.
          enum:
          - unknown_type
          - mailbox_full
          - mailbox_not_found
          x-enum-descriptions:
            values:
              unknown_type: If unspecified, the type of blocklist is unknown by default
              mailbox_full: The recipient's mailbox is full and cannot receive any
                new email
              mailbox_not_found: The recipient's mailbox does not exist
          default: unknown_type
        reason:
          type: string
          description: Reason to block this email.
        custom:
          type: boolean
          description: True if this blocklist was created manually. False for an automatic
            Transactional Email blocklist.
      x-properties-order:
      - id
      - domain_id
      - created_at
      - updated_at
      - ends_at
      - email
      - type
      - reason
      - custom
    scaleway.transactional_email.v1alpha1.BulkCreateBlocklistsResponse:
      type: object
      properties:
        blocklists:
          type: array
          description: List of blocklist created.
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Blocklist'
      x-properties-order:
      - blocklists
    scaleway.transactional_email.v1alpha1.CreateEmailRequest.Address:
      type: object
      properties:
        email:
          type: string
          description: Email address.
        name:
          type: string
          description: (Optional) Name displayed.
          nullable: true
      x-properties-order:
      - email
      - name
    scaleway.transactional_email.v1alpha1.CreateEmailRequest.Attachment:
      type: object
      properties:
        name:
          type: string
          description: Filename of the attachment.
        type:
          type: string
          description: MIME type of the attachment.
        content:
          type: string
          description: Content of the attachment encoded in base64.
      x-properties-order:
      - name
      - type
      - content
    scaleway.transactional_email.v1alpha1.CreateEmailRequest.Header:
      type: object
      properties:
        key:
          type: string
          description: Email header key.
        value:
          type: string
          description: Email header value.
      x-properties-order:
      - key
      - value
    scaleway.transactional_email.v1alpha1.CreateEmailResponse:
      type: object
      properties:
        emails:
          type: array
          description: Single page of emails matching the requested criteria.
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Email'
      x-properties-order:
      - emails
    scaleway.transactional_email.v1alpha1.Domain:
      type: object
      properties:
        id:
          type: string
          description: ID of the domain.
        organization_id:
          type: string
          description: ID of the domain's Organization.
        project_id:
          type: string
          description: ID of the domain's Project.
        name:
          type: string
          description: Domain name (example.com).
        status:
          type: string
          description: Status of the domain.
          enum:
          - unknown
          - checked
          - unchecked
          - invalid
          - locked
          - revoked
          - pending
          - autoconfiguring
          x-enum-descriptions:
            values:
              unknown: If unspecified, the status of the domain is unknown by default
              checked: The domain is checked
              unchecked: The domain is unchecked
              invalid: The domain is invalid
              locked: The domain is locked
              revoked: The domain is revoked
              pending: The domain is pending, waiting to be checked
              autoconfiguring: The domain is in process of auto-configuration of the
                domain's DNS zone
          default: unknown
        created_at:
          type: string
          description: Date and time of domain creation. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        next_check_at:
          type: string
          description: Date and time of the next scheduled check. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        last_valid_at:
          type: string
          description: Date and time the domain was last valid. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        revoked_at:
          type: string
          description: Date and time of the domain's deletion. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        last_error:
          type: string
          description: Deprecated. Error message returned if the last check failed.
          deprecated: true
          nullable: true
        spf_config:
          type: string
          description: Snippet of the SPF record to register in the DNS zone.
        dkim_config:
          type: string
          description: DKIM public key to record in the DNS zone.
        statistics:
          type: object
          description: Domain's statistics.
          properties:
            total_count:
              type: integer
              format: uint32
            sent_count:
              type: integer
              format: uint32
            failed_count:
              type: integer
              format: uint32
            canceled_count:
              type: integer
              format: uint32
          x-properties-order:
          - total_count
          - sent_count
          - failed_count
          - canceled_count
        reputation:
          type: object
          description: The domain's reputation is available when your domain is checked
            and has sent enough emails.
          properties:
            status:
              type: string
              description: Status of your domain's reputation.
              enum:
              - unknown_status
              - excellent
              - good
              - average
              - bad
              x-enum-descriptions:
                values:
                  unknown_status: If unspecified, the status of the domain's reputation
                    is unknown by default
                  excellent: The domain has an excellent reputation
                  good: The domain has a good reputation
                  average: The domain has an average reputation.
                  bad: The domain has a bad reputation.
              default: unknown_status
            score:
              type: integer
              description: A range from 0 to 100 that determines your domain's reputation
                score. A score of `0` means a bad domain reputation and a score of
                `100` means an excellent domain reputation.
              format: uint32
            scored_at:
              type: string
              description: Time and date the score was calculated. (RFC 3339 format)
              format: date-time
              example: "2022-03-22T12:34:56.123456Z"
              nullable: true
            previous_score:
              type: integer
              description: The previously-calculated domain's reputation score.
              format: uint32
              nullable: true
            previous_scored_at:
              type: string
              description: Time and date the previous reputation score was calculated.
                (RFC 3339 format)
              format: date-time
              example: "2022-03-22T12:34:56.123456Z"
              nullable: true
          x-properties-order:
          - status
          - score
          - scored_at
          - previous_score
          - previous_scored_at
        records:
          type: object
          description: List of records to configure to validate a domain.
          properties:
            dmarc:
              type: object
              description: DMARC TXT record specification.
              properties:
                name:
                  type: string
                  description: Name of the DMARC TXT record.
                value:
                  type: string
                  description: Value of the DMARC TXT record.
              x-properties-order:
              - name
              - value
            dkim:
              type: object
              description: DKIM TXT record specification.
              properties:
                name:
                  type: string
                  description: Name of the DKIM TXT record.
                value:
                  type: string
                  description: Value of the DKIM TXT record.
              x-properties-order:
              - name
              - value
            spf:
              type: object
              description: SPF TXT record specification.
              properties:
                name:
                  type: string
                  description: Name of the SPF TXT record.
                value:
                  type: string
                  description: Value of the SPF TXT record.
              x-properties-order:
              - name
              - value
            mx:
              type: object
              description: MX record specification.
              properties:
                name:
                  type: string
                  description: Name of the MX record.
                value:
                  type: string
                  description: Value of the MX record.
              x-properties-order:
              - name
              - value
          x-properties-order:
          - dmarc
          - dkim
          - spf
          - mx
        autoconfig:
          type: boolean
          description: Status of auto-configuration for the domain's DNS zone.
        region:
          type: string
          description: The region you want to target
      x-properties-order:
      - id
      - organization_id
      - project_id
      - name
      - status
      - created_at
      - next_check_at
      - last_valid_at
      - revoked_at
      - last_error
      - spf_config
      - dkim_config
      - statistics
      - reputation
      - records
      - autoconfig
      - region
    scaleway.transactional_email.v1alpha1.Domain.Status:
      type: string
      enum:
      - unknown
      - checked
      - unchecked
      - invalid
      - locked
      - revoked
      - pending
      - autoconfiguring
      x-enum-descriptions:
        values:
          unknown: If unspecified, the status of the domain is unknown by default
          checked: The domain is checked
          unchecked: The domain is unchecked
          invalid: The domain is invalid
          locked: The domain is locked
          revoked: The domain is revoked
          pending: The domain is pending, waiting to be checked
          autoconfiguring: The domain is in process of auto-configuration of the domain's
            DNS zone
      default: unknown
    scaleway.transactional_email.v1alpha1.DomainLastStatus:
      type: object
      properties:
        domain_id:
          type: string
          description: The ID of the domain.
        domain_name:
          type: string
          description: The domain name (example.com).
        spf_record:
          type: object
          description: The SPF record verification data.
          properties:
            status:
              type: string
              description: Status of the SPF record's configuration.
              enum:
              - unknown_record_status
              - valid
              - invalid
              - not_found
              x-enum-descriptions:
                values:
                  unknown_record_status: If unspecified, the status of the domain's
                    record is unknown by default
                  valid: The record is valid
                  invalid: The record is invalid
                  not_found: The record was not found
              default: unknown_record_status
            last_valid_at:
              type: string
              description: Time and date the SPF record was last valid. (RFC 3339
                format)
              format: date-time
              example: "2022-03-22T12:34:56.123456Z"
              nullable: true
            error:
              type: string
              description: An error text displays in case the record is not valid.
              nullable: true
          x-properties-order:
          - status
          - last_valid_at
          - error
        dkim_record:
          type: object
          description: The DKIM record verification data.
          properties:
            status:
              type: string
              description: Status of the DKIM record's configuration.
              enum:
              - unknown_record_status
              - valid
              - invalid
              - not_found
              x-enum-descriptions:
                values:
                  unknown_record_status: If unspecified, the status of the domain's
                    record is unknown by default
                  valid: The record is valid
                  invalid: The record is invalid
                  not_found: The record was not found
              default: unknown_record_status
            last_valid_at:
              type: string
              description: Time and date the DKIM record was last valid. (RFC 3339
                format)
              format: date-time
              example: "2022-03-22T12:34:56.123456Z"
              nullable: true
            error:
              type: string
              description: An error text displays in case the record is not valid.
              nullable: true
          x-properties-order:
          - status
          - last_valid_at
          - error
        dmarc_record:
          type: object
          description: The DMARC record verification data.
          properties:
            status:
              type: string
              description: Status of the DMARC record's configuration.
              enum:
              - unknown_record_status
              - valid
              - invalid
              - not_found
              x-enum-descriptions:
                values:
                  unknown_record_status: If unspecified, the status of the domain's
                    record is unknown by default
                  valid: The record is valid
                  invalid: The record is invalid
                  not_found: The record was not found
              default: unknown_record_status
            last_valid_at:
              type: string
              description: Time and date the DMARC record was last valid. (RFC 3339
                format)
              format: date-time
              example: "2022-03-22T12:34:56.123456Z"
              nullable: true
            error:
              type: string
              description: An error text displays in case the record is not valid.
              nullable: true
          x-properties-order:
          - status
          - last_valid_at
          - error
        mx_record:
          type: object
          description: The MX record verification data.
          properties:
            status:
              type: string
              description: |-
                Status of the MX record's configuration.
                Status of the MX record's configuration. This record is optional to validate a domain, but highly recommended.
              enum:
              - unknown_record_status
              - valid
              - invalid
              - not_found
              x-enum-descriptions:
                values:
                  unknown_record_status: If unspecified, the status of the domain's
                    record is unknown by default
                  valid: The record is valid
                  invalid: The record is invalid
                  not_found: The record was not found
              default: unknown_record_status
            last_valid_at:
              type: string
              description: Time and date the MX record was last valid. (RFC 3339 format)
              format: date-time
              example: "2022-03-22T12:34:56.123456Z"
              nullable: true
            error:
              type: string
              description: An error text displays in case the record is not valid.
              nullable: true
          x-properties-order:
          - status
          - last_valid_at
          - error
        autoconfig_state:
          type: object
          description: The verification state of domain auto-configuration.
          properties:
            enabled:
              type: boolean
              description: Enable or disable the auto-configuration of domain DNS
                records.
            autoconfigurable:
              type: boolean
              description: Whether the domain can be auto-configured or not.
            reason:
              type: string
              description: The reason that the domain cannot be auto-configurable.
              enum:
              - unknown_reason
              - permission_denied
              - domain_not_found
              x-enum-descriptions:
                values:
                  unknown_reason: If not specified, the auto-configuration state is
                    unknown by default
                  permission_denied: The token doesn't have the necessary permissions
                    to manage the domain's DNS records
                  domain_not_found: The domain does not exist or isn't manageable
                    by the token
              default: unknown_reason
          x-properties-order:
          - enabled
          - autoconfigurable
          - reason
      x-properties-order:
      - domain_id
      - domain_name
      - spf_record
      - dkim_record
      - dmarc_record
      - mx_record
      - autoconfig_state
    scaleway.transactional_email.v1alpha1.Email:
      type: object
      properties:
        id:
          type: string
          description: Technical ID of the email.
        message_id:
          type: string
          description: Message ID of the email.
        project_id:
          type: string
          description: ID of the Project to which the email belongs.
        mail_from:
          type: string
          description: Email address of the sender.
        rcpt_to:
          type: string
          description: Deprecated. Email address of the recipient.
          deprecated: true
        mail_rcpt:
          type: string
          description: Email address of the recipient.
        rcpt_type:
          type: string
          description: Type of recipient.
          enum:
          - unknown_rcpt_type
          - to
          - cc
          - bcc
          x-enum-descriptions:
            values:
              unknown_rcpt_type: If unspecified, the recipient type is unknown by
                default
              to: Primary recipient
              cc: Carbon copy recipient
              bcc: Blind carbon copy recipient
          default: unknown_rcpt_type
        subject:
          type: string
          description: Subject of the email.
        created_at:
          type: string
          description: Creation date of the email object. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        updated_at:
          type: string
          description: Last update of the email object. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        status:
          type: string
          description: Status of the email.
          enum:
          - unknown
          - new
          - sending
          - sent
          - failed
          - canceled
          x-enum-descriptions:
            values:
              unknown: If unspecified, the status of the email is unknown by default
              new: The email is new
              sending: The email is in the process of being sent
              sent: The email was sent
              failed: The sending of the email failed
              canceled: The sending of the email was canceled
          default: unknown
        status_details:
          type: string
          description: Additional status information.
          nullable: true
        try_count:
          type: integer
          description: Number of attempts to send the email.
          format: uint32
        last_tries:
          type: array
          description: Information about the last three attempts to send the email.
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Email.Try'
        flags:
          type: array
          description: Flags categorize emails. They allow you to obtain more information
            about recurring errors, for example.
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Email.Flag'
      x-properties-order:
      - id
      - message_id
      - project_id
      - mail_from
      - rcpt_to
      - mail_rcpt
      - rcpt_type
      - subject
      - created_at
      - updated_at
      - status
      - status_details
      - try_count
      - last_tries
      - flags
    scaleway.transactional_email.v1alpha1.Email.Flag:
      type: string
      enum:
      - unknown_flag
      - soft_bounce
      - hard_bounce
      - spam
      - mailbox_full
      - mailbox_not_found
      - greylisted
      - send_before_expiration
      - blocklisted
      x-enum-descriptions:
        values:
          unknown_flag: If unspecified, the flag type is unknown by default
          soft_bounce: Refers to a non critical error received while sending the email(s).
            Soft bounced emails are retried
          hard_bounce: Refers to a critical error that happened while sending the
            email(s)
          spam: Refers to an email considered as spam
          mailbox_full: Refers to an undelivered email because the recipient mailbox
            is full
          mailbox_not_found: Refers to an undelivered email because the recipient
            mailbox does not exist
          greylisted: Refers to an email slightly delayed by the recipient to ensure
            that Scaleway is not sending spam
          send_before_expiration: Refers to an email with a `send-before` tag to indicate
            the maximum time limit for the email to be sent
          blocklisted: Refers to an email blocked by a blocklist
      default: unknown_flag
    scaleway.transactional_email.v1alpha1.Email.Status:
      type: string
      enum:
      - unknown
      - new
      - sending
      - sent
      - failed
      - canceled
      x-enum-descriptions:
        values:
          unknown: If unspecified, the status of the email is unknown by default
          new: The email is new
          sending: The email is in the process of being sent
          sent: The email was sent
          failed: The sending of the email failed
          canceled: The sending of the email was canceled
      default: unknown
    scaleway.transactional_email.v1alpha1.Email.Try:
      type: object
      properties:
        rank:
          type: integer
          description: Rank number of this attempt to send the email.
          format: uint32
        tried_at:
          type: string
          description: Date of the attempt to send the email. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        code:
          type: integer
          description: The SMTP status code received after the attempt. 0 if the attempt
            did not reach an SMTP server.
          format: int32
        message:
          type: string
          description: The SMTP message received. If the attempt did not reach an
            SMTP server, the message returned explains what happened.
      x-properties-order:
      - rank
      - tried_at
      - code
      - message
    scaleway.transactional_email.v1alpha1.ListBlocklistsResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Number of blocklists matching the requested criteria.
          format: uint64
        blocklists:
          type: array
          description: Single page of blocklists matching the requested criteria.
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Blocklist'
      x-properties-order:
      - total_count
      - blocklists
    scaleway.transactional_email.v1alpha1.ListDomainsResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Number of domains that match the request (without pagination).
          format: uint32
        domains:
          type: array
          description: Single page of domains matching the requested criteria.
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Domain'
      x-properties-order:
      - total_count
      - domains
    scaleway.transactional_email.v1alpha1.ListEmailsResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Number of emails matching the requested criteria.
          format: uint32
        emails:
          type: array
          description: Single page of emails matching the requested criteria.
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Email'
      x-properties-order:
      - total_count
      - emails
    scaleway.transactional_email.v1alpha1.ListOfferSubscriptionsResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Number of offer-subscriptions matching the requested criteria.
          format: uint64
        offer_subscriptions:
          type: array
          description: Single page of offer-subscriptions matching the requested criteria.
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.OfferSubscription'
      x-properties-order:
      - total_count
      - offer_subscriptions
    scaleway.transactional_email.v1alpha1.ListOffersResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Number of offers matching the requested criteria.
          format: uint64
        offers:
          type: array
          description: Single page of offers matching the requested criteria.
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Offer'
      x-properties-order:
      - total_count
      - offers
    scaleway.transactional_email.v1alpha1.ListPoolsResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Number of pools matching the requested criteria.
          format: uint64
        pools:
          type: array
          description: Single page of pools matching the requested criteria.
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Pool'
      x-properties-order:
      - total_count
      - pools
    scaleway.transactional_email.v1alpha1.ListWebhookEventsResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Number of Webhook events matching the requested criteria.
          format: uint64
        webhook_events:
          type: array
          description: Single page of Webhook events matching the requested criteria.
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.WebhookEvent'
      x-properties-order:
      - total_count
      - webhook_events
    scaleway.transactional_email.v1alpha1.ListWebhooksResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Number of Webhooks matching the requested criteria.
          format: uint64
        webhooks:
          type: array
          description: Single page of Webhooks matching the requested criteria.
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Webhook'
      x-properties-order:
      - total_count
      - webhooks
    scaleway.transactional_email.v1alpha1.Offer:
      type: object
      properties:
        name:
          type: string
          description: Name of the offer.
          enum:
          - unknown_name
          - essential
          - scale
          x-enum-descriptions:
            values:
              unknown_name: If unspecified, the offer name is unknown by default
              essential: The 'essential' offer
              scale: The 'scale' offer
          default: unknown_name
        created_at:
          type: string
          description: Date and time of the offer creation. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        commitment_period:
          type: string
          description: Period of commitment. (in seconds)
          example: 2.5s
          nullable: true
        sla:
          type: number
          description: Service Level Agreement percentage of the offer.
          format: float
        max_domains:
          type: integer
          description: Max number of checked domains that can be associated with the
            offer.
          format: int32
        max_dedicated_ips:
          type: integer
          description: Max number of dedicated IPs that can be associated with the
            offer.
          format: int32
        included_monthly_emails:
          type: integer
          description: Number of emails included in the offer per month.
          format: int32
        max_webhooks_per_domain:
          type: integer
          description: Max number of webhooks that can be associated with the offer.
          format: int32
        max_custom_blocklists_per_domain:
          type: integer
          description: Max number of active custom blocklists that can be associated
            with the offer.
          format: int32
      x-properties-order:
      - name
      - created_at
      - commitment_period
      - sla
      - max_domains
      - max_dedicated_ips
      - included_monthly_emails
      - max_webhooks_per_domain
      - max_custom_blocklists_per_domain
    scaleway.transactional_email.v1alpha1.OfferSubscription:
      type: object
      properties:
        organization_id:
          type: string
          description: ID of the offer-subscription Organization.
        project_id:
          type: string
          description: ID of the offer-subscription Project.
        offer_name:
          type: string
          description: Name of the offer associated with the Project.
          enum:
          - unknown_name
          - essential
          - scale
          x-enum-descriptions:
            values:
              unknown_name: If unspecified, the offer name is unknown by default
              essential: The 'essential' offer
              scale: The 'scale' offer
          default: unknown_name
        subscribed_at:
          type: string
          description: Date and time of the subscription. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        cancellation_available_at:
          type: string
          description: Date and time of the end of the offer-subscription commitment.
            (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        sla:
          type: number
          description: Service Level Agreement percentage of the offer-subscription.
          format: float
        max_domains:
          type: integer
          description: Max number of domains that can be associated with the offer-subscription
            for a particular Project.
          format: int32
        max_dedicated_ips:
          type: integer
          description: Max number of dedicated IPs that can be associated with the
            offer-subscription for a particular Project.
          format: int32
        max_webhooks_per_domain:
          type: integer
          description: Max number of webhooks that can be associated with the offer-subscription
            for a particular Project.
          format: int32
        max_custom_blocklists_per_domain:
          type: integer
          description: Max number of custom blocklists that can be associated with
            the offer-subscription for a particular Project.
          format: int32
        included_monthly_emails:
          type: integer
          description: Number of emails included in the offer-subscription per month.
          format: int32
      x-properties-order:
      - organization_id
      - project_id
      - offer_name
      - subscribed_at
      - cancellation_available_at
      - sla
      - max_domains
      - max_dedicated_ips
      - max_webhooks_per_domain
      - max_custom_blocklists_per_domain
      - included_monthly_emails
    scaleway.transactional_email.v1alpha1.Pool:
      type: object
      properties:
        project_id:
          type: string
          description: ID of the Project.
        status:
          type: string
          description: Status of the pool.
          enum:
          - unknown_status
          - disabled
          - creating
          - ready
          - error
          x-enum-descriptions:
            values:
              unknown_status: If unspecified, the status is unknown by default
              disabled: The pool is disabled
              creating: The pool is being created
              ready: The pool is ready to be used
              error: The pool has an error status
          default: unknown_status
        details:
          type: string
          description: Details of the pool.
          nullable: true
        zone:
          type: string
          description: Zone of the pool.
          nullable: true
        ips:
          type: array
          description: IPs of the pool. (IP address)
          example:
          - 1.2.3.4
          items:
            type: string
        reverse:
          type: string
          description: Reverse hostname of all IPs of the pool.
          nullable: true
      x-properties-order:
      - project_id
      - status
      - details
      - zone
      - ips
      - reverse
    scaleway.transactional_email.v1alpha1.ProjectConsumption:
      type: object
      properties:
        project_id:
          type: string
          description: ID of the project.
        domains_count:
          type: integer
          description: Number of domains in the project.
          format: int32
        dedicated_ips_count:
          type: integer
          description: Number of dedicated IP in the project.
          format: int32
        monthly_emails_count:
          type: integer
          description: Number of emails sent during the current month in the project.
          format: int32
        webhooks_count:
          type: integer
          description: Number of webhooks in the project.
          format: int32
        custom_blocklists_count:
          type: integer
          description: Number of custom blocklists in the project.
          format: int32
      x-properties-order:
      - project_id
      - domains_count
      - dedicated_ips_count
      - monthly_emails_count
      - webhooks_count
      - custom_blocklists_count
    scaleway.transactional_email.v1alpha1.ProjectSettings:
      type: object
      properties:
        periodic_report:
          type: object
          description: Information about your periodic report.
          properties:
            enabled:
              type: boolean
              description: Enable or disable periodic report notifications.
            frequency:
              type: string
              description: At which frequency you receive periodic report notifications.
              enum:
              - unknown_frequency
              - monthly
              - weekly
              - daily
              x-enum-descriptions:
                values:
                  unknown_frequency: If unspecified, the frequency is unknown by default
                  monthly: The periodic report is sent once a month
                  weekly: The periodic report is sent once a week
                  daily: The periodic report is sent once a day
              default: unknown_frequency
            sending_hour:
              type: integer
              description: At which hour you receive periodic report notifications.
              format: uint32
            sending_day:
              type: integer
              description: On which day you receive periodic report notifications
                (1-7 weekly, 1-28 monthly).
              format: uint32
          x-properties-order:
          - enabled
          - frequency
          - sending_hour
          - sending_day
      x-properties-order:
      - periodic_report
    scaleway.transactional_email.v1alpha1.Statistics:
      type: object
      properties:
        total_count:
          type: integer
          description: Total number of emails matching the requested criteria.
          format: uint32
        new_count:
          type: integer
          description: Number of emails still in the `new` transient state. This means
            emails received from the API but not yet processed.
          format: uint32
        sending_count:
          type: integer
          description: Number of emails still in the `sending` transient state. This
            means emails received from the API but not yet in their final status.
          format: uint32
        sent_count:
          type: integer
          description: Number of emails in the final `sent` state. This means emails
            that have been delivered to the target mail system.
          format: uint32
        failed_count:
          type: integer
          description: Number of emails in the final `failed` state. This means emails
            that have been refused by the target mail system with a final error status.
          format: uint32
        canceled_count:
          type: integer
          description: Number of emails in the final `canceled` state. This means
            emails that have been canceled upon request.
          format: uint32
      x-properties-order:
      - total_count
      - new_count
      - sending_count
      - sent_count
      - failed_count
      - canceled_count
    scaleway.transactional_email.v1alpha1.Webhook:
      type: object
      properties:
        id:
          type: string
          description: ID of the Webhook.
        domain_id:
          type: string
          description: ID of the Domain to watch for triggering events.
        organization_id:
          type: string
          description: ID of the Webhook Organization.
        project_id:
          type: string
          description: ID of the Webhook Project.
        name:
          type: string
          description: Name of the Webhook.
        event_types:
          type: array
          description: List of event types that will trigger a Webhook Event.
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.WebhookEvent.Type'
        sns_arn:
          type: string
          description: Scaleway SNS ARN topic to push the events to.
        created_at:
          type: string
          description: Date and time of the Webhook creation. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        updated_at:
          type: string
          description: Date and time of last Webhook updates. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
      x-properties-order:
      - id
      - domain_id
      - organization_id
      - project_id
      - name
      - event_types
      - sns_arn
      - created_at
      - updated_at
    scaleway.transactional_email.v1alpha1.WebhookEvent:
      type: object
      properties:
        id:
          type: string
          description: ID of the Webhook Event.
        webhook_id:
          type: string
          description: ID of the Webhook that triggers the Event.
        organization_id:
          type: string
          description: ID of the Webhook Event Organization.
        project_id:
          type: string
          description: ID of the Webhook Event Project.
        domain_id:
          type: string
          description: ID of the webhook event domain.
        type:
          type: string
          description: Type of the Webhook Event.
          enum:
          - unknown_type
          - email_queued
          - email_dropped
          - email_deferred
          - email_delivered
          - email_spam
          - email_mailbox_not_found
          - email_blocklisted
          - blocklist_created
          x-enum-descriptions:
            values:
              unknown_type: If unspecified, the type of the Webhook Event is unknown
                by default
              email_queued: The email was received and is in preparation to be sent
                to the recipient servers
              email_dropped: The email was sent but hard-bounced by the recipient
                server
              email_deferred: The email was sent but soft-bounced by the recipient
                server. In this case, the sending of the email will be automatically
                retried
              email_delivered: The email was successfully sent
              email_spam: The email resource was identified as spam by Scaleway or
                by the recipient server
              email_mailbox_not_found: The email hard-bounced with a "mailbox not
                found" error
              email_blocklisted: The email was blocked before it was sent, as the
                recipient matches a blocklist
              blocklist_created: A new blocklist is created
          default: unknown_type
        status:
          type: string
          description: Status of the Webhook Event.
          enum:
          - unknown_status
          - sending
          - sent
          - failed
          x-enum-descriptions:
            values:
              unknown_status: If unspecified, the status of the Webhook event is unknown
                by default
              sending: The Webhook event is being sent
              sent: The Webhook event was sent
              failed: The Webhook event cannot be sent after multiple retries
          default: unknown_status
        data:
          type: string
          description: Data sent to the Webhook destination.
        created_at:
          type: string
          description: Date and time of the Webhook Event creation. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        updated_at:
          type: string
          description: Date and time of last Webhook Event updates. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        email_id:
          type: string
          description: Optional Email ID if the event is triggered by an Email resource.
          nullable: true
      x-properties-order:
      - id
      - webhook_id
      - organization_id
      - project_id
      - domain_id
      - type
      - status
      - data
      - created_at
      - updated_at
      - email_id
    scaleway.transactional_email.v1alpha1.WebhookEvent.Status:
      type: string
      enum:
      - unknown_status
      - sending
      - sent
      - failed
      x-enum-descriptions:
        values:
          unknown_status: If unspecified, the status of the Webhook event is unknown
            by default
          sending: The Webhook event is being sent
          sent: The Webhook event was sent
          failed: The Webhook event cannot be sent after multiple retries
      default: unknown_status
    scaleway.transactional_email.v1alpha1.WebhookEvent.Type:
      type: string
      enum:
      - unknown_type
      - email_queued
      - email_dropped
      - email_deferred
      - email_delivered
      - email_spam
      - email_mailbox_not_found
      - email_blocklisted
      - blocklist_created
      x-enum-descriptions:
        values:
          unknown_type: If unspecified, the type of the Webhook Event is unknown by
            default
          email_queued: The email was received and is in preparation to be sent to
            the recipient servers
          email_dropped: The email was sent but hard-bounced by the recipient server
          email_deferred: The email was sent but soft-bounced by the recipient server.
            In this case, the sending of the email will be automatically retried
          email_delivered: The email was successfully sent
          email_spam: The email resource was identified as spam by Scaleway or by
            the recipient server
          email_mailbox_not_found: The email hard-bounced with a "mailbox not found"
            error
          email_blocklisted: The email was blocked before it was sent, as the recipient
            matches a blocklist
          blocklist_created: A new blocklist is created
      default: unknown_type
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /transactional-email/v1alpha1/regions/{region}/blocklists:
    get:
      tags:
      - Blocklist
      operationId: ListBlocklists
      summary: List blocklists
      description: Retrieve the list of blocklists.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: query
        name: order_by
        description: (Optional) List blocklist corresponding to specific criteria.
        schema:
          type: string
          enum:
          - created_at_desc
          - created_at_asc
          - ends_at_desc
          - ends_at_asc
          x-enum-descriptions:
            values:
              created_at_desc: Order by creation date (descending chronological order)
              created_at_asc: Order by creation date (ascending chronological order)
              ends_at_desc: Order by blocklist ends date (descending chronological
                order)
              ends_at_asc: Order by blocklist ends date (ascending chronological order)
          default: created_at_desc
      - in: query
        name: page
        description: (Optional) Requested page number. Value must be greater or equal
          to 1.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: (Optional) Requested page size. Value must be between 1 and 100.
        schema:
          type: integer
          format: uint32
      - in: query
        name: domain_id
        description: (Optional) Filter by a domain ID. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: email
        description: (Optional) Filter by an email address.
        schema:
          type: string
      - in: query
        name: type
        description: (Optional) Filter by a blocklist type.
        schema:
          type: string
          enum:
          - unknown_type
          - mailbox_full
          - mailbox_not_found
          x-enum-descriptions:
            values:
              unknown_type: If unspecified, the type of blocklist is unknown by default
              mailbox_full: The recipient's mailbox is full and cannot receive any
                new email
              mailbox_not_found: The recipient's mailbox does not exist
          default: unknown_type
      - in: query
        name: custom
        description: (Optional) Filter by custom blocklist (true) or automatic Transactional
          Email blocklist (false).
        schema:
          type: boolean
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.ListBlocklistsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/blocklists?domain_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/blocklists" \
            X-Auth-Token:$SCW_SECRET_KEY \
            domain_id==6170692e-7363-616c-6577-61792e636f6d
    post:
      tags:
      - Blocklist
      operationId: BulkCreateBlocklists
      summary: Bulk create blocklists
      description: Create multiple blocklists in a specific Project or Organization
        using the `region` parameter.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.BulkCreateBlocklistsResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                domain_id:
                  type: string
                  description: Domain ID linked to the blocklist. (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                emails:
                  type: array
                  description: Email blocked by the blocklist.
                  items:
                    type: string
                type:
                  type: string
                  description: Type of blocklist.
                  enum:
                  - unknown_type
                  - mailbox_full
                  - mailbox_not_found
                  x-enum-descriptions:
                    values:
                      unknown_type: If unspecified, the type of blocklist is unknown
                        by default
                      mailbox_full: The recipient's mailbox is full and cannot receive
                        any new email
                      mailbox_not_found: The recipient's mailbox does not exist
                  default: unknown_type
                reason:
                  type: string
                  description: Reason to block the email.
                  nullable: true
              x-properties-order:
              - domain_id
              - emails
              - type
              - reason
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"domain_id":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/blocklists"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/blocklists" \
            X-Auth-Token:$SCW_SECRET_KEY \
            domain_id="6170692e-7363-616c-6577-61792e636f6d"
  /transactional-email/v1alpha1/regions/{region}/blocklists/{blocklist_id}:
    delete:
      tags:
      - Blocklist
      operationId: DeleteBlocklist
      summary: Delete a blocklist
      description: You must specify the blocklist you want to delete by the `region`
        and `blocklist_id`.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: blocklist_id
        description: ID of the blocklist to delete. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/blocklists/{blocklist_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/blocklists/{blocklist_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /transactional-email/v1alpha1/regions/{region}/domains:
    get:
      tags:
      - Domains
      operationId: ListDomains
      summary: List domains
      description: Retrieve domains in a specific Project or in a specific Organization
        using the `region` parameter.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: query
        name: page
        description: Requested page number. Value must be greater or equal to 1.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Requested page size. Value must be between 1 and 1000.
        schema:
          type: integer
          format: uint32
      - in: query
        name: project_id
        description: (Optional) ID of the Project in which to list the domains. (UUID
          format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: status
        description: (Optional) List domains under specific statuses.
        schema:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Domain.Status'
      - in: query
        name: organization_id
        description: (Optional) ID of the Organization in which to list the domains.
          (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: name
        description: (Optional) Names of the domains to list.
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.ListDomainsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains" \
            X-Auth-Token:$SCW_SECRET_KEY
    post:
      tags:
      - Domains
      operationId: CreateDomain
      summary: Register a domain in a project
      description: You must specify the `region`, `project_id` and `domain_name` to
        register a domain in a specific Project.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Domain'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the project to which the domain belongs. (UUID
                    format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                domain_name:
                  type: string
                  description: Fully qualified domain dame.
                accept_tos:
                  type: boolean
                  description: Deprecated. Accept Scaleway's Terms of Service.
                  deprecated: true
                autoconfig:
                  type: boolean
                  description: Activate auto-configuration of the domain's DNS zone.
              x-properties-order:
              - project_id
              - domain_name
              - accept_tos
              - autoconfig
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{
              "accept_tos": false,
              "autoconfig": false,
              "domain_name": "string",
              "project_id": "6170692e-7363-616c-6577-61792e636f6d"
            }' \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains" \
            X-Auth-Token:$SCW_SECRET_KEY \
            accept_tos:=false \
            autoconfig:=false \
            domain_name="string" \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /transactional-email/v1alpha1/regions/{region}/domains/{domain_id}:
    get:
      tags:
      - Domains
      operationId: GetDomain
      summary: Get information about a domain
      description: Retrieve information about a specific domain using the `region`
        and `domain_id` parameters. Monitor your domain's reputation and improve **average**
        and **bad** reputation statuses, using your domain's **Email activity** tab
        on the [Scaleway console](https://console.scaleway.com/transactional-email/domains)
        to get a more detailed report. Check out our [dedicated documentation](https://www.scaleway.com/en/docs/managed-services/transactional-email/reference-content/understanding-tem-reputation-score/)
        to improve your domain's reputation.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: domain_id
        description: ID of the domain. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Domain'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains/{domain_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains/{domain_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - Domains
      operationId: UpdateDomain
      summary: Update a domain
      description: Update a domain auto-configuration.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: domain_id
        description: ID of the domain to update. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Domain'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                autoconfig:
                  type: boolean
                  description: (Optional) If set to true, activate auto-configuration
                    of the domain's DNS zone.
                  nullable: true
              x-properties-order:
              - autoconfig
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X PATCH \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains/{domain_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains/{domain_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /transactional-email/v1alpha1/regions/{region}/domains/{domain_id}/check:
    post:
      tags:
      - Domains
      operationId: CheckDomain
      summary: Domain DNS check
      description: Perform an immediate DNS check of a domain using the `region` and
        `domain_id` parameters.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: domain_id
        description: ID of the domain to check. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Domain'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains/{domain_id}/check"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains/{domain_id}/check" \
            X-Auth-Token:$SCW_SECRET_KEY
  /transactional-email/v1alpha1/regions/{region}/domains/{domain_id}/revoke:
    post:
      tags:
      - Domains
      operationId: RevokeDomain
      summary: Delete a domain
      description: You must specify the domain you want to delete by the `region`
        and `domain_id`. Deleting a domain is permanent and cannot be undone.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: domain_id
        description: ID of the domain to delete. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Domain'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains/{domain_id}/revoke"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains/{domain_id}/revoke" \
            X-Auth-Token:$SCW_SECRET_KEY
  /transactional-email/v1alpha1/regions/{region}/domains/{domain_id}/verification:
    get:
      tags:
      - Domains
      operationId: GetDomainLastStatus
      summary: Display SPF, DKIM, DMARC and MX records status and potential errors
      description: Display SPF, DKIM, DMARC and MX records status and potential errors,
        including the found records to make debugging easier.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: domain_id
        description: ID of the domain to get records status. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.DomainLastStatus'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains/{domain_id}/verification"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/domains/{domain_id}/verification" \
            X-Auth-Token:$SCW_SECRET_KEY
  /transactional-email/v1alpha1/regions/{region}/emails:
    get:
      tags:
      - Emails
      operationId: ListEmails
      summary: List emails
      description: Retrieve the list of emails sent from a specific domain or for
        a specific Project or Organization. You must specify the `region`.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: query
        name: page
        schema:
          $ref: '#/components/schemas/google.protobuf.Int32Value'
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      - in: query
        name: project_id
        description: (Optional) ID of the Project in which to list the emails. (UUID
          format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: domain_id
        description: (Optional) ID of the domain for which to list the emails. (UUID
          format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: message_id
        description: (Optional) ID of the message for which to list the emails. (UUID
          format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: since
        description: (Optional) List emails created after this date. (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: until
        description: (Optional) List emails created before this date. (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: mail_from
        description: (Optional) List emails sent with this sender's email address.
        schema:
          type: string
      - in: query
        name: mail_to
        description: Deprecated. List emails sent to this recipient's email address.
        schema:
          type: string
          deprecated: true
      - in: query
        name: mail_rcpt
        description: (Optional) List emails sent to this recipient's email address.
        schema:
          type: string
      - in: query
        name: statuses
        description: (Optional) List emails with any of these statuses.
        schema:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Email.Status'
      - in: query
        name: subject
        description: (Optional) List emails with this subject.
        schema:
          type: string
      - in: query
        name: search
        description: (Optional) List emails by searching to all fields.
        schema:
          type: string
      - in: query
        name: order_by
        description: (Optional) List emails corresponding to specific criteria.
        schema:
          type: string
          enum:
          - created_at_desc
          - created_at_asc
          - updated_at_desc
          - updated_at_asc
          - status_desc
          - status_asc
          - mail_from_desc
          - mail_from_asc
          - mail_rcpt_desc
          - mail_rcpt_asc
          - subject_desc
          - subject_asc
          x-enum-descriptions:
            values:
              created_at_desc: Order by creation date (descending chronological order)
              created_at_asc: Order by creation date (ascending chronological order)
              updated_at_desc: Order by last update date (descending chronological
                order)
              updated_at_asc: Order by last update date (ascending chronological order)
              status_desc: Order by status (descending alphabetical order)
              status_asc: Order by status (ascending alphabetical order)
              mail_from_desc: Order by mail_from (descending alphabetical order)
              mail_from_asc: Order by mail_from (ascending alphabetical order)
              mail_rcpt_desc: Order by mail recipient (descending alphabetical order)
              mail_rcpt_asc: Order by mail recipient (ascending alphabetical order)
              subject_desc: Order by subject (descending alphabetical order)
              subject_asc: Order by subject (ascending alphabetical order)
          default: created_at_desc
      - in: query
        name: flags
        description: (Optional) List emails containing only specific flags.
        schema:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Email.Flag'
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.ListEmailsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/emails"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/emails" \
            X-Auth-Token:$SCW_SECRET_KEY
    post:
      tags:
      - Emails
      operationId: CreateEmail
      summary: Send an email
      description: You must specify the `region`, the sender and the recipient's information
        and the `project_id` to send an email from a checked domain.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.CreateEmailResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from:
                  type: object
                  description: Sender information. Must be from a checked domain declared
                    in the Project.
                  properties:
                    email:
                      type: string
                      description: Email address.
                    name:
                      type: string
                      description: (Optional) Name displayed.
                      nullable: true
                  x-properties-order:
                  - email
                  - name
                to:
                  type: array
                  description: An array of the primary recipient's information.
                  items:
                    $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.CreateEmailRequest.Address'
                cc:
                  type: array
                  description: An array of the carbon copy recipient's information.
                  items:
                    $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.CreateEmailRequest.Address'
                bcc:
                  type: array
                  description: An array of the blind carbon copy recipient's information.
                  items:
                    $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.CreateEmailRequest.Address'
                subject:
                  type: string
                  description: Subject of the email.
                text:
                  type: string
                  description: Text content.
                html:
                  type: string
                  description: HTML content.
                project_id:
                  type: string
                  description: ID of the Project in which to create the email. (UUID
                    format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                attachments:
                  type: array
                  description: Array of attachments.
                  items:
                    $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.CreateEmailRequest.Attachment'
                send_before:
                  type: string
                  description: Maximum date to deliver the email. (RFC 3339 format)
                  format: date-time
                  example: "2022-03-22T12:34:56.123456Z"
                  nullable: true
                additional_headers:
                  type: array
                  description: Array of additional headers as key-value.
                  items:
                    $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.CreateEmailRequest.Header'
              required:
              - from
              x-properties-order:
              - from
              - to
              - cc
              - bcc
              - subject
              - text
              - html
              - project_id
              - attachments
              - send_before
              - additional_headers
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{
              "from": {
                  "email": "string",
                  "name": "string"
              },
              "html": "string",
              "project_id": "6170692e-7363-616c-6577-61792e636f6d",
              "subject": "string",
              "text": "string"
            }' \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/emails"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/emails" \
            X-Auth-Token:$SCW_SECRET_KEY \
            from:='{
              "email": "string",
              "name": "string"
            }' \
            html="string" \
            project_id="6170692e-7363-616c-6577-61792e636f6d" \
            subject="string" \
            text="string"
  /transactional-email/v1alpha1/regions/{region}/emails/{email_id}:
    get:
      tags:
      - Emails
      operationId: GetEmail
      summary: Get an email
      description: Retrieve information about a specific email using the `email_id`
        and `region` parameters.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: email_id
        description: ID of the email to retrieve. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Email'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/emails/{email_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/emails/{email_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /transactional-email/v1alpha1/regions/{region}/emails/{email_id}/cancel:
    post:
      tags:
      - Emails
      operationId: CancelEmail
      summary: Cancel an email
      description: You can cancel the sending of an email if it has not been sent
        yet. You must specify the `region` and the `email_id` of the email you want
        to cancel.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: email_id
        description: ID of the email to cancel. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Email'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/emails/{email_id}/cancel"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/emails/{email_id}/cancel" \
            X-Auth-Token:$SCW_SECRET_KEY
  /transactional-email/v1alpha1/regions/{region}/offer-subscriptions:
    get:
      tags:
      - offers
      operationId: ListOfferSubscriptions
      summary: Get information about subscribed offers
      description: Retrieve information about the offers you are subscribed to using
        the `project_id` and `region` parameters.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: query
        name: project_id
        description: ID of the Project. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.ListOfferSubscriptionsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/offer-subscriptions?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/offer-subscriptions" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
    patch:
      tags:
      - offers
      operationId: UpdateOfferSubscription
      summary: Update a subscribed offer
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.OfferSubscription'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project. (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                name:
                  type: string
                  description: Name of the offer-subscription.
                  enum:
                  - unknown_name
                  - essential
                  - scale
                  x-enum-descriptions:
                    values:
                      unknown_name: If unspecified, the offer name is unknown by default
                      essential: The 'essential' offer
                      scale: The 'scale' offer
                  default: unknown_name
              x-properties-order:
              - project_id
              - name
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X PATCH \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"project_id":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/offer-subscriptions"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/offer-subscriptions" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /transactional-email/v1alpha1/regions/{region}/offers:
    get:
      tags:
      - offers
      operationId: ListOffers
      summary: List the available offers.
      description: Retrieve the list of the available and free-of-charge offers you
        can subscribe to.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.ListOffersResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/offers"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/offers" \
            X-Auth-Token:$SCW_SECRET_KEY
  /transactional-email/v1alpha1/regions/{region}/pools:
    get:
      tags:
      - offers
      operationId: ListPools
      summary: Get information about a sending pool.
      description: Retrieve information about a sending pool, including its creation
        status and configuration parameters.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: query
        name: page
        description: Requested page number. Value must be greater or equal to 1.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Requested page size. Value must be between 1 and 1000.
        schema:
          type: integer
          format: uint32
      - in: query
        name: project_id
        description: ID of the Project. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.ListPoolsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/pools?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/pools" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
  /transactional-email/v1alpha1/regions/{region}/project-consumption:
    get:
      tags:
      - Project Consumption
      operationId: GetProjectConsumption
      summary: Get project resource consumption.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: query
        name: project_id
        description: ID of the project. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.ProjectConsumption'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/project-consumption?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/project-consumption" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
  /transactional-email/v1alpha1/regions/{region}/project/{project_id}/settings:
    get:
      tags:
      - Project Settings
      operationId: GetProjectSettings
      summary: List project settings
      description: Retrieve the project settings including periodic reports.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: project_id
        description: ID of the project. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.ProjectSettings'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/project/{project_id}/settings"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/project/{project_id}/settings" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - Project Settings
      operationId: UpdateProjectSettings
      summary: Update project settings
      description: Update the project settings including periodic reports.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: project_id
        description: ID of the project. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.ProjectSettings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                periodic_report:
                  type: object
                  description: Periodic report update details - all fields are optional.
                  properties:
                    enabled:
                      type: boolean
                      description: (Optional) Enable or disable periodic report notifications.
                      nullable: true
                    frequency:
                      type: string
                      description: (Optional) Frequency at which you receive periodic
                        report notifications.
                      enum:
                      - unknown_frequency
                      - monthly
                      - weekly
                      - daily
                      x-enum-descriptions:
                        values:
                          unknown_frequency: If unspecified, the frequency is unknown
                            by default
                          monthly: The periodic report is sent once a month
                          weekly: The periodic report is sent once a week
                          daily: The periodic report is sent once a day
                      default: unknown_frequency
                    sending_hour:
                      type: integer
                      description: (Optional) Hour at which you receive periodic report
                        notifications.
                      format: uint32
                      nullable: true
                    sending_day:
                      type: integer
                      description: (Optional) On which day you receive periodic report
                        notifications (1-7 weekly, 1-28 monthly).
                      format: uint32
                      nullable: true
                  x-properties-order:
                  - enabled
                  - frequency
                  - sending_hour
                  - sending_day
              x-properties-order:
              - periodic_report
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X PATCH \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/project/{project_id}/settings"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/project/{project_id}/settings" \
            X-Auth-Token:$SCW_SECRET_KEY
  /transactional-email/v1alpha1/regions/{region}/statistics:
    get:
      tags:
      - Statistics
      operationId: GetStatistics
      summary: Email statuses
      description: Get information on your emails' statuses.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: query
        name: project_id
        description: (Optional) Number of emails for this Project. (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: domain_id
        description: (Optional) Number of emails sent from this domain (must be coherent
          with the `project_id` and the `organization_id`). (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: since
        description: (Optional) Number of emails created after this date. (RFC 3339
          format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: until
        description: (Optional) Number of emails created before this date. (RFC 3339
          format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: mail_from
        description: (Optional) Number of emails sent with this sender's email address.
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Statistics'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/statistics"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/statistics" \
            X-Auth-Token:$SCW_SECRET_KEY
  /transactional-email/v1alpha1/regions/{region}/webhooks:
    get:
      tags:
      - Webhooks
      operationId: ListWebhooks
      summary: List Webhooks
      description: Retrieve Webhooks in a specific Project or in a specific Organization
        using the `region` parameter.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: query
        name: order_by
        description: (Optional) List Webhooks corresponding to specific criteria.
        schema:
          type: string
          enum:
          - created_at_desc
          - created_at_asc
          default: created_at_desc
      - in: query
        name: page
        description: (Optional) Requested page number. Value must be greater or equal
          to 1.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: (Optional) Requested page size. Value must be between 1 and 100.
        schema:
          type: integer
          format: uint32
      - in: query
        name: project_id
        description: (Optional) ID of the Project for which to list the Webhooks.
          (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: organization_id
        description: (Optional) ID of the Organization for which to list the Webhooks.
          (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: domain_id
        description: (Optional) ID of the Domain for which to list the Webhooks. (UUID
          format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.ListWebhooksResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/webhooks"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/webhooks" \
            X-Auth-Token:$SCW_SECRET_KEY
    post:
      tags:
      - Webhooks
      operationId: CreateWebhook
      summary: Create a Webhook
      description: Create a new Webhook triggered by a list of event types and pushed
        to a Scaleway SNS ARN.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Webhook'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                domain_id:
                  type: string
                  description: ID of the Domain to watch for triggering events. (UUID
                    format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                project_id:
                  type: string
                  description: ID of the project to which the Webhook belongs. (UUID
                    format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                name:
                  type: string
                  description: Name of the Webhook.
                event_types:
                  type: array
                  description: List of event types that will trigger an event.
                  items:
                    $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.WebhookEvent.Type'
                sns_arn:
                  type: string
                  description: Scaleway SNS ARN topic to push the events to.
              x-properties-order:
              - domain_id
              - project_id
              - name
              - event_types
              - sns_arn
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{
              "domain_id": "6170692e-7363-616c-6577-61792e636f6d",
              "name": "string",
              "project_id": "6170692e-7363-616c-6577-61792e636f6d",
              "sns_arn": "string"
            }' \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/webhooks"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/webhooks" \
            X-Auth-Token:$SCW_SECRET_KEY \
            domain_id="6170692e-7363-616c-6577-61792e636f6d" \
            name="string" \
            project_id="6170692e-7363-616c-6577-61792e636f6d" \
            sns_arn="string"
  /transactional-email/v1alpha1/regions/{region}/webhooks/{webhook_id}:
    get:
      tags:
      - Webhooks
      operationId: GetWebhook
      summary: Get information about a Webhook
      description: Retrieve information about a specific Webhook using the `webhook_id`
        and `region` parameters.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: webhook_id
        description: ID of the Webhook to check. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Webhook'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/webhooks/{webhook_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/webhooks/{webhook_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - Webhooks
      operationId: UpdateWebhook
      summary: Update a Webhook
      description: Update a Webhook events type, SNS ARN or name.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: webhook_id
        description: ID of the Webhook to update. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.Webhook'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the Webhook to update.
                  nullable: true
                event_types:
                  type: array
                  description: List of event types to update.
                  items:
                    $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.WebhookEvent.Type'
                sns_arn:
                  type: string
                  description: Scaleway SNS ARN topic to update.
                  nullable: true
              x-properties-order:
              - name
              - event_types
              - sns_arn
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X PATCH \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/webhooks/{webhook_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/webhooks/{webhook_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - Webhooks
      operationId: DeleteWebhook
      summary: Delete a Webhook
      description: You must specify the Webhook you want to delete by the `region`
        and `webhook_id`. Deleting a Webhook is permanent and cannot be undone.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: webhook_id
        description: ID of the Webhook to delete. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/webhooks/{webhook_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/webhooks/{webhook_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /transactional-email/v1alpha1/regions/{region}/webhooks/{webhook_id}/events:
    get:
      tags:
      - Webhooks
      operationId: ListWebhookEvents
      summary: List Webhook triggered events
      description: Retrieve the list of Webhook events triggered from a specific Webhook
        or for a specific Project or Organization. You must specify the `region`.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: webhook_id
        description: ID of the Webhook linked to the events. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: order_by
        description: (Optional) List Webhook events corresponding to specific criteria.
        schema:
          type: string
          enum:
          - created_at_desc
          - created_at_asc
          default: created_at_desc
      - in: query
        name: page
        description: Requested page number. Value must be greater or equal to 1.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Requested page size. Value must be between 1 and 100.
        schema:
          type: integer
          format: uint32
      - in: query
        name: email_id
        description: ID of the email linked to the events. (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: event_types
        description: List of event types linked to the events.
        schema:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.WebhookEvent.Type'
      - in: query
        name: statuses
        description: List of event statuses.
        schema:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.WebhookEvent.Status'
      - in: query
        name: project_id
        description: ID of the webhook Project. (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: organization_id
        description: ID of the webhook Organization. (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: domain_id
        description: ID of the domain to watch for triggering events. (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.transactional_email.v1alpha1.ListWebhookEventsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/webhooks/{webhook_id}/events"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/transactional-email/v1alpha1/regions/{region}/webhooks/{webhook_id}/events" \
            X-Auth-Token:$SCW_SECRET_KEY
