@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Master Data API - v1
@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 {Content-Type: str=application/json, Accept: str=application/vnd.vtex.ds.v10+json}
@endpoints 26
@hint download_for_search
@toc api(26)

@endpoint GET /api/dataentities
@returns(200)
@errors {403}

@endpoint GET /api/dataentities/{acronym}
@required {acronym: str}
@returns(200) {acronym: str, name: str, primaryKeyType: str, allowGetAll: bool, fields: [map]}
@errors {403}

@endpoint POST /api/dataentities/{acronym}/documents
@required {acronym: str}
@optional {{fieldName}: str}
@returns(201) {id: str, href: str, documentId: str}

@endpoint PATCH /api/dataentities/{acronym}/documents
@required {acronym: str}
@optional {id: str, {fieldName}: str}
@returns(201) {id: str, href: str, documentId: str}
@errors {304}

@endpoint GET /api/dataentities/{acronym}/documents/{id}
@required {acronym: str, id: str}
@optional {_fields: str}
@returns(200) {{customProperty}: str, id: str, accountId: str, accountName: str, dataEntityId: str}
@errors {403}

@endpoint PUT /api/dataentities/{acronym}/documents/{id}
@required {acronym: str, id: str}
@optional {{fieldName}: str}
@returns(204)

@endpoint PATCH /api/dataentities/{acronym}/documents/{id}
@required {acronym: str, id: str}
@returns(204)

@endpoint DELETE /api/dataentities/{acronym}/documents/{id}
@required {acronym: str, id: str}
@returns(204)

@endpoint GET /api/dataentities/{acronym}/documents/{id}/versions
@required {acronym: str, id: str}
@returns(200)

@endpoint GET /api/dataentities/{acronym}/documents/{id}/versions/{versionId}
@required {acronym: str, id: str, versionId: str}
@returns(200) {id: str, author: str, document: map{{customProperty}: str, id: str, accountId: str, accountName: str, dataEntityId: str}}

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

@endpoint GET /api/dataentities/{acronym}/scroll
@required {acronym: str}
@optional {_fields: str, _where: str, _sort: str, _size: str, _token: str}
@returns(200)
@errors {400, 429}

@endpoint GET /api/dataentities/{acronym}/search
@required {REST-Range: str, acronym: str}
@optional {_fields: str, _where: str, _sort: str}
@returns(200)
@errors {503}

@endpoint GET /api/dataentities/{acronym}/documents/{id}/{field}/attachments/{file-name}
@required {acronym: str, id: str, field: str, file-name: str}
@returns(200)

@endpoint POST /api/dataentities/{acronym}/documents/{id}/{field}/attachments
@required {acronym: str, id: str, field: str}
@returns(204)

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

@endpoint PUT /api/dataentities/{acronym}/documents/{id}/score
@required {acronym: str, id: str}
@returns(204)

@endpoint PUT /api/dataentities/{acronym}/documents/{id}/score/{field-name}
@required {acronym: str, id: str, field-name: str, key: str, point: int(int32), until: str}
@returns(204)

@endpoint DELETE /api/dataentities/{acronym}/documents/{id}/score/{field-name}
@required {acronym: str, id: str, field-name: str, key: str}
@returns(204)

@endpoint POST /api/dataentities/CL/documents
@optional {_schema: str, email: str, firstName: str, lastName: str, phone: str, documentType: str, document: str, isCorporate: bool, isNewsletterOptIn: bool, localeDefault: str, corporateDocument: str, homePhone: str, cellPhone: str, corporateName: str, tradeName: str, stateRegistration: str, isFreeStateRegistration: bool, priceTables: str, restrictions: map{vtex.catalog: map, vtex.checkout: map, vtex.payments: map}}
@returns(200) {Id: str, Href: str}

@endpoint PATCH /api/dataentities/CL/documents/{id}
@required {id: str}
@optional {_schema: str, email: str, firstName: str, lastName: str, phone: str, documentType: str, document: str, isCorporate: bool, isNewsletterOptIn: bool, localeDefault: str, corporateDocument: str, homePhone: str, cellPhone: str, corporateName: str, tradeName: str, stateRegistration: str, isFreeStateRegistration: bool, priceTables: str, restrictions: map{vtex.catalog: map, vtex.checkout: map, vtex.payments: map}}
@returns(200) {Id: str, Href: str}

@endpoint DELETE /api/dataentities/CL/documents/{id}
@required {id: str}
@returns(204)

@endpoint POST /api/dataentities/AD/documents
@optional {_schema: str, addressName: str, addressLabel: str, addressType: str(commercial/invoice), receiverName: str, city: str, state: str, country: str, postalCode: str, street: str, number: str, neighborhood: str, complement: str, reference: str, geoCoordinate: str, userId: str}
@returns(200) {Id: str, Href: str}

@endpoint GET /api/dataentities/AD/documents/{addressId}
@required {addressId: str, _fields: str=_all}
@returns(200) {addressLabel: str?, addressType: str?, city: str?, complement: str?, country: str?, countryfake: str?, geoCoordinate: str?, neighborhood: str?, number: str?, postalCode: str?, receiverName: str?, reference: str?, state: str?, street: str?, userId: str?, id: str?, accountId: str?, accountName: str?, dataEntityId: str?, createdBy: str?, createdIn: str?, updatedBy: str?, updatedIn: str?, lastInteractionBy: str?, lastInteractionIn: str?, followers: [str]?, tags: [str]?, auto_filter: str?}

@endpoint PATCH /api/dataentities/AD/documents/{addressId}
@required {addressId: str}
@optional {_schema: str, addressName: str, addressLabel: str, addressType: str(commercial/invoice), receiverName: str, city: str, state: str, country: str, postalCode: str, street: str, number: str, neighborhood: str, complement: str, reference: str, geoCoordinate: str, userId: str}
@returns(200) {Id: str, Href: str}

@endpoint DELETE /api/dataentities/AD/documents/{addressId}
@required {addressId: str}
@returns(204)

@end
