openapi: 3.1.0
info:
  title: Audit Trail API
  description: |-
    Scaleway Audit Trail is a tool that holds a record of events and changes performed within a Scaleway Organization. It helps you ensure accountability and security by recording activity across all your resources (identity of the principal, date of activity, source IP address, API method used, and status of the request).

    You can use Audit Trail for troubleshooting, compliance verification, and analysis in the event of a breach.




    ## Concepts

    Refer to our [dedicated concepts page](https://www.scaleway.com/en/docs/audit-trail/concepts/) to find definitions of the different terms referring to Audit Trail.




    ## Quickstart

    To start using Audit Trail you need to configure the `AuditTrailReadOnly` or the `OrganizationManager` permission sets in [IAM](https://www.scaleway.com/en/docs/iam/concepts/).
    The `OrganizationManager` permission set is included in the `Administrator` group which is created by default whenever a new Organization is created.
    The [scope](https://www.scaleway.com/en/docs/iam/concepts/#scope) of these permission sets is at [Organization](https://www.scaleway.com/en/docs/iam/concepts/#organization) level.

    1. Configure your environment variables.

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

        ```bash
        export ACCESS_KEY="<access-key>"
        export SECRET_KEY="<secret-key>"
        export REGION="<region>"
        ```
    2. Create an IAM policy. Replace the parameter values in the request payload with the details of your principal.

        ```bash
            curl -X POST \
            -H "Content-Type: application/json" \
            -H "X-Auth-Token: $SCW_SECRET_KEY" https://api.scaleway.com/iam/v1alpha1/policies \
            -d '{
            "name": "policy-audit-trail",
            "description": "This policy grants read access to Audit Trail in my Organization to the user matching the userID defined below",
            "organization_id": "123e4567-e89b-12d3-a456-426614174000",
            "rules": [
                {
                "permission_set_names": [
                    "AuditTrailReadOnly"
                ],
                "organization_id": "123e4567-e89b-12d3-a456-426614174000"
                }
            ],
            "user_id": "987f6543-21ba-43dc-b678-567812345678"
            }'

        ```

        | Parameter        | Description                                   |
        | :--------------- | :--------------------------------------       |
        | `name`           | **REQUIRED** The name of your new policy |
        | `description`| The description of your policy          |
        | `organization_id`| The ID of your Scaleway Organization |
        | `rules`| The [rules](https://www.scaleway.com/en/docs/iam/reference-content/policy/#rules) of your policy |
        | `permission_set_names` | The permission sets you want to grant. You can either [list all permission sets using the IAM API](https://www.scaleway.com/en/developers/api/iam/#path-permission-sets-list-permission-sets) or find a complete list in the [permission sets documentation page](https://www.scaleway.com/en/docs/iam/reference-content/permission-sets/) |
        | `organization_id`| The ID of the Scaleway Organization where you want your permission sets to apply. You can add one as the [scope](https://www.scaleway.com/en/docs/iam/reference-content/policy/#scope) of your policy |
        | `user_id`| The ID of the user you are granting access to |

        <Message type="note">
        To learn more about IAM policies, refer to our dedicated [IAM policies reference page](https://www.scaleway.com/en/docs/iam/reference-content/policy/).
        </Message>

    3. Run the following command to retrieve the list of Scaleway products for which you have Audit Trail events.

            ```bash
            curl --request GET \
                --url https://api.scaleway.com/audit-trail/v1alpha1/$REGION/fr-par/products \
                --header "X-Auth-Token: $SCW_SECRET_KEY"
            ```

    4. Run the following command to list your Audit Trail events.

            ```bash
            curl --request GET \
                --url "https://api.scaleway.com/audit-trail/v1alpha1/regions/$REGION/events?organization_id=123e4567-e89b-12d3-a456-426614174000" \
                --header "X-Auth-Token: $SCW_SECRET_KEY"

            ```
        <Message type="note">
        If no events appear, make sure that you have created Scaleway resources in the targeted region. Find out more about [troubleshooting Audit Trail issues](https://www.scaleway.com/en/docs/audit-trail/troubleshooting/cannot-see-events) in our dedidcated documentation.
        </Message>



    <Message type="requirement">
     - 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/)
     - You have [installed `curl`](https://curl.se/download.html)
     - 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 created [Scaleway products integrated with Audit Trail](https://www.scaleway.com/en/docs/audit-trail/reference-content/resource-integration-with-adt)
    </Message>



    ## Technical information

    ### Regions

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

    Audit Trail is available in the Paris, Amsterdam, and Warsaw regions, which are represented by the following path parameters:

    - fr-par
    - nl-ams
    - pl-waw

    ## Technical limitations

    Find out about product integration with Audit Trail in our [dedicated documentation](https://www.scaleway.com/en/docs/audit-trail/reference-content/resource-integration-with-adt).

    ## Going further

    For more information about Audit Trail, you can check out the following pages:

    * [Audit Trail Documentation](https://www.scaleway.com/en/docs/audit-trail/)
    * [Scaleway Slack Community](https://scaleway-community.slack.com/) join the #audit-trail channel
    * [Contact our support team](https://console.scaleway.com/support/tickets).
  version: v1alpha1
servers:
- url: https://api.scaleway.com
tags:
- name: Events
  description: An event is a record of any activity related to your Scaleway resources,
    encompassing actions by users, applications, or Scaleway.
- name: Authentication events
  description: Authentication events are records of any authentication activities
    across Scaleway.
- name: System events
  description: System events are records of any system activities across Scaleway.
components:
  schemas:
    scaleway.audit_trail.v1alpha1.AccountContractSignatureInfo.AccountContractInfo:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        name:
          type: string
        version:
          type: integer
          format: int32
        created_at:
          type: string
          description: (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        updated_at:
          type: string
          description: (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
      x-properties-order:
      - id
      - type
      - name
      - version
      - created_at
      - updated_at
    scaleway.audit_trail.v1alpha1.AlertRule:
      type: object
      properties:
        id:
          type: string
          description: ID of the alert rule. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        name:
          type: string
          description: Name of the alert rule.
        description:
          type: string
          description: Description of the alert rule.
        status:
          type: string
          description: Current status of the alert rule.
          enum:
          - unknown_status
          - enabled
          - disabled
          - enabling
          - disabling
          default: unknown_status
      x-properties-order:
      - id
      - name
      - description
      - status
    scaleway.audit_trail.v1alpha1.AuthenticationEvent:
      type: object
      properties:
        id:
          type: string
          description: ID of the event. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        recorded_at:
          type: string
          description: Timestamp of the event. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        organization_id:
          type: string
          description: Organization ID containing the event. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        source_ip:
          type: string
          description: IP address at the origin of the event. (IP address)
          example: 1.2.3.4
        user_agent:
          type: string
          description: User Agent at the origin of the event.
          nullable: true
        resources:
          type: array
          description: Resources attached to the event.
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.Resource'
        result:
          type: string
          description: Result of the authentication attempt.
          enum:
          - unknown_result
          - success
          - failure
          default: unknown_result
        failure_reason:
          type: string
          description: (Optional) Reason for authentication failure.
          enum:
          - unknown_failure_reason
          - invalid_mfa
          - invalid_password
          default: unknown_failure_reason
        country_code:
          type: string
          description: (Optional) ISO 3166-1 alpha-2 country code of the source IP.
          enum:
          - unknown_country_code
          - AF
          - AX
          - AL
          - DZ
          - AS
          - AD
          - AO
          - AI
          - AQ
          - AG
          - AR
          - AM
          - AW
          - AU
          - AT
          - AZ
          - BS
          - BH
          - BD
          - BB
          - BY
          - BE
          - BZ
          - BJ
          - BM
          - BT
          - BO
          - BQ
          - BA
          - BW
          - BV
          - BR
          - IO
          - BN
          - BG
          - BF
          - BI
          - KH
          - CM
          - CA
          - CV
          - KY
          - CF
          - TD
          - CL
          - CN
          - CX
          - CC
          - CO
          - KM
          - CG
          - CD
          - CK
          - CR
          - CI
          - HR
          - CU
          - CW
          - CY
          - CZ
          - DK
          - DJ
          - DM
          - DO
          - EC
          - EG
          - SV
          - GQ
          - ER
          - EE
          - ET
          - FK
          - FO
          - FJ
          - FI
          - FR
          - GF
          - PF
          - TF
          - GA
          - GM
          - GE
          - DE
          - GH
          - GI
          - GR
          - GL
          - GD
          - GP
          - GU
          - GT
          - GG
          - GN
          - GW
          - GY
          - HT
          - HM
          - VA
          - HN
          - HK
          - HU
          - IS
          - IN
          - ID
          - IR
          - IQ
          - IE
          - IM
          - IL
          - IT
          - JM
          - JP
          - JE
          - JO
          - KZ
          - KE
          - KI
          - KP
          - KR
          - KW
          - KG
          - LA
          - LV
          - LB
          - LS
          - LR
          - LY
          - LI
          - LT
          - LU
          - MO
          - MK
          - MG
          - MW
          - MY
          - MV
          - ML
          - MT
          - MH
          - MQ
          - MR
          - MU
          - YT
          - MX
          - FM
          - MD
          - MC
          - MN
          - ME
          - MS
          - MA
          - MZ
          - MM
          - NA
          - NR
          - NP
          - NL
          - NC
          - NZ
          - NI
          - NE
          - NG
          - NU
          - NF
          - MP
          - "NO"
          - OM
          - PK
          - PW
          - PS
          - PA
          - PG
          - PY
          - PE
          - PH
          - PN
          - PL
          - PT
          - PR
          - QA
          - RE
          - RO
          - RU
          - RW
          - BL
          - SH
          - KN
          - LC
          - MF
          - PM
          - VC
          - WS
          - SM
          - ST
          - SA
          - SN
          - RS
          - SC
          - SL
          - SG
          - SX
          - SK
          - SI
          - SB
          - SO
          - ZA
          - GS
          - SS
          - ES
          - LK
          - SD
          - SR
          - SJ
          - SZ
          - SE
          - CH
          - SY
          - TW
          - TJ
          - TZ
          - TH
          - TL
          - TG
          - TK
          - TO
          - TT
          - TN
          - TR
          - TM
          - TC
          - TV
          - UG
          - UA
          - AE
          - GB
          - US
          - UM
          - UY
          - UZ
          - VU
          - VE
          - VN
          - VG
          - VI
          - WF
          - EH
          - YE
          - ZM
          - ZW
          default: unknown_country_code
        method:
          type: string
          description: Authentication method used.
          enum:
          - unknown_method
          - password
          - authentication_code
          - oauth2
          - saml
          default: unknown_method
        origin:
          type: string
          description: Origin of the authentication attempt.
          enum:
          - unknown_origin
          - public_api
          - admin_api
          default: unknown_origin
        mfa_type:
          type: string
          description: (Optional) MFA type used for the authentication attempt.
          enum:
          - unknown_mfa_type
          - totp
          default: unknown_mfa_type
      x-properties-order:
      - id
      - recorded_at
      - organization_id
      - source_ip
      - user_agent
      - resources
      - result
      - failure_reason
      - country_code
      - method
      - origin
      - mfa_type
    scaleway.audit_trail.v1alpha1.DisableAlertRulesResponse:
      type: object
      properties:
        alert_rules:
          type: array
          description: List of the rules that were disabled.
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.AlertRule'
      x-properties-order:
      - alert_rules
    scaleway.audit_trail.v1alpha1.EnableAlertRulesResponse:
      type: object
      properties:
        alert_rules:
          type: array
          description: List of the rules that were enabled.
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.AlertRule'
      x-properties-order:
      - alert_rules
    scaleway.audit_trail.v1alpha1.Event:
      type: object
      properties:
        id:
          type: string
          description: ID of the event. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        recorded_at:
          type: string
          description: Timestamp of the event. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        locality:
          type: string
          description: Locality of the resource attached to the event.
        principal:
          type: object
          description: User or IAM application at the origin of the event.
          properties:
            id:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
          nullable: true
          x-properties-order:
          - id
          x-one-of: source
        organization_id:
          type: string
          description: Organization ID containing the event. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        project_id:
          type: string
          description: (Optional) Project of the resource attached to the event. (UUID
            format)
          example: 6170692e-7363-616c-6577-61792e636f6d
          nullable: true
        source_ip:
          type: string
          description: IP address at the origin of the event. (IP address)
          example: 1.2.3.4
        user_agent:
          type: string
          description: User Agent at the origin of the event.
          nullable: true
        product_name:
          type: string
          description: Product name of the resource attached to the event.
        service_name:
          type: string
          description: API name called to trigger the event.
        method_name:
          type: string
          description: API method called to trigger the event.
        resources:
          type: array
          description: Resources attached to the event.
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.Resource'
        request_id:
          type: string
          description: Unique identifier of the request at the origin of the event.
            (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        request_body:
          type: object
          description: Request at the origin of the event.
          properties:
            <fieldKey>:
              type: object
        status_code:
          type: integer
          description: HTTP status code resulting of the API call.
          format: uint32
      x-properties-order:
      - id
      - recorded_at
      - locality
      - principal
      - organization_id
      - project_id
      - source_ip
      - user_agent
      - product_name
      - service_name
      - method_name
      - resources
      - request_id
      - request_body
      - status_code
    scaleway.audit_trail.v1alpha1.ExportJob:
      type: object
      properties:
        id:
          type: string
          description: ID of the export job. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        organization_id:
          type: string
          description: ID of the targeted Organization. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        name:
          type: string
          description: Name of the export job.
        s3:
          type: object
          description: Destination in an S3 storage.
          properties:
            bucket:
              type: string
            region:
              type: string
              description: The region you want to target
            prefix:
              type: string
              nullable: true
            project_id:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
              nullable: true
          nullable: true
          x-properties-order:
          - bucket
          - region
          - prefix
          - project_id
          x-one-of: destination
        created_at:
          type: string
          description: Export job creation date. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        last_run_at:
          type: string
          description: Last run of export job. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        tags:
          type: array
          description: Tags of the export job.
          items:
            type: string
        last_status:
          type: object
          description: Status of last export job.
          properties:
            code:
              $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ExportJob.Status.Code'
            message:
              type: string
              nullable: true
          x-properties-order:
          - code
          - message
      x-properties-order:
      - id
      - organization_id
      - name
      - s3
      - created_at
      - last_run_at
      - tags
      - last_status
    scaleway.audit_trail.v1alpha1.ExportJob.Status.Code:
      type: string
      enum:
      - unknown_code
      - success
      - failure
      default: unknown_code
    scaleway.audit_trail.v1alpha1.ListAlertRulesResponse:
      type: object
      properties:
        alert_rules:
          type: array
          description: Single page of alert rules matching the requested criteria.
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.AlertRule'
        total_count:
          type: integer
          description: Total count of alert rules matching the requested criteria.
          format: uint64
      x-properties-order:
      - alert_rules
      - total_count
    scaleway.audit_trail.v1alpha1.ListAuthenticationEventsRequest.OrderBy:
      type: string
      enum:
      - recorded_at_desc
      - recorded_at_asc
      default: recorded_at_desc
    scaleway.audit_trail.v1alpha1.ListAuthenticationEventsResponse:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.AuthenticationEvent'
        next_page_token:
          type: string
          nullable: true
      x-properties-order:
      - events
      - next_page_token
    scaleway.audit_trail.v1alpha1.ListCombinedEventsRequest.OrderBy:
      type: string
      enum:
      - recorded_at_desc
      - recorded_at_asc
      default: recorded_at_desc
    scaleway.audit_trail.v1alpha1.ListCombinedEventsResponse:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ListCombinedEventsResponse.CombinedEvent'
        next_page_token:
          type: string
          nullable: true
      x-properties-order:
      - events
      - next_page_token
    scaleway.audit_trail.v1alpha1.ListCombinedEventsResponse.CombinedEvent:
      type: object
      properties:
        api:
          type: object
          properties:
            id:
              type: string
              description: ID of the event. (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            recorded_at:
              type: string
              description: Timestamp of the event. (RFC 3339 format)
              format: date-time
              example: "2022-03-22T12:34:56.123456Z"
              nullable: true
            locality:
              type: string
              description: Locality of the resource attached to the event.
            principal:
              type: object
              description: User or IAM application at the origin of the event.
              properties:
                id:
                  type: string
                  description: (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
              nullable: true
              x-properties-order:
              - id
              x-one-of: source
            organization_id:
              type: string
              description: Organization ID containing the event. (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            project_id:
              type: string
              description: (Optional) Project of the resource attached to the event.
                (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
              nullable: true
            source_ip:
              type: string
              description: IP address at the origin of the event. (IP address)
              example: 1.2.3.4
            user_agent:
              type: string
              description: User Agent at the origin of the event.
              nullable: true
            product_name:
              type: string
              description: Product name of the resource attached to the event.
            service_name:
              type: string
              description: API name called to trigger the event.
            method_name:
              type: string
              description: API method called to trigger the event.
            resources:
              type: array
              description: Resources attached to the event.
              items:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.Resource'
            request_id:
              type: string
              description: Unique identifier of the request at the origin of the event.
                (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            request_body:
              type: object
              description: Request at the origin of the event.
              properties:
                <fieldKey>:
                  type: object
            status_code:
              type: integer
              description: HTTP status code resulting of the API call.
              format: uint32
          nullable: true
          x-properties-order:
          - id
          - recorded_at
          - locality
          - principal
          - organization_id
          - project_id
          - source_ip
          - user_agent
          - product_name
          - service_name
          - method_name
          - resources
          - request_id
          - request_body
          - status_code
          x-one-of: event
        auth:
          type: object
          properties:
            id:
              type: string
              description: ID of the event. (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            recorded_at:
              type: string
              description: Timestamp of the event. (RFC 3339 format)
              format: date-time
              example: "2022-03-22T12:34:56.123456Z"
              nullable: true
            organization_id:
              type: string
              description: Organization ID containing the event. (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            source_ip:
              type: string
              description: IP address at the origin of the event. (IP address)
              example: 1.2.3.4
            user_agent:
              type: string
              description: User Agent at the origin of the event.
              nullable: true
            resources:
              type: array
              description: Resources attached to the event.
              items:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.Resource'
            result:
              type: string
              description: Result of the authentication attempt.
              enum:
              - unknown_result
              - success
              - failure
              default: unknown_result
            failure_reason:
              type: string
              description: (Optional) Reason for authentication failure.
              enum:
              - unknown_failure_reason
              - invalid_mfa
              - invalid_password
              default: unknown_failure_reason
            country_code:
              type: string
              description: (Optional) ISO 3166-1 alpha-2 country code of the source
                IP.
              enum:
              - unknown_country_code
              - AF
              - AX
              - AL
              - DZ
              - AS
              - AD
              - AO
              - AI
              - AQ
              - AG
              - AR
              - AM
              - AW
              - AU
              - AT
              - AZ
              - BS
              - BH
              - BD
              - BB
              - BY
              - BE
              - BZ
              - BJ
              - BM
              - BT
              - BO
              - BQ
              - BA
              - BW
              - BV
              - BR
              - IO
              - BN
              - BG
              - BF
              - BI
              - KH
              - CM
              - CA
              - CV
              - KY
              - CF
              - TD
              - CL
              - CN
              - CX
              - CC
              - CO
              - KM
              - CG
              - CD
              - CK
              - CR
              - CI
              - HR
              - CU
              - CW
              - CY
              - CZ
              - DK
              - DJ
              - DM
              - DO
              - EC
              - EG
              - SV
              - GQ
              - ER
              - EE
              - ET
              - FK
              - FO
              - FJ
              - FI
              - FR
              - GF
              - PF
              - TF
              - GA
              - GM
              - GE
              - DE
              - GH
              - GI
              - GR
              - GL
              - GD
              - GP
              - GU
              - GT
              - GG
              - GN
              - GW
              - GY
              - HT
              - HM
              - VA
              - HN
              - HK
              - HU
              - IS
              - IN
              - ID
              - IR
              - IQ
              - IE
              - IM
              - IL
              - IT
              - JM
              - JP
              - JE
              - JO
              - KZ
              - KE
              - KI
              - KP
              - KR
              - KW
              - KG
              - LA
              - LV
              - LB
              - LS
              - LR
              - LY
              - LI
              - LT
              - LU
              - MO
              - MK
              - MG
              - MW
              - MY
              - MV
              - ML
              - MT
              - MH
              - MQ
              - MR
              - MU
              - YT
              - MX
              - FM
              - MD
              - MC
              - MN
              - ME
              - MS
              - MA
              - MZ
              - MM
              - NA
              - NR
              - NP
              - NL
              - NC
              - NZ
              - NI
              - NE
              - NG
              - NU
              - NF
              - MP
              - "NO"
              - OM
              - PK
              - PW
              - PS
              - PA
              - PG
              - PY
              - PE
              - PH
              - PN
              - PL
              - PT
              - PR
              - QA
              - RE
              - RO
              - RU
              - RW
              - BL
              - SH
              - KN
              - LC
              - MF
              - PM
              - VC
              - WS
              - SM
              - ST
              - SA
              - SN
              - RS
              - SC
              - SL
              - SG
              - SX
              - SK
              - SI
              - SB
              - SO
              - ZA
              - GS
              - SS
              - ES
              - LK
              - SD
              - SR
              - SJ
              - SZ
              - SE
              - CH
              - SY
              - TW
              - TJ
              - TZ
              - TH
              - TL
              - TG
              - TK
              - TO
              - TT
              - TN
              - TR
              - TM
              - TC
              - TV
              - UG
              - UA
              - AE
              - GB
              - US
              - UM
              - UY
              - UZ
              - VU
              - VE
              - VN
              - VG
              - VI
              - WF
              - EH
              - YE
              - ZM
              - ZW
              default: unknown_country_code
            method:
              type: string
              description: Authentication method used.
              enum:
              - unknown_method
              - password
              - authentication_code
              - oauth2
              - saml
              default: unknown_method
            origin:
              type: string
              description: Origin of the authentication attempt.
              enum:
              - unknown_origin
              - public_api
              - admin_api
              default: unknown_origin
            mfa_type:
              type: string
              description: (Optional) MFA type used for the authentication attempt.
              enum:
              - unknown_mfa_type
              - totp
              default: unknown_mfa_type
          nullable: true
          x-properties-order:
          - id
          - recorded_at
          - organization_id
          - source_ip
          - user_agent
          - resources
          - result
          - failure_reason
          - country_code
          - method
          - origin
          - mfa_type
          x-one-of: event
        system:
          type: object
          properties:
            id:
              type: string
              description: ID of the system event. (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            recorded_at:
              type: string
              description: Timestamp of the system event. (RFC 3339 format)
              format: date-time
              example: "2022-03-22T12:34:56.123456Z"
              nullable: true
            locality:
              type: string
              description: Locality of the system event.
            organization_id:
              type: string
              description: Organization ID containing the system event.
            project_id:
              type: string
              description: Project of the resource attached to the system event. (UUID
                format)
              example: 6170692e-7363-616c-6577-61792e636f6d
              nullable: true
            product_name:
              type: string
              description: Name of the Scaleway product in a hyphenated format.
            source:
              type: string
              description: Source of the system event.
            system_name:
              type: string
              description: Name of the jobs, notification, etc.
            resources:
              type: array
              description: Resources attached to the event.
              items:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.Resource'
            kind:
              type: string
              description: Source of the event (unknown, cron or notification).
              enum:
              - unknown_kind
              - cron
              - notification
              default: unknown_kind
          nullable: true
          x-properties-order:
          - id
          - recorded_at
          - locality
          - organization_id
          - project_id
          - product_name
          - source
          - system_name
          - resources
          - kind
          x-one-of: event
      x-properties-order:
      - api
      - auth
      - system
    scaleway.audit_trail.v1alpha1.ListEventsRequest.OrderBy:
      type: string
      enum:
      - recorded_at_desc
      - recorded_at_asc
      default: recorded_at_desc
    scaleway.audit_trail.v1alpha1.ListEventsResponse:
      type: object
      properties:
        events:
          type: array
          description: Single page of events matching the requested criteria.
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.Event'
        next_page_token:
          type: string
          description: Page token to use in following calls to keep listing.
          nullable: true
      x-properties-order:
      - events
      - next_page_token
    scaleway.audit_trail.v1alpha1.ListExportJobsRequest.OrderBy:
      type: string
      enum:
      - name_asc
      - name_desc
      - created_at_asc
      - created_at_desc
      default: name_asc
    scaleway.audit_trail.v1alpha1.ListExportJobsResponse:
      type: object
      properties:
        export_jobs:
          type: array
          description: Single page of export jobs matching the requested criteria.
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ExportJob'
        total_count:
          type: integer
          description: Total count of export jobs matching the requested criteria.
          format: uint64
      x-properties-order:
      - export_jobs
      - total_count
    scaleway.audit_trail.v1alpha1.ListProductsResponse:
      type: object
      properties:
        products:
          type: array
          description: List of all products integrated with Audit Trail.
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.Product'
        total_count:
          type: integer
          description: Number of integrated products.
          format: uint64
      x-properties-order:
      - products
      - total_count
    scaleway.audit_trail.v1alpha1.ListSystemEventsRequest.OrderBy:
      type: string
      enum:
      - recorded_at_desc
      - recorded_at_asc
      default: recorded_at_desc
    scaleway.audit_trail.v1alpha1.ListSystemEventsResponse:
      type: object
      properties:
        events:
          type: array
          description: Single page of system events matching the requested criteria.
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.SystemEvent'
        next_page_token:
          type: string
          description: Page token to use in following calls to keep listing.
          nullable: true
      x-properties-order:
      - events
      - next_page_token
    scaleway.audit_trail.v1alpha1.Product:
      type: object
      properties:
        title:
          type: string
          description: Product title.
        name:
          type: string
          description: Product name.
        services:
          type: array
          description: Specifies the API versions of the products integrated with
            Audit Trail. Each version defines the methods logged by Audit Trail.
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.Product.Service'
      x-properties-order:
      - title
      - name
      - services
    scaleway.audit_trail.v1alpha1.Product.Service:
      type: object
      properties:
        name:
          type: string
        methods:
          type: array
          items:
            type: string
      x-properties-order:
      - name
      - methods
    scaleway.audit_trail.v1alpha1.Resource:
      type: object
      properties:
        id:
          type: string
        type:
          $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ResourceType'
        created_at:
          type: string
          description: (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        updated_at:
          type: string
          description: (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        deleted_at:
          type: string
          description: (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        name:
          type: string
          nullable: true
        secm_secret_info:
          type: object
          properties:
            path:
              type: string
            key_id:
              type: string
              nullable: true
          nullable: true
          x-properties-order:
          - path
          - key_id
          x-one-of: info
        secm_secret_version_info:
          type: object
          properties:
            revision:
              type: integer
              format: uint32
          nullable: true
          x-properties-order:
          - revision
          x-one-of: info
        kube_cluster_info:
          type: object
          nullable: true
          x-one-of: info
        kube_pool_info:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
          nullable: true
          x-properties-order:
          - id
          - name
          x-one-of: info
        kube_node_info:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
          nullable: true
          x-properties-order:
          - id
          - name
          x-one-of: info
        kube_acl_info:
          type: object
          nullable: true
          x-one-of: info
        keym_key_info:
          type: object
          nullable: true
          x-one-of: info
        secret_manager_secret_info:
          type: object
          properties:
            path:
              type: string
            key_id:
              type: string
              nullable: true
          nullable: true
          x-properties-order:
          - path
          - key_id
          x-one-of: info
        secret_manager_version_info:
          type: object
          properties:
            revision:
              type: integer
              format: uint32
          nullable: true
          x-properties-order:
          - revision
          x-one-of: info
        key_manager_key_info:
          type: object
          nullable: true
          x-one-of: info
        account_user_info:
          type: object
          properties:
            email:
              type: string
            phone_number:
              type: string
              nullable: true
          nullable: true
          x-properties-order:
          - email
          - phone_number
          x-one-of: info
        account_organization_info:
          type: object
          nullable: true
          x-one-of: info
        instance_server_info:
          type: object
          properties:
            name:
              type: string
          nullable: true
          x-properties-order:
          - name
          x-one-of: info
        apple_silicon_server_info:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
          nullable: true
          x-properties-order:
          - id
          - name
          x-one-of: info
        account_project_info:
          type: object
          properties:
            description:
              type: string
          nullable: true
          x-properties-order:
          - description
          x-one-of: info
        baremetal_server_info:
          type: object
          properties:
            description:
              type: string
            tags:
              type: array
              items:
                type: string
          nullable: true
          x-properties-order:
          - description
          - tags
          x-one-of: info
        baremetal_setting_info:
          type: object
          properties:
            type:
              type: string
          nullable: true
          x-properties-order:
          - type
          x-one-of: info
        ipam_ip_info:
          type: object
          properties:
            address:
              type: string
              description: (IP network)
              example: 1.2.3.4/32
          nullable: true
          x-properties-order:
          - address
          x-one-of: info
        load_balancer_lb_info:
          type: object
          properties:
            name:
              type: string
          nullable: true
          x-properties-order:
          - name
          x-one-of: info
        load_balancer_ip_info:
          type: object
          properties:
            ip_address:
              type: string
            lb_id:
              type: string
              nullable: true
          nullable: true
          x-properties-order:
          - ip_address
          - lb_id
          x-one-of: info
        load_balancer_frontend_info:
          type: object
          properties:
            lb_id:
              type: string
            name:
              type: string
          nullable: true
          x-properties-order:
          - lb_id
          - name
          x-one-of: info
        load_balancer_backend_info:
          type: object
          properties:
            lb_id:
              type: string
            name:
              type: string
          nullable: true
          x-properties-order:
          - lb_id
          - name
          x-one-of: info
        load_balancer_route_info:
          type: object
          properties:
            frontend_id:
              type: string
            backend_id:
              type: string
          nullable: true
          x-properties-order:
          - frontend_id
          - backend_id
          x-one-of: info
        load_balancer_acl_info:
          type: object
          properties:
            frontend_id:
              type: string
          nullable: true
          x-properties-order:
          - frontend_id
          x-one-of: info
        load_balancer_certificate_info:
          type: object
          properties:
            lb_id:
              type: string
            name:
              type: string
          nullable: true
          x-properties-order:
          - lb_id
          - name
          x-one-of: info
        edge_services_plan_info:
          type: object
          nullable: true
          x-one-of: info
        edge_services_pipeline_info:
          type: object
          properties:
            name:
              type: string
          nullable: true
          x-properties-order:
          - name
          x-one-of: info
        edge_services_dns_stage_info:
          type: object
          properties:
            pipeline_id:
              type: string
              nullable: true
          nullable: true
          x-properties-order:
          - pipeline_id
          x-one-of: info
        edge_services_tls_stage_info:
          type: object
          properties:
            pipeline_id:
              type: string
              nullable: true
          nullable: true
          x-properties-order:
          - pipeline_id
          x-one-of: info
        edge_services_cache_stage_info:
          type: object
          properties:
            pipeline_id:
              type: string
              nullable: true
          nullable: true
          x-properties-order:
          - pipeline_id
          x-one-of: info
        edge_services_route_stage_info:
          type: object
          properties:
            pipeline_id:
              type: string
              nullable: true
          nullable: true
          x-properties-order:
          - pipeline_id
          x-one-of: info
        edge_services_route_rules_info:
          type: object
          properties:
            route_stage_id:
              type: string
          nullable: true
          x-properties-order:
          - route_stage_id
          x-one-of: info
        edge_services_waf_stage_info:
          type: object
          properties:
            pipeline_id:
              type: string
              nullable: true
          nullable: true
          x-properties-order:
          - pipeline_id
          x-one-of: info
        edge_services_backend_stage_info:
          type: object
          properties:
            pipeline_id:
              type: string
              nullable: true
          nullable: true
          x-properties-order:
          - pipeline_id
          x-one-of: info
        account_contract_signature_info:
          type: object
          properties:
            signed_at:
              type: string
              description: (RFC 3339 format)
              format: date-time
              example: "2022-03-22T12:34:56.123456Z"
              nullable: true
            signed_by_account_root_user_id:
              type: string
            expires_at:
              type: string
              description: (RFC 3339 format)
              format: date-time
              example: "2022-03-22T12:34:56.123456Z"
              nullable: true
            contract:
              $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.AccountContractSignatureInfo.AccountContractInfo'
          nullable: true
          x-properties-order:
          - signed_at
          - signed_by_account_root_user_id
          - expires_at
          - contract
          x-one-of: info
        vpc_subnet_info:
          type: object
          properties:
            subnet_cidr:
              type: string
              description: (IP network)
              example: 1.2.3.4/32
            vpc_id:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
          nullable: true
          x-properties-order:
          - subnet_cidr
          - vpc_id
          x-one-of: info
        vpc_route_info:
          type: object
          properties:
            vpc_id:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            destination:
              type: string
              description: (IP network)
              example: 1.2.3.4/32
            nexthop_resource_key:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
              nullable: true
            nexthop_private_network_key:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
              nullable: true
          nullable: true
          x-properties-order:
          - vpc_id
          - destination
          - nexthop_resource_key
          - nexthop_private_network_key
          x-one-of: info
        vpc_private_network_info:
          type: object
          properties:
            vpc_id:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            push_default_route:
              type: boolean
          nullable: true
          x-properties-order:
          - vpc_id
          - push_default_route
          x-one-of: info
        audit_trail_export_job_info:
          type: object
          nullable: true
          x-one-of: info
        vpc_gw_gateway_info:
          type: object
          properties:
            vpc_id:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
              nullable: true
            gateway_type_id:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            public_ip_id:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
              nullable: true
          nullable: true
          x-properties-order:
          - vpc_id
          - gateway_type_id
          - public_ip_id
          x-one-of: info
        vpc_gw_gateway_network_info:
          type: object
          properties:
            gateway_id:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            pn_id:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            address:
              type: string
              description: (IP network)
              example: 1.2.3.4/32
              nullable: true
          nullable: true
          x-properties-order:
          - gateway_id
          - pn_id
          - address
          x-one-of: info
        apple_silicon_runner_info:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
          nullable: true
          x-properties-order:
          - id
          - name
          x-one-of: info
        audit_trail_alert_rule_info:
          type: object
          nullable: true
          x-one-of: info
        vpc_connector_info:
          type: object
          properties:
            vpc_id:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            target_vpc_id:
              type: string
              description: (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
          nullable: true
          x-properties-order:
          - vpc_id
          - target_vpc_id
          x-one-of: info
        instance_private_network_interface_info:
          type: object
          properties:
            private_network_id:
              type: string
            server_id:
              type: string
              nullable: true
            security_group_id:
              type: string
              nullable: true
          nullable: true
          x-properties-order:
          - private_network_id
          - server_id
          - security_group_id
          x-one-of: info
      x-properties-order:
      - id
      - type
      - created_at
      - updated_at
      - deleted_at
      - name
      - secm_secret_info
      - secm_secret_version_info
      - kube_cluster_info
      - kube_pool_info
      - kube_node_info
      - kube_acl_info
      - keym_key_info
      - secret_manager_secret_info
      - secret_manager_version_info
      - key_manager_key_info
      - account_user_info
      - account_organization_info
      - instance_server_info
      - apple_silicon_server_info
      - account_project_info
      - baremetal_server_info
      - baremetal_setting_info
      - ipam_ip_info
      - load_balancer_lb_info
      - load_balancer_ip_info
      - load_balancer_frontend_info
      - load_balancer_backend_info
      - load_balancer_route_info
      - load_balancer_acl_info
      - load_balancer_certificate_info
      - edge_services_plan_info
      - edge_services_pipeline_info
      - edge_services_dns_stage_info
      - edge_services_tls_stage_info
      - edge_services_cache_stage_info
      - edge_services_route_stage_info
      - edge_services_route_rules_info
      - edge_services_waf_stage_info
      - edge_services_backend_stage_info
      - account_contract_signature_info
      - vpc_subnet_info
      - vpc_route_info
      - vpc_private_network_info
      - audit_trail_export_job_info
      - vpc_gw_gateway_info
      - vpc_gw_gateway_network_info
      - apple_silicon_runner_info
      - audit_trail_alert_rule_info
      - vpc_connector_info
      - instance_private_network_interface_info
    scaleway.audit_trail.v1alpha1.ResourceType:
      type: string
      enum:
      - unknown_type
      - secm_secret
      - secm_secret_version
      - kube_cluster
      - kube_pool
      - kube_node
      - kube_acl
      - keym_key
      - iam_user
      - iam_application
      - iam_group
      - iam_policy
      - iam_api_key
      - iam_ssh_key
      - iam_rule
      - iam_saml
      - iam_saml_certificate
      - iam_scim
      - iam_scim_token
      - secret_manager_secret
      - secret_manager_version
      - key_manager_key
      - account_user
      - account_organization
      - account_project
      - account_contract_signature
      - instance_server
      - instance_placement_group
      - instance_security_group
      - instance_volume
      - instance_snapshot
      - instance_image
      - instance_template
      - instance_private_network_interface
      - apple_silicon_server
      - baremetal_server
      - baremetal_setting
      - ipam_ip
      - sbs_volume
      - sbs_snapshot
      - load_balancer_lb
      - load_balancer_ip
      - load_balancer_frontend
      - load_balancer_backend
      - load_balancer_route
      - load_balancer_acl
      - load_balancer_certificate
      - sfs_filesystem
      - vpc_private_network
      - vpc_vpc
      - vpc_subnet
      - vpc_route
      - vpc_acl
      - vpc_connector
      - edge_services_plan
      - edge_services_pipeline
      - edge_services_dns_stage
      - edge_services_tls_stage
      - edge_services_cache_stage
      - edge_services_route_stage
      - edge_services_route_rules
      - edge_services_waf_stage
      - edge_services_backend_stage
      - s2s_vpn_gateway
      - s2s_customer_gateway
      - s2s_routing_policy
      - s2s_connection
      - vpc_gw_gateway
      - vpc_gw_gateway_network
      - vpc_gw_dhcp
      - vpc_gw_dhcp_entry
      - vpc_gw_pat_rule
      - vpc_gw_ip
      - audit_trail_export_job
      - rdb_instance
      - rdb_instance_backup
      - rdb_instance_endpoint
      - rdb_instance_logs
      - rdb_instance_read_replica
      - rdb_instance_snapshot
      - mongodb_instance
      - mongodb_instance_snapshot
      - mongodb_instance_endpoint
      - mongodb_instance_maintenance
      - apple_silicon_runner
      - audit_trail_alert_rule
      - dtwh_deployment
      - dtwh_deployment_endpoint
      - dtwh_deployment_database
      - dtwh_deployment_user
      - ssdb_database
      - ssdb_database_backup
      default: unknown_type
    scaleway.audit_trail.v1alpha1.SetEnabledAlertRulesResponse:
      type: object
      properties:
        alert_rules:
          type: array
          description: List of the rules that were enabled.
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.AlertRule'
      x-properties-order:
      - alert_rules
    scaleway.audit_trail.v1alpha1.SystemEvent:
      type: object
      properties:
        id:
          type: string
          description: ID of the system event. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        recorded_at:
          type: string
          description: Timestamp of the system event. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        locality:
          type: string
          description: Locality of the system event.
        organization_id:
          type: string
          description: Organization ID containing the system event.
        project_id:
          type: string
          description: Project of the resource attached to the system event. (UUID
            format)
          example: 6170692e-7363-616c-6577-61792e636f6d
          nullable: true
        product_name:
          type: string
          description: Name of the Scaleway product in a hyphenated format.
        source:
          type: string
          description: Source of the system event.
        system_name:
          type: string
          description: Name of the jobs, notification, etc.
        resources:
          type: array
          description: Resources attached to the event.
          items:
            $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.Resource'
        kind:
          type: string
          description: Source of the event (unknown, cron or notification).
          enum:
          - unknown_kind
          - cron
          - notification
          default: unknown_kind
      x-properties-order:
      - id
      - recorded_at
      - locality
      - organization_id
      - project_id
      - product_name
      - source
      - system_name
      - resources
      - kind
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /audit-trail/v1alpha1/regions/{region}/alert-rules:
    get:
      operationId: ListAlertRules
      summary: List alert rules for a specified organization and their current status
        (enabled or disabled)
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
      - in: query
        name: organization_id
        description: ID of the Organization to target.
        required: true
        schema:
          type: string
      - in: query
        name: status
        description: (Optional) Status of the alert rule.
        schema:
          type: string
          enum:
          - unknown_status
          - enabled
          - disabled
          - enabling
          - disabling
          default: unknown_status
      - in: query
        name: page
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ListAlertRulesResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/alert-rules?organization_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/alert-rules" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==string
    patch:
      operationId: SetEnabledAlertRules
      summary: Set the alert rules to enabled
      description: Set the alert rules to enabled by replacing the set of enabled
        alert rules for a specified organization. The provided list defines the complete
        set of rules that should be enabled. Any previously enabled rule not included
        in the request will be disabled.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.SetEnabledAlertRulesResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                organization_id:
                  type: string
                  description: ID of the Organization to target.
                enabled_alert_rule_ids:
                  type: array
                  description: List of IDs of the rules that must be enabled after
                    the update. (UUID format)
                  example:
                  - 6170692e-7363-616c-6577-61792e636f6d
                  items:
                    type: string
              x-properties-order:
              - organization_id
              - enabled_alert_rule_ids
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X PATCH \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"organization_id":"string"}' \
            "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/alert-rules"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/alert-rules" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id="string"
  /audit-trail/v1alpha1/regions/{region}/authentication-events:
    get:
      tags:
      - Authentication events
      operationId: ListAuthenticationEvents
      summary: List authentication events
      description: Retrieve the list of Audit Trail authentication events for a Scaleway
        Organization. You must specify the `organization_id`.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
      - in: query
        name: organization_id
        required: true
        schema:
          type: string
      - in: query
        name: recorded_after
        description: (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: recorded_before
        description: (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: order_by
        schema:
          $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ListAuthenticationEventsRequest.OrderBy'
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      - in: query
        name: page_token
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ListAuthenticationEventsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/authentication-events?organization_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/authentication-events" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==string
  /audit-trail/v1alpha1/regions/{region}/combined-events:
    get:
      operationId: ListCombinedEvents
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
      - in: query
        name: organization_id
        required: true
        schema:
          type: string
      - in: query
        name: project_id
        schema:
          type: string
      - in: query
        name: resource_type
        schema:
          $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ResourceType'
      - in: query
        name: recorded_after
        description: (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: recorded_before
        description: (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: order_by
        schema:
          $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ListCombinedEventsRequest.OrderBy'
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      - in: query
        name: page_token
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ListCombinedEventsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/combined-events?organization_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/combined-events" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==string
  /audit-trail/v1alpha1/regions/{region}/disable-alert-rules:
    post:
      operationId: DisableAlertRules
      summary: Disable alert rules
      description: Disable alert rules for a specified organization. Disabled rules
        will no longer trigger alerts when matching events occur.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.DisableAlertRulesResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                organization_id:
                  type: string
                  description: ID of the Organization to target.
                alert_rule_ids:
                  type: array
                  description: List of IDs of the rules to disable. (UUID format)
                  example:
                  - 6170692e-7363-616c-6577-61792e636f6d
                  items:
                    type: string
              x-properties-order:
              - organization_id
              - alert_rule_ids
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"organization_id":"string"}' \
            "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/disable-alert-rules"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/disable-alert-rules" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id="string"
  /audit-trail/v1alpha1/regions/{region}/enable-alert-rules:
    post:
      operationId: EnableAlertRules
      summary: Enable alert rules
      description: Enable alert rules for a specified organization. Enabled rules
        will trigger alerts when matching events occur.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.EnableAlertRulesResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                organization_id:
                  type: string
                  description: ID of the Organization to target.
                alert_rule_ids:
                  type: array
                  description: List of IDs of the rules to enable. (UUID format)
                  example:
                  - 6170692e-7363-616c-6577-61792e636f6d
                  items:
                    type: string
              x-properties-order:
              - organization_id
              - alert_rule_ids
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"organization_id":"string"}' \
            "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/enable-alert-rules"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/enable-alert-rules" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id="string"
  /audit-trail/v1alpha1/regions/{region}/events:
    get:
      tags:
      - Events
      operationId: ListEvents
      summary: List events
      description: Retrieve the list of Audit Trail events for a Scaleway Organization
        and/or Project. You must specify the `organization_id` and optionally, the
        `project_id`.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
      - in: query
        name: project_id
        description: (Optional) ID of the Project containing the Audit Trail events.
        schema:
          type: string
      - in: query
        name: organization_id
        description: ID of the Organization containing the Audit Trail events.
        required: true
        schema:
          type: string
      - in: query
        name: resource_type
        description: (Optional) Type of the Scaleway resource.
        schema:
          type: string
          enum:
          - unknown_type
          - secm_secret
          - secm_secret_version
          - kube_cluster
          - kube_pool
          - kube_node
          - kube_acl
          - keym_key
          - iam_user
          - iam_application
          - iam_group
          - iam_policy
          - iam_api_key
          - iam_ssh_key
          - iam_rule
          - iam_saml
          - iam_saml_certificate
          - iam_scim
          - iam_scim_token
          - secret_manager_secret
          - secret_manager_version
          - key_manager_key
          - account_user
          - account_organization
          - account_project
          - account_contract_signature
          - instance_server
          - instance_placement_group
          - instance_security_group
          - instance_volume
          - instance_snapshot
          - instance_image
          - instance_template
          - instance_private_network_interface
          - apple_silicon_server
          - baremetal_server
          - baremetal_setting
          - ipam_ip
          - sbs_volume
          - sbs_snapshot
          - load_balancer_lb
          - load_balancer_ip
          - load_balancer_frontend
          - load_balancer_backend
          - load_balancer_route
          - load_balancer_acl
          - load_balancer_certificate
          - sfs_filesystem
          - vpc_private_network
          - vpc_vpc
          - vpc_subnet
          - vpc_route
          - vpc_acl
          - vpc_connector
          - edge_services_plan
          - edge_services_pipeline
          - edge_services_dns_stage
          - edge_services_tls_stage
          - edge_services_cache_stage
          - edge_services_route_stage
          - edge_services_route_rules
          - edge_services_waf_stage
          - edge_services_backend_stage
          - s2s_vpn_gateway
          - s2s_customer_gateway
          - s2s_routing_policy
          - s2s_connection
          - vpc_gw_gateway
          - vpc_gw_gateway_network
          - vpc_gw_dhcp
          - vpc_gw_dhcp_entry
          - vpc_gw_pat_rule
          - vpc_gw_ip
          - audit_trail_export_job
          - rdb_instance
          - rdb_instance_backup
          - rdb_instance_endpoint
          - rdb_instance_logs
          - rdb_instance_read_replica
          - rdb_instance_snapshot
          - mongodb_instance
          - mongodb_instance_snapshot
          - mongodb_instance_endpoint
          - mongodb_instance_maintenance
          - apple_silicon_runner
          - audit_trail_alert_rule
          - dtwh_deployment
          - dtwh_deployment_endpoint
          - dtwh_deployment_database
          - dtwh_deployment_user
          - ssdb_database
          - ssdb_database_backup
          default: unknown_type
      - in: query
        name: method_name
        description: (Optional) Name of the method of the API call performed.
        schema:
          type: string
      - in: query
        name: status
        description: (Optional) HTTP status code of the request. Returns either `200`
          if the request was successful or `403` if the permission was denied.
        schema:
          type: integer
          format: uint32
      - in: query
        name: recorded_after
        description: (Optional) The `recorded_after` parameter defines the earliest
          timestamp from which Audit Trail events are retrieved. Returns `one hour
          ago` by default. (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: recorded_before
        description: (Optional) The `recorded_before` parameter defines the latest
          timestamp up to which Audit Trail events are retrieved. Returns `now` by
          default. (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: order_by
        schema:
          $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ListEventsRequest.OrderBy'
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      - in: query
        name: page_token
        schema:
          type: string
      - in: query
        name: product_name
        description: (Optional) Name of the Scaleway product in a hyphenated format.
        schema:
          type: string
      - in: query
        name: service_name
        description: (Optional) Name of the service of the API call performed.
        schema:
          type: string
      - in: query
        name: resource_id
        description: (Optional) ID of the Scaleway resource.
        schema:
          type: string
      - in: query
        name: principal_id
        description: (Optional) ID of the User or IAM application at the origin of
          the event.
        schema:
          type: string
      - in: query
        name: source_ip
        description: (Optional) IP address at the origin of the event.
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ListEventsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/events?organization_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/events" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==string
  /audit-trail/v1alpha1/regions/{region}/export-jobs:
    get:
      operationId: ListExportJobs
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
      - in: query
        name: organization_id
        description: Filter by Organization ID.
        required: true
        schema:
          type: string
      - in: query
        name: name
        description: (Optional) Filter by export name.
        schema:
          type: string
      - in: query
        name: tags
        description: (Optional) List of tags to filter on.
        schema:
          type: array
          items:
            type: string
      - in: query
        name: page
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        schema:
          $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ListExportJobsRequest.OrderBy'
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ListExportJobsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/export-jobs?organization_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/export-jobs" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==string
    post:
      tags:
      - Events
      operationId: CreateExportJob
      summary: Create an export job
      description: Create an export job for a specified organization. This allows
        you to export audit trail events to a destination, such as an S3 bucket. The
        request requires the organization ID, a name for the export, and a destination
        configuration.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ExportJob'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                organization_id:
                  type: string
                  description: ID of the Organization to target.
                name:
                  type: string
                  description: Name of the export.
                s3:
                  type: object
                  description: The configuration specifying the bucket where the audit
                    trail events will be exported.
                  properties:
                    bucket:
                      type: string
                    region:
                      type: string
                      description: The region you want to target
                    prefix:
                      type: string
                      nullable: true
                    project_id:
                      type: string
                      description: (UUID format)
                      example: 6170692e-7363-616c-6577-61792e636f6d
                      nullable: true
                  nullable: true
                  x-properties-order:
                  - bucket
                  - region
                  - prefix
                  - project_id
                  x-one-of: destination
                tags:
                  type: array
                  description: Tags of the export.
                  items:
                    type: string
              x-properties-order:
              - organization_id
              - name
              - s3
              - tags
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"name":"string","organization_id":"string"}' \
            "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/export-jobs"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/export-jobs" \
            X-Auth-Token:$SCW_SECRET_KEY \
            name="string" \
            organization_id="string"
  /audit-trail/v1alpha1/regions/{region}/export-jobs/{export_job_id}:
    delete:
      tags:
      - Events
      operationId: DeleteExportJob
      summary: Delete an export job
      description: Deletes an export job for a specified id.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
      - in: path
        name: export_job_id
        description: ID of the export job.
        required: true
        schema:
          type: string
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/export-jobs/{export_job_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/export-jobs/{export_job_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /audit-trail/v1alpha1/regions/{region}/products:
    get:
      tags:
      - Events
      operationId: ListProducts
      summary: Retrieve the list of Scaleway resources for which you have Audit Trail
        events
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
      - in: query
        name: organization_id
        description: ID of the Organization containing the Audit Trail events.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ListProductsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/products?organization_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/products" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==string
  /audit-trail/v1alpha1/regions/{region}/system-events:
    get:
      tags:
      - System events
      operationId: ListSystemEvents
      summary: List system events
      description: Retrieve the list of Audit Trail system events for a Scaleway Organization.
        You must specify the `organization_id`.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
      - in: query
        name: organization_id
        description: ID of the Organization containing the Audit Trail system events.
        required: true
        schema:
          type: string
      - in: query
        name: recorded_after
        description: (Optional) The `recorded_after` parameter defines the earliest
          timestamp from which Audit Trail system events are retrieved. Returns `one
          hour ago` by default. (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: recorded_before
        description: (Optional) The `recorded_before` parameter defines the latest
          timestamp up to which Audit Trail system events are retrieved. Returns `now`
          by default. (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: order_by
        schema:
          $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ListSystemEventsRequest.OrderBy'
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      - in: query
        name: page_token
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.audit_trail.v1alpha1.ListSystemEventsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/system-events?organization_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/audit-trail/v1alpha1/regions/{region}/system-events" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==string
