@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Master Data API - v2
@base https://apiexamples.vtexcommercestable.com.br
@version 1.0
@auth ApiKey X-VTEX-API-AppKey in header | ApiKey X-VTEX-API-AppToken in header | ApiKey VtexIdclientAutCookie in header
@common_fields {dataEntityName: str}
@endpoints 20
@toc api(20)

@endpoint POST /api/dataentities/{dataEntityName}/documents
@required {Content-Type: str, Accept: str}
@optional {_schema: str}
@returns(201) {Id: str, Href: str, DocumentId: str}
@returns(202) {Id: str, Href: str, DocumentId: str}

@endpoint PATCH /api/dataentities/{dataEntityName}/documents
@required {Content-Type: str, Accept: str}
@optional {_schema: str}
@returns(200) {Id: str, Href: str, DocumentId: str}

@endpoint GET /api/dataentities/{dataEntityName}/documents/{id}
@required {Content-Type: str, Accept: str, id: str}
@optional {_fields: str, _schema: str}
@returns(200) {id: str, accountId: str, accountName: str, dataEntityId: str}

@endpoint PUT /api/dataentities/{dataEntityName}/documents/{id}
@required {Accept: str, id: str}
@optional {_where: str, _schema: str}
@returns(204)
@errors {400, 403}

@endpoint PATCH /api/dataentities/{dataEntityName}/documents/{id}
@required {Accept: str, id: str}
@optional {_where: str, _schema: str}
@returns(204)

@endpoint DELETE /api/dataentities/{dataEntityName}/documents/{id}
@required {Content-Type: str, Accept: str, id: str}
@returns(204)

@endpoint GET /api/dataentities/{dataEntityName}/search
@required {Content-Type: str, Accept: str, REST-Range: str}
@optional {_fields: str, _where: str, _schema: str, _sort: str}
@returns(200)
@errors {400, 403, 503}

@endpoint GET /api/dataentities/{dataEntityName}/scroll
@required {Content-Type: str, Accept: str}
@optional {_token: str, _size: int=100, _fields: str, _where: str, _schema: str, _sort: str}
@returns(200)
@errors {400, 429}

@endpoint GET /api/dataentities/{dataEntityName}/schemas
@required {Content-Type: str}
@returns(200)

@endpoint GET /api/dataentities/{dataEntityName}/schemas/{schemaName}
@required {Content-Type: str, schemaName: str}
@returns(200) {properties: map{name: map{type: str}}, v-indexed: [str]}

@endpoint PUT /api/dataentities/{dataEntityName}/schemas/{schemaName}
@required {schemaName: str, properties: map{name: map}}
@optional {v-indexed: [str]}
@returns(200) {Message: str}

@endpoint DELETE /api/dataentities/{dataEntityName}/schemas/{schemaName}
@required {Content-Type: str, schemaName: str}
@returns(204)

@endpoint GET /api/dataentities/{dataEntityName}/indices
@required {Content-Type: str}
@returns(200)

@endpoint PUT /api/dataentities/{dataEntityName}/indices
@required {name: str, multiple: bool, fields: str}
@returns(200)

@endpoint GET /api/dataentities/{dataEntityName}/indices/{index_name}
@required {Content-Type: str, index_name: str}
@returns(200) {name: str, acronym: str, isGlobal: bool, multiple: bool, fields: str}

@endpoint DELETE /api/dataentities/{dataEntityName}/indices/{index_name}
@required {Content-Type: str, index_name: str}
@returns(204)

@endpoint POST /api/dataentities/{dataEntityName}/documents/{id}/clusters
@required {Accept: str, id: str}
@returns(200)

@endpoint GET /api/dataentities/{dataEntityName}/documents/{id}/versions
@required {Content-Type: str, Accept: str, id: str}
@optional {load: bool=true, fields: str=id,dataEntityId,isNewsletterOptIn,createdBy}
@returns(200)

@endpoint GET /api/dataentities/{dataEntityName}/documents/{id}/versions/{versionId}
@required {Content-Type: str, Accept: str, id: str, versionId: str}
@returns(200) {id: str, author: str, document: map{id: str, dataEntityId: str, accountId: str, accountName: str, followers: [str], schemas: [str], email: str}}

@endpoint PUT /api/dataentities/{dataEntityName}/documents/{id}/versions/{versionId}
@required {Content-Type: str, Accept: str, id: str, versionId: str}
@returns(200) {Id: str, Href: str}
@errors {304}

@end
