{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-appsync/json-schema/amazon-appsync-create-api-request-schema.json",
  "title": "CreateApiRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-appsync-apis-api-openapi.yml#/components/schemas/CreateApiRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name for the Api."
    },
    "ownerContact": {
      "type": "string",
      "description": "The owner contact information for the Api."
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "eventConfig": {
      "$ref": "#/$defs/EventConfig"
    }
  },
  "required": [
    "name",
    "eventConfig"
  ],
  "$defs": {
    "AuthMode": {
      "type": "object",
      "properties": {
        "authType": {
          "type": "string",
          "enum": [
            "API_KEY",
            "AWS_IAM",
            "AMAZON_COGNITO_USER_POOLS",
            "OPENID_CONNECT",
            "AWS_LAMBDA"
          ],
          "description": "The authorization type."
        }
      },
      "required": [
        "authType"
      ]
    },
    "AuthProvider": {
      "type": "object",
      "properties": {
        "authType": {
          "type": "string",
          "enum": [
            "API_KEY",
            "AWS_IAM",
            "AMAZON_COGNITO_USER_POOLS",
            "OPENID_CONNECT",
            "AWS_LAMBDA"
          ],
          "description": "The authorization type."
        },
        "cognitoConfig": {
          "$ref": "#/$defs/CognitoConfig"
        },
        "openIDConnectConfig": {
          "$ref": "#/$defs/OpenIDConnectConfig"
        },
        "lambdaAuthorizerConfig": {
          "$ref": "#/$defs/LambdaAuthorizerConfig"
        }
      },
      "required": [
        "authType"
      ]
    },
    "CognitoConfig": {
      "type": "object",
      "properties": {
        "userPoolId": {
          "type": "string",
          "description": "The user pool ID."
        },
        "awsRegion": {
          "type": "string",
          "description": "The Amazon Web Services Region in which the user pool was created."
        },
        "appIdClientRegex": {
          "type": "string",
          "description": "A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied."
        }
      },
      "required": [
        "userPoolId",
        "awsRegion"
      ]
    },
    "EventConfig": {
      "type": "object",
      "properties": {
        "authProviders": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AuthProvider"
          },
          "description": "A list of authorization providers."
        },
        "connectionAuthModes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AuthMode"
          },
          "description": "A list of valid authorization modes for the Event API connections."
        },
        "defaultPublishAuthModes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AuthMode"
          },
          "description": "A list of valid authorization modes for the Event API publishing."
        },
        "defaultSubscribeAuthModes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AuthMode"
          },
          "description": "A list of valid authorization modes for the Event API subscriptions."
        },
        "logConfig": {
          "$ref": "#/$defs/EventLogConfig"
        }
      },
      "required": [
        "authProviders",
        "connectionAuthModes",
        "defaultPublishAuthModes",
        "defaultSubscribeAuthModes"
      ]
    },
    "EventLogConfig": {
      "type": "object",
      "properties": {
        "logLevel": {
          "type": "string",
          "enum": [
            "NONE",
            "ERROR",
            "ALL",
            "INFO",
            "DEBUG"
          ],
          "description": "The type of information to log for the Event API."
        },
        "cloudWatchLogsRoleArn": {
          "type": "string",
          "description": "The IAM service role that AppSync assumes to publish CloudWatch Logs in your account."
        }
      },
      "required": [
        "logLevel",
        "cloudWatchLogsRoleArn"
      ]
    },
    "LambdaAuthorizerConfig": {
      "type": "object",
      "properties": {
        "authorizerResultTtlInSeconds": {
          "type": "integer",
          "description": "The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response."
        },
        "authorizerUri": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3), or an alias ARN. Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following: aws lambda add-permission --function-name \"arn:aws:lambda:us-east-2:111122223333:function:my-function\" --statement-id \"appsync\" --principal appsync.amazonaws.com --action lambda:InvokeFunction"
        },
        "identityValidationExpression": {
          "type": "string",
          "description": "A regular expression for validation of tokens before the Lambda function is called."
        }
      },
      "required": [
        "authorizerUri"
      ]
    },
    "OpenIDConnectConfig": {
      "type": "object",
      "properties": {
        "issuer": {
          "type": "string",
          "description": "The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token."
        },
        "clientId": {
          "type": "string",
          "description": "The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time."
        },
        "iatTTL": {
          "type": "integer",
          "description": "The number of milliseconds that a token is valid after it's issued to a user."
        },
        "authTTL": {
          "type": "integer",
          "description": "The number of milliseconds that a token is valid after being authenticated."
        }
      },
      "required": [
        "issuer"
      ]
    }
  }
}