Model - Amazon API Gateway

Model

Represents a data model for an API. Supported only for WebSocket APIs. See Create Models and Mapping Templates for Request and Response Mappings.

URI

/v2/apis/apiId/models/modelId

HTTP methods

GET

Operation ID: GetModel

Gets a Model.

Path parameters
NameTypeRequiredDescription
modelIdStringTrue

The model ID.

apiIdStringTrue

The API identifier.

Responses
Status codeResponse modelDescription
200Model

Success

404NotFoundException

The resource specified in the request was not found.

429LimitExceededException

The client is sending more than the allowed number of requests per unit of time.

DELETE

Operation ID: DeleteModel

Deletes a Model.

Path parameters
NameTypeRequiredDescription
modelIdStringTrue

The model ID.

apiIdStringTrue

The API identifier.

Responses
Status codeResponse modelDescription
204None

The request has succeeded, and there is no additional content to send in the response payload body.

404NotFoundException

The resource specified in the request was not found.

429LimitExceededException

The client is sending more than the allowed number of requests per unit of time.

PATCH

Operation ID: UpdateModel

Updates a Model.

Path parameters
NameTypeRequiredDescription
modelIdStringTrue

The model ID.

apiIdStringTrue

The API identifier.

Responses
Status codeResponse modelDescription
200Model

Success

400BadRequestException

One of the parameters in the request is invalid.

404NotFoundException

The resource specified in the request was not found.

409ConflictException

The resource already exists.

429LimitExceededException

The client is sending more than the allowed number of requests per unit of time.

Schemas

Request bodies

{ "name": "string", "description": "string", "schema": "string", "contentType": "string" }

Response bodies

{ "modelId": "string", "name": "string", "description": "string", "schema": "string", "contentType": "string" }
{ "message": "string" }
{ "message": "string", "resourceType": "string" }
{ "message": "string" }
{ "message": "string", "limitType": "string" }

Properties

BadRequestException

The request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.

PropertyTypeRequiredDescription
message

string

False

Describes the error encountered.

ConflictException

The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.

PropertyTypeRequiredDescription
message

string

False

Describes the error encountered.

LimitExceededException

A limit has been exceeded. See the accompanying error message for details.

PropertyTypeRequiredDescription
limitType

string

False

The limit type.

message

string

False

Describes the error encountered.

Model

Represents a data model for an API. Supported only for WebSocket APIs. See Create Models and Mapping Templates for Request and Response Mappings.

PropertyTypeRequiredDescription
contentType

string

False

The content-type for the model, for example, "application/json".

description

string

False

The description of the model.

modelId

string

False

The model identifier.

name

string

True

The name of the model. Must be alphanumeric.

schema

string

False

The schema for the model. For application/json models, this should be JSON schema draft 4 model.

NotFoundException

The resource specified in the request was not found. See the message field for more information.

PropertyTypeRequiredDescription
message

string

False

Describes the error encountered.

resourceType

string

False

The resource type.

UpdateModelInput

Represents the input parameters for an UpdateModel request. Supported only for WebSocket APIs.

PropertyTypeRequiredDescription
contentType

string

False

The content-type for the model, for example, "application/json".

description

string

False

The description of the model.

name

string

False

The name of the model.

schema

string

False

The schema for the model. For application/json models, this should be JSON schema draft 4 model.

See also

For more information about using this API in one of the language-specific AWS SDKs and references, see the following:

GetModel

DeleteModel

UpdateModel