Create or update a schema file

PUT {{baseUrl}}/apis/{{apiId}}/schemas/{{schemaId}}/files/{{filePath}}

Creates or updates an API schema file. Include the following in the request body:

  • content — A string value that contains the schema file's stringified contents.

Note:

  • If the provided file path exists, the file is updated with the new contents.

  • If the provided file path does not exist, then a new schema file is created.

  • If the file path contains a / (forward slash) character, then a folder is created. For example, if the file path is the dir/schema.json value, then a dir folder is created with the schema.json file inside.

  • You can only update the root tag for protobuf specifications.

Request Body

{"content"=>"{{fileContent}}"}

HEADERS

KeyDatatypeRequiredDescription
Acceptstring

RESPONSES

status: OK

{"id":"2fdc8ea1-d02e-4e50-989e-6fa28f42b995","createdBy":"12345678","updatedBy":"12345678","createdAt":"2022-03-29T11:37:15Z","updatedAt":"2022-03-29T11:37:15Z","path":"index.json","name":"index.json"}