openapi: 3.1.0
info:
  title: Annotations API
  description: |-
    Scaleway Annotations lets you attach custom key-value metadata to any cloud resource (instance, bucket, database, etc.). Use Annotations to start organizing your Scaleway resources now, setting up your infrastructure for our next-generation FinOps, GreenOps, and governance tools.

    This product is currently in Beta.

    ## Concepts

    ### Annotation

    An annotation is custom metadata you can attach to any Scaleway resource (instance, bucket, database, etc.). It consists of a key (the category of information for a resource) and a value (the concrete information associated with a category).

    ### Key-Value

    An annotation key is a globally-unique identifier that names the piece of metadata you want to attach to a resource. The key defines the category of information for a resource (e.g., team, environment, cost-center).

    An annotation value is the concrete information (e.g., marketing, production, 83546) associated with a category, i.e., an annotation key. A value cannot exist on its own, it must always be a child of a key.

    For example:

    | Key         | Value                      |
    | ----------- | -------------------------- |
    | team        | marketing, finance, sales  |
    | environment | staging, production        |
    | cost_center | c83546, c32424, c47847     |

    A key-value pair constitutes an annotation.

    ### Binding

    A binding is the explicit association that links an annotation to a specific resource. In other words, a binding records which resource the annotation applies to.

    ### Scaleway Resource Name

    A Scaleway Resource Name (SRN) is a Uniform Resource Identifier (URI) that uniquely identifies a Scaleway resource.

    In the context of Annotations, you are required to provide an SRN when binding a key-value pair to a selected resource via the Annotations API.

    An SRN usually follows this format:

    ```text
    srn://product-slug.partition/locality-type/{locality}/resource-type/{resource-id}
    ```

    Examples:

    ```text
    # Key Manager key - an example with locality
    srn://key-manager.scw.eu/regions/fr-par/keys/25f6c309-a2c6-4fb2-8d16-57960c3fb9df

    # IAM application - an example with no locality
    srn://iam.scw.eu/applications/25f6c309-a2c6-4fb2-8d16-57960c3fb9df
    ```

    For detailed information about how SRNs are composed, see [Scaleway Resource Names](https://www.scaleway.com/en/developers/api#scaleway-resource-names).

    ## Quickstart

    <Message type="requirement">
     - You have your [Organization 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 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. To start using Annotations, configure one of the following permission sets:
       - `AnnotationsFullAccess`: Full access to annotations (keys, values, and bindings).
       - `AnnotationsReadOnly`: Read-only access to annotations. Typical users are auditors or finance team members (e.g., a FinOps analyst who can view and filter by annotation but cannot modify anything).
       - `AnnotationsBindingManager`: Allows attaching annotations to resources, but prohibits modifying the annotation dictionary. Typical users are developers (including Terraform) who need the dictionary for autocomplete and must be able to create/delete bindings, but must not add or modify keys/values.
     - You have [installed `curl`](https://curl.se/download.html)
    </Message>

    In the following steps, you are going to create a key-value pair (example: `service`, `payment`), bind it to a given resource, then list your organization's bindings.

    1. Configure your environment variables.

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

        ```bash
        export SCW_ACCESS_KEY="<access-key>"
        export SCW_SECRET_KEY="<secret-key>"
        export SCW_ORGANIZATION_ID="<your-organization-id>"
        ```

    2. Run the following command to create an annotation key. Remember to replace the placeholders with actual values.

        ```bash
        curl -X POST \
        -H "X-Auth-Token: $SCW_SECRET_KEY" \
        -H "Content-Type: application/json" \
        -d "{\"description\":\"<description-of-key>\",\"name\":\"<name-of-key>\",\"organization_id\":\"$SCW_ORGANIZATION_ID\"}" \
        "https://api.scaleway.com/annotations/v1/keys"
        ```

       Example response:

        ```json
        {
            "id":"019eac9e-18a7-7bcb-b448-978c36d0a2fc",
            "name":"service",
            "description":"key-for-services"
        }
        ```

       Note the key `id` returned in the response, you will need it in the next step.

    3. Run the following command to add a value to the key. Remember to replace the placeholders with actual values.

        ```bash
        curl -X POST \
        -H "X-Auth-Token: $SCW_SECRET_KEY" \
        -H "Content-Type: application/json" \
        -d "{\"description\":\"<description-of-value>\",\"key_id\":\"<id-of-key>\",\"name\":\"<name-of-value>\"}" \
        "https://api.scaleway.com/annotations/v1/values"
        ```

       Example response:

        ```json
        {
            "id":"019eb0ba-6400-748c-a037-b6b436c0ec41",
            "key_id":"019eac9e-18a7-7bcb-b448-978c36d0a2fc",
            "name":"payments",
            "description":"value-for-payments"
        }
        ```

       Note the value `id` returned in the response, you will need it in the next step.

    4. Attach a key-value pair to a selected cloud resource. Remember to replace the placeholders with actual values.

        ```bash
        curl -X POST \
        -H "X-Auth-Token: $SCW_SECRET_KEY" \
        -H "Content-Type: application/json" \
        -d '{"srn":"<srn-value>","value_id":"<id-of-value>"}' \
        "https://api.scaleway.com/annotations/v1/bindings"
        ```

       Example response:

        ```json
        {
            "id":"019eb0cb-7527-76e6-bc56-63d4d92e319e",
            "srn":"srn://k8s.scw.eu/regions/fr-par/clusters/25f6c309-a2c6-4fb2-8d16-57960c3fb9df",
            "key":{
                "id":"019eac9e-18a7-7bcb-b448-978c36d0a2fc",
                "name":"service"
            },
            "value":{
                "id":"019eb0ba-6400-748c-a037-b6b436c0ec41",
                "name":"payments"
            }
        }
        ```

    5. Run the following command to list bindings (i.e., the annotations attached to your resources). Remember to replace the placeholder with an actual value.

        ```bash
        curl -X GET \
        -H "X-Auth-Token: $SCW_SECRET_KEY" \
        "https://api.scaleway.com/annotations/v1/bindings?organization_id=$SCW_ORGANIZATION_ID"
        ```

       Example response:

        ```json
        {
            "bindings":[
                {
                    "id":"019eb0cb-7527-76e6-bc56-63d4d92e319e",
                    "srn":"srn://k8s.scw.eu/regions/fr-par/clusters/25f6c309-a2c6-4fb2-8d16-57960c3fb9df",
                    "key":{
                        "id":"019eac9e-18a7-7bcb-b448-978c36d0a2fc",
                        "name":"service"
                    },
                    "value":{
                        "id":"019eb0ba-6400-748c-a037-b6b436c0ec41",
                        "name":"payments"
                    }
                }
            ],
            "total_count":1
        }
        ```

    ## Technical information

    ### Regions

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

    Annotations is a global product that is available in all regions.

    ## Technical limitations

    ### Validation rules

    | Element       | Maximum length  | Allowed values         |
    | ------------- | --------------- | ---------------------- |
    | key `name`    | 128 characters  | `^[_\\pL][_\\pL0-9]*$` |
    | value `name`  | 256 characters  | `^[_\\pL][_\\pL0-9]*$` |
    | `description` | 1024 characters | No restrictions        |

    All list endpoints return items sorted alphabetically by name (except bindings, which are sorted by ID).

    ### Integrity rules

    - Strict binding: A resource can only have one value per key.
    - No orphans:
      - You cannot delete a key if it has values.
      - You cannot delete a value if it has bindings.

    ### Consumption limits

    | Element                           | Limit  |
    | --------------------------------- | ------ |
    | Number of keys per organization   | 100    |
    | Number of values per key          | 200    |
    | Number of values per organization | 5,000  |
    | Number of bindings per resource   | 50     |.
  version: v1
servers:
- url: https://api.scaleway.com
tags:
- name: Keys
  description: Manage keys.
- name: Values
  description: Manage values.
- name: Keys and values
  description: Manage keys and values.
- name: Bindings
  description: Manage bindings.
components:
  schemas:
    scaleway.annotations.v1.Binding:
      type: object
      properties:
        id:
          type: string
          description: ID of the binding. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        srn:
          type: string
          description: Scaleway Resource Name associated to the binding.
        key:
          description: Key associated to the binding.
          $ref: '#/components/schemas/scaleway.annotations.v1.Binding.Key'
        value:
          description: Value associated to the binding.
          $ref: '#/components/schemas/scaleway.annotations.v1.Binding.Value'
      x-properties-order:
      - id
      - srn
      - key
      - value
    scaleway.annotations.v1.Binding.Key:
      type: object
      properties:
        id:
          type: string
          description: ID of the key. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        name:
          type: string
          description: Name of the key.
      x-properties-order:
      - id
      - name
    scaleway.annotations.v1.Binding.Value:
      type: object
      properties:
        id:
          type: string
          description: ID of the value. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        name:
          type: string
          description: Name of the value.
      x-properties-order:
      - id
      - name
    scaleway.annotations.v1.DeleteAllBindingsMatchingSRNResponse:
      type: object
      properties:
        total_deleted:
          type: integer
          description: Total number of bindings deleted.
          format: uint64
      x-properties-order:
      - total_deleted
    scaleway.annotations.v1.DeleteAllBindingsMatchingValueResponse:
      type: object
      properties:
        total_deleted:
          type: integer
          description: Total number of bindings deleted.
          format: uint64
      x-properties-order:
      - total_deleted
    scaleway.annotations.v1.DeleteAllValuesMatchingKeyResponse:
      type: object
      properties:
        total_deleted:
          type: integer
          description: Total number of values deleted.
          format: uint64
      x-properties-order:
      - total_deleted
    scaleway.annotations.v1.Key:
      type: object
      properties:
        id:
          type: string
          description: ID of the annotation key. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        name:
          type: string
          description: Name of the annotation key.
        description:
          type: string
          description: Description of the annotation key.
      x-properties-order:
      - id
      - name
      - description
    scaleway.annotations.v1.ListAllKeysAndValuesResponse:
      type: object
      properties:
        keys:
          type: array
          description: List of keys with values for an organization, sorted alphabetically
            by name.
          items:
            $ref: '#/components/schemas/scaleway.annotations.v1.ListAllKeysAndValuesResponse.Key'
      x-properties-order:
      - keys
    scaleway.annotations.v1.ListAllKeysAndValuesResponse.Key:
      type: object
      properties:
        id:
          type: string
          description: ID of the key. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        name:
          type: string
          description: Name of the key.
        description:
          type: string
          description: Description of the key.
        values:
          type: array
          description: List of values associated with the key, sorted alphabetically
            by name.
          items:
            $ref: '#/components/schemas/scaleway.annotations.v1.ListAllKeysAndValuesResponse.Value'
      x-properties-order:
      - id
      - name
      - description
      - values
    scaleway.annotations.v1.ListAllKeysAndValuesResponse.Value:
      type: object
      properties:
        id:
          type: string
          description: ID of the value. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        name:
          type: string
          description: Name of the value.
        description:
          type: string
          description: Description of the value.
      x-properties-order:
      - id
      - name
      - description
    scaleway.annotations.v1.ListBindingsResponse:
      type: object
      properties:
        bindings:
          type: array
          description: List of bindings for the organization. Response order by ID.
          items:
            $ref: '#/components/schemas/scaleway.annotations.v1.Binding'
        total_count:
          type: integer
          description: Total number of bindings returned.
          format: uint64
      x-properties-order:
      - bindings
      - total_count
    scaleway.annotations.v1.ListKeysResponse:
      type: object
      properties:
        keys:
          type: array
          description: List of keys for an organization, sorted alphabetically by
            name.
          items:
            $ref: '#/components/schemas/scaleway.annotations.v1.Key'
        total_count:
          type: integer
          description: Total number of keys returned.
          format: uint64
      x-properties-order:
      - keys
      - total_count
    scaleway.annotations.v1.ListValuesResponse:
      type: object
      properties:
        values:
          type: array
          description: List of values for a key, sorted alphabetically by name.
          items:
            $ref: '#/components/schemas/scaleway.annotations.v1.Value'
        total_count:
          type: integer
          description: Total number of values returned.
          format: uint64
      x-properties-order:
      - values
      - total_count
    scaleway.annotations.v1.Value:
      type: object
      properties:
        id:
          type: string
          description: ID of the value. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        key_id:
          type: string
          description: ID of the key the value is associated to. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        name:
          type: string
          description: Name of the value (e.g. "production" for a key "environment").
        description:
          type: string
          description: Description of the value.
      x-properties-order:
      - id
      - key_id
      - name
      - description
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /annotations/v1/all-keys-and-values:
    get:
      tags:
      - Keys and values
      operationId: ListAllKeysAndValues
      summary: List all keys and values for an organization, sorted alphabetically
        by key name and value name.
      parameters:
      - in: query
        name: organization_id
        description: ID of the organization. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.annotations.v1.ListAllKeysAndValuesResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/annotations/v1/all-keys-and-values?organization_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/annotations/v1/all-keys-and-values" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==6170692e-7363-616c-6577-61792e636f6d
  /annotations/v1/bindings:
    get:
      tags:
      - Bindings
      operationId: ListBindings
      summary: List all bindings, or filter by Scaleway Resource Name or value ID.
        Response order by ID.
      parameters:
      - in: query
        name: page
        description: Page number.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Maximum number of bindings on the page.
        schema:
          type: integer
          format: uint32
      - in: query
        name: organization_id
        description: ID of the organization. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: srn
        description: Scaleway Resource Name for which to list all bindings.
        schema:
          type: string
      - in: query
        name: value_id
        description: Value ID for which to list all bindings. (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.annotations.v1.ListBindingsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/annotations/v1/bindings?organization_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/annotations/v1/bindings" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==6170692e-7363-616c-6577-61792e636f6d
    post:
      tags:
      - Bindings
      operationId: CreateBinding
      summary: Attach a value to a resource. Fails if the resource already has a value
        for this key.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.annotations.v1.Binding'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                srn:
                  type: string
                  description: Scaleway Resource Name to associate.
                value_id:
                  type: string
                  description: ID of the value to associate. (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
              x-properties-order:
              - srn
              - value_id
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"srn":"string","value_id":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/annotations/v1/bindings"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/annotations/v1/bindings" \
            X-Auth-Token:$SCW_SECRET_KEY \
            srn="string" \
            value_id="6170692e-7363-616c-6577-61792e636f6d"
  /annotations/v1/bindings/{binding_id}:
    delete:
      tags:
      - Bindings
      operationId: DeleteBinding
      summary: Detach an annotation from a resource.
      parameters:
      - in: path
        name: binding_id
        description: ID of the binding 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/annotations/v1/bindings/{binding_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/annotations/v1/bindings/{binding_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /annotations/v1/bindings/delete-all-matching-srn:
    delete:
      tags:
      - Bindings
      operationId: DeleteAllBindingsMatchingSRN
      summary: Delete ALL bindings associated with a Scaleway Resource Name.
      parameters:
      - in: query
        name: srn
        description: Scaleway Resource Name for which all bindings should be deleted.
        required: true
        schema:
          type: string
      - in: query
        name: organization_id
        description: ID of the organization. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.annotations.v1.DeleteAllBindingsMatchingSRNResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/annotations/v1/bindings/delete-all-matching-srn?organization_id=6170692e-7363-616c-6577-61792e636f6d&srn=string"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/annotations/v1/bindings/delete-all-matching-srn" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==6170692e-7363-616c-6577-61792e636f6d \
            srn==string
  /annotations/v1/bindings/delete-all-matching-value:
    delete:
      tags:
      - Bindings
      operationId: DeleteAllBindingsMatchingValue
      summary: Delete ALL bindings associated with a value.
      parameters:
      - in: query
        name: value_id
        description: ID of the value for which all bindings should be deleted. (UUID
          format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.annotations.v1.DeleteAllBindingsMatchingValueResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/annotations/v1/bindings/delete-all-matching-value?value_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/annotations/v1/bindings/delete-all-matching-value" \
            X-Auth-Token:$SCW_SECRET_KEY \
            value_id==6170692e-7363-616c-6577-61792e636f6d
  /annotations/v1/keys:
    get:
      tags:
      - Keys
      operationId: ListKeys
      summary: List all keys, sorted alphabetically by name.
      parameters:
      - in: query
        name: page
        description: Page number.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Maximum number of keys on the page.
        schema:
          type: integer
          format: uint32
      - in: query
        name: organization_id
        description: ID of the organization. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.annotations.v1.ListKeysResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/annotations/v1/keys?organization_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/annotations/v1/keys" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==6170692e-7363-616c-6577-61792e636f6d
    post:
      tags:
      - Keys
      operationId: CreateKey
      summary: Create an annotation key.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.annotations.v1.Key'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                organization_id:
                  type: string
                  description: ID of the organization. (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                name:
                  type: string
                  description: Name of the annotation key.
                description:
                  type: string
                  description: Description of the annotation key.
              x-properties-order:
              - organization_id
              - name
              - description
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{
              "description": "string",
              "name": "string",
              "organization_id": "6170692e-7363-616c-6577-61792e636f6d"
            }' \
            "https://api.scaleway.com/annotations/v1/keys"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/annotations/v1/keys" \
            X-Auth-Token:$SCW_SECRET_KEY \
            description="string" \
            name="string" \
            organization_id="6170692e-7363-616c-6577-61792e636f6d"
  /annotations/v1/keys/{key_id}:
    get:
      tags:
      - Keys
      operationId: GetKey
      summary: Retrieve a specific key.
      parameters:
      - in: path
        name: key_id
        description: ID of the key 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.annotations.v1.Key'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/annotations/v1/keys/{key_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/annotations/v1/keys/{key_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - Keys
      operationId: UpdateKey
      summary: Update name or description. All associated resources will immediately
        display the new name.
      parameters:
      - in: path
        name: key_id
        description: ID of the key 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.annotations.v1.Key'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type:
                  - string
                  - "null"
                  description: New name of the key.
                description:
                  type:
                  - string
                  - "null"
                  description: New description of the key.
              x-properties-order:
              - name
              - description
      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/annotations/v1/keys/{key_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/annotations/v1/keys/{key_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - Keys
      operationId: DeleteKey
      summary: Delete a key definition. Fails if the key has any associated values.
      parameters:
      - in: path
        name: key_id
        description: ID of the key 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/annotations/v1/keys/{key_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/annotations/v1/keys/{key_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /annotations/v1/values:
    get:
      tags:
      - Values
      operationId: ListValues
      summary: List all values, sorted alphabetically by name.
      parameters:
      - in: query
        name: page
        description: Page number.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Maximum number of values on the page.
        schema:
          type: integer
          format: uint32
      - in: query
        name: organization_id
        description: ID of the organization. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: key_id
        description: ID of the key to list the values for. (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.annotations.v1.ListValuesResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/annotations/v1/values?organization_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/annotations/v1/values" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==6170692e-7363-616c-6577-61792e636f6d
    post:
      tags:
      - Values
      operationId: CreateValue
      summary: Add a value definition to a key.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.annotations.v1.Value'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                key_id:
                  type: string
                  description: ID of the key the value will be bound to. (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                name:
                  type: string
                  description: Name of the value.
                description:
                  type: string
                  description: Description of the value.
              x-properties-order:
              - key_id
              - name
              - description
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{
              "description": "string",
              "key_id": "6170692e-7363-616c-6577-61792e636f6d",
              "name": "string"
            }' \
            "https://api.scaleway.com/annotations/v1/values"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/annotations/v1/values" \
            X-Auth-Token:$SCW_SECRET_KEY \
            description="string" \
            key_id="6170692e-7363-616c-6577-61792e636f6d" \
            name="string"
  /annotations/v1/values/{value_id}:
    get:
      tags:
      - Values
      operationId: GetValue
      summary: Retrieve a specific value.
      parameters:
      - in: path
        name: value_id
        description: ID of the value 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.annotations.v1.Value'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/annotations/v1/values/{value_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/annotations/v1/values/{value_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - Values
      operationId: UpdateValue
      summary: Update name or description.
      parameters:
      - in: path
        name: value_id
        description: ID of the value 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.annotations.v1.Value'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type:
                  - string
                  - "null"
                  description: New name of the value.
                description:
                  type:
                  - string
                  - "null"
                  description: New description of the value.
              x-properties-order:
              - name
              - description
      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/annotations/v1/values/{value_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/annotations/v1/values/{value_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - Values
      operationId: DeleteValue
      summary: Delete a value definition. Fails if the value is currently bound to
        any resource.
      parameters:
      - in: path
        name: value_id
        description: ID of the value 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/annotations/v1/values/{value_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/annotations/v1/values/{value_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /annotations/v1/values/delete-all-matching-key:
    delete:
      tags:
      - Values
      operationId: DeleteAllValuesMatchingKey
      summary: Delete ALL values associated with a key. Fails if any of these values
        are currently bound to any resource.
      parameters:
      - in: query
        name: key_id
        description: ID of the key for which to delete all values. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.annotations.v1.DeleteAllValuesMatchingKeyResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/annotations/v1/values/delete-all-matching-key?key_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/annotations/v1/values/delete-all-matching-key" \
            X-Auth-Token:$SCW_SECRET_KEY \
            key_id==6170692e-7363-616c-6577-61792e636f6d
