Mutation

update_site_api_definition_authentications

Updates the Authentication for an API Definition.

Input Fields

id(): ID!
The unique identifier of the API definition to be updated
authentications(): [ApiAuthenticationInput!]!
A list of the API authentication schemes (for example: Basic, Bearer Token, API Key).

Return Fields

site(): Site
The updated site.

Example

Query
mutation UpdateSiteApiDefinitionAuthentications($input: UpdateSiteApiDefinitionAuthenticationsInput!) {
  update_site_api_definition_authentications(input: $input) {
    site {
      id
      api_definitions {
        id
        file_based_api_definition {
          filename
          authentications {
            ... on ApiKeyAuthentication {
              type
              label
              api_key_destination
              parameter_name
            }
          }
        }
      }
    }
  }
}
Variables
{
  "input": {
    "authentications": [
      {
        "api_key_authentication": {
          "api_key_destination": "header",
          "key": "example-api-key",
          "label": "ApiKey",
          "parameter_name": "X-API-Key"
        }
      }
    ],
    "id": "155d6a7a-a109-324f-86ae-dea2b4b50976"
  }
}
Result
{
  "data": {
    "update_site_api_definition_authentications": {
      "site": {
        "id": "1",
        "api_definitions": [
          {
            "id": "155d6a7a-a109-324f-86ae-dea2b4b50976",
            "file_based_api_definition": {
              "filename": "openapi.json",
              "authentications": [
                {
                  "type": "apikey",
                  "label": "ApiKey",
                  "api_key_destination": "header",
                  "parameter_name": "X-API-Key"
                }
              ]
            }
          }
        ]
      }
    }
  }
}