{ "openapi": "3.0.0", "info": { "title": "Master Data API - v1", "description": "Master Data is a highly customizable VTEX database solution, which enables you to create applications. By default, Master Data is used to store and organize Customer data from your store. It features a powerful search engine, allowing you to store, search, expand, and customize data. Learn more about [Master Data v1](https://help.vtex.com/en/tutorial/master-data--4otjBnR27u4WUIciQsmkAw).\r\n\r\n ## Index\r\n\r\n### Data Entities\r\n\r\nObtain information about the structure of the data entities.\r\n\r\n- `GET` [List data entities](https://developers.vtex.com/docs/api-reference/masterdata-api#get-/api/dataentities)\r\n- `GET` [Get data entity structure](https://developers.vtex.com/docs/api-reference/masterdata-api#get-/api/dataentities/-acronym-)\r\n\r\n### Documents\r\n\r\nCreate, update and retrieve documents.\r\n\r\n- `POST` [Create new document](https://developers.vtex.com/docs/api-reference/masterdata-api#post-/api/dataentities/-acronym-/documents)\r\n- `PUT` [Create or update entire document](https://developers.vtex.com/docs/api-reference/masterdata-api#put-/api/dataentities/-acronym-/documents)\r\n- `PATCH` [Create or update partial document](https://developers.vtex.com/docs/api-reference/masterdata-api#patch-/api/dataentities/-acronym-/documents)\r\n- `GET` [Get document](https://developers.vtex.com/docs/api-reference/masterdata-api#get-/api/dataentities/-acronym-/documents/-id-)\r\n- `PUT` [Update entire document](https://developers.vtex.com/docs/api-reference/masterdata-api#put-/api/dataentities/-acronym-/documents/-id-)\r\n- `PATCH` [Update partial document](https://developers.vtex.com/docs/api-reference/masterdata-api#patch-/api/dataentities/-acronym-/documents/-id-)\r\n- `DELETE` [Delete document](https://developers.vtex.com/docs/api-reference/masterdata-api#delete-/api/dataentities/-acronym-/documents/-id-)\r\n\r\n### Versions\r\n\r\nMaster Data documents are versioned. This means that, for each change, a new version is generated. The versions endpoints allow you to query the versions and also apply the state of a document to the most current version.\r\n\r\n- `GET` [List versions](https://developers.vtex.com/docs/api-reference/masterdata-api#get-/api/dataentities/-acronym-/documents/-id-/versions)\r\n- `GET` [Get version](https://developers.vtex.com/docs/api-reference/masterdata-api#get-/api/dataentities/-acronym-/documents/-id-/versions/-versionId-)\r\n- `PUT` [Put version](https://developers.vtex.com/docs/api-reference/masterdata-api#put-/api/dataentities/-acronym-/documents/-id-/versions/-versionId-)\r\n\r\n### Scroll\r\n\r\nDeveloped for external integration scenarios. If your collection is over 10.000 documents or you need to query the entire VTEX Master Data database, use these endpoints.\r\n\r\n- `GET` [Scroll documents](https://developers.vtex.com/docs/api-reference/masterdata-api#get-/api/dataentities/-acronym-/scroll)\r\n\r\n### Search\r\n\r\nQuery a collection of documents.\r\n\r\n- `GET` [Search documents](https://developers.vtex.com/docs/api-reference/masterdata-api#get-/api/dataentities/-acronym-/search)\r\n\r\n### Attachments\r\n\r\nUpload and download files.\r\n\r\n- `GET` [Retrieve attachment](https://developers.vtex.com/docs/api-reference/masterdata-api#get-/api/dataentities/-acronym-/documents/-id-/-field-/attachments/-file-name-)\r\n- `POST` [Save attachment](https://developers.vtex.com/docs/api-reference/masterdata-api#post-/api/dataentities/-acronym-/documents/-id-/-field-/attachments)\r\n\r\n### Clusters\r\n\r\nCheck if a particular document is in one or more clusters.\r\n\r\n- `POST` [Validate Document by Clusters](https://developers.vtex.com/docs/api-reference/masterdata-api#post-/api/dataentities/-acronym-/documents/-id-/clusters)\r\n\r\n### Score\r\n\r\nRecord and remove points in `Score2` type fields. Learn more about [Data entity field types](https://help.vtex.com/en/tutorial/creating-data-entity--tutorials_1265#understanding-the-types). \r\n\r\n- `PUT` [Put scores](https://developers.vtex.com/docs/api-reference/masterdata-api#put-/api/dataentities/-acronym-/documents/-id-/score)\r\n- `PUT` [Put score by field](https://developers.vtex.com/docs/api-reference/masterdata-api#put-/api/dataentities/-acronym-/documents/-id-/score/-field-name-)\r\n- `DELETE` [Delete score by field](https://developers.vtex.com/docs/api-reference/masterdata-api#delete-/api/dataentities/-acronym-/documents/-id-/score/-field-name-)", "contact": {}, "version": "1.0" }, "servers": [ { "url": "https://{accountName}.{environment}.com.br", "description": "VTEX server URL.", "variables": { "accountName": { "description": "Name of the VTEX account. Used as part of the URL", "default": "apiexamples" }, "environment": { "description": "Environment to use. Used as part of the URL.", "enum": [ "vtexcommercestable" ], "default": "vtexcommercestable" } } } ], "paths": { "/api/dataentities": { "get": { "tags": [ "Data Entities" ], "summary": "List data entities", "description": "Retrieves the list of existing data entities in the store.", "operationId": "Listdataentities", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Listdataentity" } }, "example": [ { "acronym": "SP", "name": "Sample", "primaryKeyType": "GUID", "allowGetAll": false }, { "acronym": "AD", "name": "Endereço", "primaryKeyType": "GUID", "allowGetAll": false }, { "acronym": "CL", "name": "Cliente", "primaryKeyType": "GUID", "allowGetAll": false } ] } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "type": "object", "properties": { "Message": { "type": "string" } } }, "example": { "Message": "Unauthorized" } } } } }, "deprecated": false } }, "/api/dataentities/{acronym}": { "get": { "tags": [ "Data Entities" ], "summary": "Get data entity structure", "description": "Returns the data entity structure with its respective fields and data type.", "operationId": "Getdataentitystructure", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "name": "acronym", "in": "path", "description": "Data entity acronym.", "required": true, "style": "simple", "schema": { "type": "string", "example": "SP" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Getdataentityfields" }, "example": { "acronym": "SP", "name": "Sample", "primaryKeyType": "GUID", "allowGetAll": false, "fields": [ { "name": "updatedIn", "type": "Date and Time", "displayName": "Atualizado em", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": true }, { "name": "updatedBy", "type": "User Login", "displayName": "Atualizado por", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": true }, { "name": "Auto_Increment", "type": "Auto Increment", "displayName": "Auto increment", "isNullable": true, "isSearchable": false, "isFilter": false, "isInternal": false }, { "name": "Boolean", "type": "Boolean", "displayName": "Boolean", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "createdIn", "type": "Date and Time", "displayName": "Criado em", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": true }, { "name": "createdBy", "type": "User Login", "displayName": "Criado por", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": true }, { "name": "Currency", "type": "Currency", "displayName": "Currency", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "Date", "type": "Date", "displayName": "Date", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "Date_Time", "type": "Date and Time", "displayName": "Date and Time", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "Decimal", "type": "Decimal", "displayName": "Decimal", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "Email", "type": "Email", "displayName": "Email", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false }, { "name": "dataEntityId", "type": "Varchar 10", "displayName": "Entidade de dados", "isNullable": false, "isSearchable": true, "isFilter": false, "isInternal": true }, { "name": "File", "type": "File", "displayName": "File", "isNullable": true, "isSearchable": false, "isFilter": false, "isInternal": false }, { "name": "auto_filter", "type": "Text", "displayName": "Filtro automático", "isNullable": true, "isSearchable": false, "isFilter": false, "isInternal": true }, { "name": "accountId", "type": "Varchar 50", "displayName": "ID da loja", "isNullable": false, "isSearchable": false, "isFilter": false, "isInternal": true }, { "name": "id", "type": "Varchar 100", "displayName": "Id do documento", "isNullable": false, "isSearchable": true, "isFilter": false, "isInternal": true }, { "name": "Integer", "type": "Integer", "displayName": "Integer", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "Long", "type": "Long", "displayName": "Long", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "accountName", "type": "Varchar 100", "displayName": "Nome da loja", "isNullable": false, "isSearchable": true, "isFilter": false, "isInternal": true }, { "name": "Percent", "type": "Percent", "displayName": "Percent", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "Relationship", "type": "Relationship", "displayName": "Relationship", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false }, { "name": "Score2", "type": "Score2", "displayName": "Score2", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "followers", "type": "Text", "displayName": "Seguidores", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": true }, { "name": "tags", "type": "Text", "displayName": "Tags", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": true }, { "name": "Text", "type": "Text", "displayName": "Text", "isNullable": true, "isSearchable": false, "isFilter": false, "isInternal": false }, { "name": "Time", "type": "Time", "displayName": "Time", "isNullable": true, "isSearchable": false, "isFilter": false, "isInternal": false }, { "name": "lastInteractionIn", "type": "Date and Time", "displayName": "Ultima interação em", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": true }, { "name": "lastInteractionBy", "type": "User Login", "displayName": "Ultima interação por", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": true }, { "name": "URL", "type": "URL", "displayName": "URL", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "User_Login", "type": "User Login", "displayName": "User Login", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false }, { "name": "Varchar10", "type": "Varchar 10", "displayName": "Varchar 10", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false }, { "name": "Varchar100", "type": "Varchar 100", "displayName": "Varchar 100", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false }, { "name": "Varchar50", "type": "Varchar 50", "displayName": "Varchar 50", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false }, { "name": "Varchar750", "type": "Varchar 750", "displayName": "Varchar 750", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false } ] } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "type": "object", "properties": { "Message": { "type": "string" } } }, "example": { "Message": "Unauthorized" } } } } }, "deprecated": false } }, "/api/dataentities/{acronym}/documents": { "post": { "tags": [ "Documents" ], "summary": "Create new document", "description": "Creates a new document with an ID automatically generated by VTEX, corresponding to a given data entity. The request body is a JSON object where the key is the name of the field.", "operationId": "Createnewdocument", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object" }, "example": { "Boolean": true, "Currency": 2.5, "Date": "1992-11-17", "Date_Time": "2016-09-14T19:21:01.3163733Z", "Decimal": 2.5, "Email": "meu@email.com", "Integer": 1000000, "Long": 1000000000, "Percent": 85.42, "Time": "23:50", "URL": "http://www.vtex.com", "Varchar10": "Lorem ipsu", "Varchar50": "Lorem ipsum dolor sit amet, consectetur adipiscing", "Varchar750": "Lorem ipsum dolor sit amet, consectetur adipiscing elit...", "Varchar100": "Lorem ipsum dolor sit amet, consectetur adipiscing elit...", "Relationship": "5eb31afb-7ab0-11e6-94b4-0a44686e393f", "Text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit..." } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IdHrefDocumentID" }, "example": { "Id": "CL-be30ed0b-78ec-11ee-83ab-0eca8d1868e1", "Href": "http://apiexamples.vtexcommercestable.com.br/api/dataentities/CL/documents/be30ed0b-78ec-11ee-83ab-0eca8d1868e1", "DocumentId": "be30ed0b-78ec-11ee-83ab-0eca8d1868e1" } } } } }, "deprecated": false }, "patch": { "tags": [ "Documents" ], "summary": "Create partial document", "description": "Creates a partial document, sending only some of the fields.", "operationId": "Createorupdatepartialdocument", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "Unique identifier of the document to be created.", "example": "4e4c55ac-e491-11e6-94f4-0ac138d2d42e" }, "additionalProperties": { "type": "string", "description": "Field(s) to be filled in and its respective value(s)." } } }, "example": { "id": "4e4c55ac-e491-11e6-94f4-0ac138d2d42e", "addressName": "4726026151251" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IdHrefDocumentID" }, "example": { "Id": "CL-be30ed0b-78ec-11ee-83ab-0eca8d1868e1", "Href": "http://apiexamples.vtexcommercestable.com.br/api/dataentities/CL/documents/be30ed0b-78ec-11ee-83ab-0eca8d1868e1", "DocumentId": "be30ed0b-78ec-11ee-83ab-0eca8d1868e1" } } } } }, "deprecated": false } }, "/api/dataentities/{acronym}/documents/{id}": { "get": { "tags": [ "Documents" ], "summary": "Get document", "description": "Retrieves a document.\r\n\r\nAssign the `_fields` parameter in the query string to retrieve the desired fields. If you want to return all the fields use `_fields=_all`.", "operationId": "Getdocument", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "$ref": "#/components/parameters/id" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Document" }, "example": { "id": "2f5dde81-1613-11ea-82ee-12f868feb457", "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", "accountName": "apiexamples", "dataEntityId": "AS" } } } } }, "deprecated": false }, "put": { "tags": [ "Documents" ], "summary": "Create document with custom ID or Update entire document", "description": "This endpoint updates all fields of a given document. Creates a new document with a custom ID, or updates an entire document if there is already a document with the informed ID.\r\n\r\n> You can use this request to create or update documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update.", "operationId": "Updateentiredocument", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "$ref": "#/components/parameters/id" } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object" }, "example": { "Boolean": true, "Currency": 2.5, "Date": "1992-11-17", "Date_Time": "2016-09-14T19:21:01.3163733Z", "Decimal": 2.5, "Email": "meu@email.com", "Integer": 1000000, "Long": 1000000000, "Percent": 85.42, "Time": "23:50", "URL": "http://www.vtex.com", "Varchar10": "Lorem ipsu", "Varchar50": "Lorem ipsum dolor sit amet, consectetur adipiscing", "Varchar750": "Lorem ipsum dolor sit amet, consectetur adipiscing elit...", "Varchar100": "Lorem ipsum dolor sit amet, consectetur adipiscing elit...", "Relationship": "5eb31afb-7ab0-11e6-94b4-0a44686e393f", "Text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit..." } } }, "required": true }, "responses": { "204": { "description": "No Content" } }, "deprecated": false }, "patch": { "tags": [ "Documents" ], "summary": "Update partial document", "description": "Updates a subset of fields of a document, without impacting the other fields.", "operationId": "Updatepartialdocument", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "$ref": "#/components/parameters/id" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "description": "Object with the fields to be updated and their respective values." }, "example": { "addressName": "4726026151253" } } }, "required": true }, "responses": { "204": { "description": "No Content" } }, "deprecated": false }, "delete": { "tags": [ "Documents" ], "summary": "Delete document", "description": "Deletes a document.", "operationId": "Deletedocument", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "$ref": "#/components/parameters/id" } ], "responses": { "204": { "description": "No Content" } }, "deprecated": false } }, "/api/dataentities/{acronym}/documents/{id}/versions": { "get": { "tags": [ "Versions" ], "summary": "List versions", "description": "Lists all versions of a document.", "operationId": "Listversions", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "$ref": "#/components/parameters/id" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Listversion" } }, "example": [ { "id": "_EAR0cJ7XB5k5grnmm0zeKGlVvVM9WCPV_", "date": "2016-10-18T16:53:32+00:00" }, { "id": "_E5SH9WXVvhPBNnbQtYAAGqrIysIeNYhy_", "date": "2016-09-08T20:11:42+00:00" }, { "id": "_cwVfOG7S6XeAiDBhNpLiJM1cwRiJcvdp_", "date": "2016-07-14T00:36:36+00:00" } ] } } } }, "deprecated": false } }, "/api/dataentities/{acronym}/documents/{id}/versions/{versionId}": { "get": { "tags": [ "Versions" ], "summary": "Get version", "description": "Returns the version of a document.", "operationId": "Getversion", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "$ref": "#/components/parameters/id" }, { "name": "versionId", "in": "path", "description": "Unique identifier of the version to retrieve.", "required": true, "style": "simple", "schema": { "type": "string", "example": "_X58kLameckHYRuBMUbaimlhwqslsrrwT_" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Getversion" }, "example": { "id": "version-id", "author": "user-id", "document": { "id": "2f5dde81-1613-11ea-82ee-12f868feb457", "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", "accountName": "apiexamples", "dataEntityId": "AS" } } } } } }, "deprecated": false }, "put": { "tags": [ "Versions" ], "summary": "Update version", "description": "Updates the version of a document.", "operationId": "Putversion", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "$ref": "#/components/parameters/id" }, { "name": "versionId", "in": "path", "description": "Unique identifier of the version to update.", "required": true, "style": "simple", "schema": { "type": "string", "example": "_X58kLameckHYRuBMUbaimlhwqslsrrwT_" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IdHref" }, "example": { "Id": "CL-b818cbda-e489-11e6-94f4-0ac138d2d42e", "Href": "http://{{accountName}}.vtexcommercestable.com.br/api/dataentities/CL/documents/b818cbda-e489-11e6-94f4-0ac138d2d42e" } } } }, "304": { "description": "Not modified. This response happens when the `versionId` informed in the path already corresponds to the current version of the document." } }, "deprecated": false } }, "/api/dataentities/{acronym}/scroll": { "get": { "tags": [ "Scroll" ], "summary": "Scroll documents", "description": "Returns a list of documents according to the query parameter filters.\n\r\n\rIt is possible to use all the query params described in the [Search documents](https://developers.vtex.com/docs/api-reference/masterdata-api#get-/api/dataentities/-acronym-/search?endpoint=get-/api/dataentities/-acronym-/search) endpoint to perform filters.\r\n\r\n>⚠️ Avoid sending too many requests with wildcards (`*`) in the search parameters or that use the `keyword` parameter. This may lead to this endpoint being temporarily blocked for your account. If this happens, you will receive an error with status code `429`.\r\n\r\n>⚠️ To inform the number of documents per request, use the query string parameter `_size`, which has the maximum value of 1000.\r\n\r\nIn the first request, the `X-VTEX-MD-TOKEN` token will be obtained in the header. This token must be passed to the next request in the query string `_token` parameter. The token has a timeout of 10 minutes, which refreshes after each request.\r\n\r\nAfter the token is obtained, it is no longer necessary to send the filter or document size per page parameters. You only need to resend the token until the document collection is empty.\r\n\r\n### First request example:\r\n```\r\n/dataentities/CL/scroll?isCluster=true&_size=250&_fields=email,firstName\r\n```\r\n\r\nAfter the first request, retrieve the token in the header `X-VTEX-MD-TOKEN` and make the next requests.\r\n\r\n### Example of subsequent requests:\r\n```\r\n/dataentities/CL/scroll?_token=tokenvalueexample\r\n```", "operationId": "Scrolldocuments", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "name": "_fields", "in": "query", "description": "Fields that will be returned by document. Separate field names with commas.", "required": false, "style": "form", "schema": { "type": "string", "example": "email,firstName,document" } }, { "name": "_where", "in": "query", "description": "Specification of filters.", "required": false, "style": "form", "schema": { "type": "string", "example": "firstName is not null" } }, { "name": "_keyword", "in": "query", "description": "String to search across fields.", "required": false, "style": "form", "schema": { "type": "string", "example": "jane" } }, { "name": "_sort", "in": "query", "description": "Inform a field name plus `ASC` to sort results by this field value in ascending order or `DESC` to sort by descending order.", "required": false, "style": "form", "schema": { "type": "string", "example": "firstName ASC" } }, { "name": "_size", "in": "query", "description": "Maximum amount of documents returned per request. The maximum value you can set is `1000`.", "required": false, "style": "form", "schema": { "type": "string", "example": "10" } }, { "name": "_token", "in": "query", "description": "Value of the `X-VTEX-MD-TOKEN` token obtained in the header of the first request, necessary only on subsequent requests to continue scrolling through documents.", "required": false, "style": "form", "schema": { "type": "string", "example": "123456" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "description": "List of documents.", "items": { "type": "object", "description": "Object representing each document.", "properties": { "additionalProperties": { "type": "string", "description": "Custom properties." }, "id": { "type": "string", "description": "Unique identifier of the document." }, "accountId": { "type": "string", "description": "Unique identifier of the account." }, "accountName": { "type": "string", "description": "Account name." }, "dataEntityId": { "type": "string", "description": "Two-letter string that identifies the data entity." } } } }, "example": [ { "id": "2f5dde81-1613-11ea-82ee-12f868feb457", "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", "accountName": "apiexamples", "dataEntityId": "AS" }, { "id": "3b3a3fc9-164b-11ea-82ee-121449f60ecb", "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", "accountName": "apiexamples", "dataEntityId": "AS" } ] } } }, "429": { "description": "Too Many Requests. Wildcard queries temporarily blocked due to excessive usage. Consider adjusting your code to remove them or reduce the rate of search requests with wildcards (*). This temporary block may also be due to excessive use of requests with the parameter `keyword`." } }, "deprecated": false } }, "/api/dataentities/{acronym}/search": { "get": { "tags": [ "Search" ], "summary": "Search documents", "description": "Searches Master Data v1 documents with highly customizable filters.\r\n\r\n> Learn more about [Master Data v1 search queries](https://developers.vtex.com/vtex-rest-api/docs/how-the-queries-in-master-data-v1-work).\r\n\r\n## Query Examples\r\n\r\n\r\n### Simple filter\r\n\r\n```\r\n/dataentities/CL/search?email=my@email.com\r\n```\r\n\r\n### Complex filter\r\n\r\n```\r\n/dataentities/CL/search?_where=(firstName=Jon OR lastName=Smith) OR (createdIn between 2001-01-01 AND 2016-01-01)\r\n```\r\n\r\n### Filter by range\r\n\r\n#### Date Range\r\n\r\n```\r\n/dataentities/CL/search?_where=createdIn between 2001-01-01 AND 2016-01-01\r\n```\r\n\r\n#### Range numeric fields\r\n\r\n```\r\n/dataentities/CL/search?_where=age between 18 AND 25\r\n```\r\n\r\n### Partial filter\r\n\r\n```\r\n/dataentities/CL/search?firstName=*Maria*\r\n```\r\n\r\n### Filter for null values\r\n\r\n```\r\n/dataentities/CL/search?_where=firstName is null\r\n```\r\n\r\n### Filter for non-null values\r\n\r\n```\r\n/dataentities/CL/search?_where=firstName is not null\r\n```\r\n\r\n### Filter for difference\r\n```\r\n/dataentities/CL/search?_where=firstName<>maria\r\n```\r\n\r\n### Filter greater than or less than\r\n```\r\n/dataentities/CL/search?_where=number>5\r\n/dataentities/CL/search?_where=date<2001-01-01\r\n```\n\r\n\r> Avoid sending too many requests with wildcards (`*`) in the search parameters or that use the `keyword` parameter. This may lead to this endpoint being temporarily blocked for your account. If this happens you will receive an error with status code `503`.", "operationId": "Searchdocuments", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "name": "REST-Range", "in": "header", "description": "Defines the collection of documents to be returned. A range within the collection limited by 100 documents per query.", "required": true, "style": "simple", "schema": { "type": "string", "example": "resources=0-10" } }, { "$ref": "#/components/parameters/acronym" }, { "name": "_fields", "in": "query", "description": "Fields that will be returned by document. Separate field names with commas. If you want to fetch all fields, use `_all` as the value of this field.", "required": false, "style": "form", "schema": { "type": "string", "example": "email,firstName,document" } }, { "name": "_where", "in": "query", "description": "Specification of filters.", "required": false, "style": "form", "schema": { "type": "string", "example": "firstName is not null" } }, { "name": "_keyword", "in": "query", "description": "String to search across fields.", "required": false, "style": "form", "schema": { "type": "string", "example": "jane" } }, { "name": "_sort", "in": "query", "description": "Inform a field name plus `ASC` to sort results by this field value in ascending order or `DESC` to sort by descending order.", "required": false, "style": "form", "schema": { "type": "string", "example": "firstName ASC" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "description": "List of documents.", "items": { "type": "object", "description": "Object representing each document.", "properties": { "additionalProperties": { "type": "string", "description": "Custom properties." }, "id": { "type": "string", "description": "Unique identifier of the document." }, "accountId": { "type": "string", "description": "Unique identifier of the account." }, "accountName": { "type": "string", "description": "Account name." }, "dataEntityId": { "type": "string", "description": "Two-letter string that identifies the data entity." } } } }, "example": [ { "id": "2f5dde81-1613-11ea-82ee-12f868feb457", "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", "accountName": "apiexamples", "dataEntityId": "AS" }, { "id": "3b3a3fc9-164b-11ea-82ee-121449f60ecb", "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", "accountName": "apiexamples", "dataEntityId": "AS" } ] } } }, "503": { "description": "Service Unavailable. Wildcard queries temporarily blocked due to excessive usage. Consider adjusting your code to remove them or reduce the rate of search requests with wildcards (*). This temporary block may also be due to excessive use of requests with the parameter `keyword`." } }, "deprecated": false } }, "/api/dataentities/{acronym}/documents/{id}/{field}/attachments/{file-name}": { "get": { "tags": [ "Attachments" ], "summary": "Retrieve attachment", "description": "Retrieves a file that had been previously saved in a field of type `File`.\r\n\r\n>⚠️ Make sure to include the file extension in the name, like in this example: `/api/dataentities/CL/documents/123/file/attachments/image.png`.", "operationId": "Retrieveattachment", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "$ref": "#/components/parameters/id" }, { "name": "field", "in": "path", "description": "Name of the field where the file is saved, as it appears on VTEX Admin.", "required": true, "style": "simple", "schema": { "type": "string", "example": "image" } }, { "name": "file-name", "in": "path", "description": "File name and extension.", "required": true, "style": "simple", "schema": { "type": "string", "example": "image.png" } } ], "responses": { "200": { "description": "OK", "content": { "image/jpg": { "schema": { "type": "string", "format": "binary", "description": "Image file." } } } } }, "deprecated": false } }, "/api/dataentities/{acronym}/documents/{id}/{field}/attachments": { "post": { "tags": [ "Attachments" ], "summary": "Save attachment", "description": "Saves a file in a field of type `File`. Learn more about [Data entity field types](https://help.vtex.com/en/tutorial/creating-data-entity--tutorials_1265#understanding-the-types).`\n\r\n\r> You can upload more than one file. Just add a new field in the `form-data` with type `File`.", "operationId": "Saveattachment", "parameters": [ { "$ref": "#/components/parameters/Content-Type-img" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "$ref": "#/components/parameters/id" }, { "name": "field", "in": "path", "description": "Name of the field to attach the file to, as it appears in VTEX Admin.", "required": true, "style": "simple", "schema": { "type": "string", "example": "profilePicture" } } ], "requestBody": { "content": { "multipart/form-data": { "encoding": {}, "schema": { "required": [ "file" ], "type": "object", "properties": { "file": { "type": "array", "description": "Files to be uploaded.", "items": { "type": "string", "format": "binary", "description": "File to be uploaded." } } } } } }, "required": false }, "responses": { "204": { "description": "No Content" } }, "deprecated": false } }, "/api/dataentities/{acronym}/documents/{id}/clusters": { "post": { "tags": [ "Clusters" ], "summary": "Validate document by clusters", "description": "Validate documents by clusters.\n\r\n\r> Learn more about Master Data [clusters](https://help.vtex.com/en/tutorial/how-can-i-create-cluster-of-customers--frequentlyAskedQuestions_1724).", "operationId": "ValidateDocumentbyClusters", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "$ref": "#/components/parameters/id" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Cluster validation rule name.", "example": "male" }, "rule": { "type": "string", "description": "Cluster validation rule.", "example": "gender=male" } } } }, "example": [ { "name": "male", "rule": "gender=male" }, { "name": "complex", "rule": "((gender=male AND percent=0.35) AND any is null) AND (name=*go*)" }, { "name": "complex2", "rule": "((gender=male AND percent=0.35) AND any is not null) OR (name=*go*)" }, { "name": "createdIn", "rule": "createdIn between 2015-10-28 AND 2015-10-30" } ] } }, "required": true }, "responses": { "200": { "description": "", "headers": {} } }, "deprecated": false } }, "/api/dataentities/{acronym}/documents/{id}/score": { "put": { "tags": [ "Score" ], "summary": "Update scores", "description": "Updates the score of more than one `Score2` type field and more than one key. Learn more about [Data entity field types](https://help.vtex.com/en/tutorial/creating-data-entity--tutorials_1265#understanding-the-types).", "operationId": "Putscores", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "$ref": "#/components/parameters/id" } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/PutscoresRequest" }, "description": "" }, "example": [ { "field": "carttag", "key": "Payment", "point": 1, "until": "10m" }, { "field": "scoretest", "key": "Point 1", "point": 1, "until": "1d" } ] } }, "required": true }, "responses": { "204": { "description": "No Content" } }, "deprecated": false } }, "/api/dataentities/{acronym}/documents/{id}/score/{field-name}": { "put": { "tags": [ "Score" ], "summary": "Update score by field", "description": "Updates the score of a specific `Score2` type field. Learn more about [Data entity field types](https://help.vtex.com/en/tutorial/creating-data-entity--tutorials_1265#understanding-the-types).", "operationId": "Putscorebyfield", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "name": "id", "in": "path", "description": "Unique identifier of the document.", "required": true, "style": "simple", "schema": { "type": "string", "example": "SP-b818cbda-e489-11e6-94f4-0ac138d2d42e" } }, { "name": "field-name", "in": "path", "description": "Name of the field to score.", "required": true, "style": "simple", "schema": { "type": "string", "example": "carttag" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PutscorebyfieldRequest" }, "example": { "key": "first key", "point": 1, "until": "10m" } } }, "required": true }, "responses": { "204": { "description": "No Content" } }, "deprecated": false }, "delete": { "tags": [ "Score" ], "summary": "Delete score by field", "description": "Removes a key from a specific `Score2` type field. Learn more about [Data entity field types](https://help.vtex.com/en/tutorial/creating-data-entity--tutorials_1265#understanding-the-types).", "operationId": "Deletescorebyfield", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/acronym" }, { "$ref": "#/components/parameters/id" }, { "name": "field-name", "in": "path", "description": "Name of the field to remove a key from.", "required": true, "style": "simple", "schema": { "type": "string", "example": "carttag" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeletescorebyfieldRequest" }, "example": { "key": "first key" } } }, "required": true }, "responses": { "204": { "description": "No Content" } }, "deprecated": false } } }, "security": [ { "appKey": [], "appToken": [] }, { "VtexIdclientAutCookie": [] } ], "components": { "securitySchemes": { "appKey": { "type": "apiKey", "in": "header", "name": "X-VTEX-API-AppKey", "description": "Unique identifier of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys)." }, "appToken": { "type": "apiKey", "in": "header", "name": "X-VTEX-API-AppToken", "description": "Secret token of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys)." }, "VtexIdclientAutCookie": { "type": "apiKey", "in": "header", "name": "VtexIdclientAutCookie", "description": "[User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours." } }, "parameters": { "Content-Type": { "name": "Content-Type", "in": "header", "description": "Type of the content being sent.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } }, "Content-Type-img": { "name": "Content-Type", "in": "header", "description": "Type of the content being sent. If you are uploading an image, use `image/jpg` or `image/png`. When using JavaScript, use `multipart/form-data.", "required": true, "style": "simple", "schema": { "type": "string", "example": "image/jpg" } }, "Accept": { "name": "Accept", "in": "header", "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/vnd.vtex.ds.v10+json" } }, "acronym": { "name": "acronym", "in": "path", "description": "Two-letter string that identifies the data entity.", "required": true, "style": "simple", "schema": { "type": "string", "example": "SP" } }, "id": { "name": "id", "in": "path", "description": "Unique identifier of the document.", "required": true, "style": "simple", "schema": { "type": "string", "example": "SP-b818cbda-e489-11e6-94f4-0ac138d2d42e" } } }, "schemas": { "Listdataentity": { "title": "Listdataentity", "required": [ "acronym", "name", "primaryKeyType", "allowGetAll" ], "type": "object", "properties": { "acronym": { "title": "acronym", "type": "string", "description": "Two-letter string that identifies the data entity." }, "name": { "title": "name", "type": "string", "description": "Data entity name." }, "primaryKeyType": { "title": "primaryKeyType", "type": "string", "description": "Primary key type." }, "allowGetAll": { "title": "allowGetAll", "type": "boolean", "description": "Defines if it will be allowed to retrieve all fields from documents from this data entity at once using the [Get document](https://developers.vtex.com/docs/api-reference/masterdata-api#get-/api/dataentities/-acronym-/documents/-id-) endpoint (`true`) or not (`false`)." } }, "example": { "acronym": "SP", "name": "Sample", "primaryKeyType": "GUID", "allowGetAll": false } }, "Getdataentityfields": { "title": "Data entity structure", "required": [ "acronym", "name", "primaryKeyType", "allowGetAll", "fields" ], "type": "object", "properties": { "acronym": { "$ref": "#/components/schemas/Listdataentity/properties/acronym" }, "name": { "$ref": "#/components/schemas/Listdataentity/properties/name" }, "primaryKeyType": { "$ref": "#/components/schemas/Listdataentity/properties/primaryKeyType" }, "allowGetAll": { "$ref": "#/components/schemas/Listdataentity/properties/allowGetAll" }, "fields": { "title": "fields", "type": "array", "description": "List of fields that documents from the given data entity have.", "items": { "$ref": "#/components/schemas/Field" } } }, "example": { "acronym": "SP", "name": "Sample", "primaryKeyType": "GUID", "allowGetAll": false, "fields": [ { "name": "updatedIn", "type": "Date and Time", "displayName": "Atualizado em", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": true }, { "name": "updatedBy", "type": "User Login", "displayName": "Atualizado por", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": true }, { "name": "Auto_Increment", "type": "Auto Increment", "displayName": "Auto increment", "isNullable": true, "isSearchable": false, "isFilter": false, "isInternal": false }, { "name": "Boolean", "type": "Boolean", "displayName": "Boolean", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "createdIn", "type": "Date and Time", "displayName": "Criado em", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": true }, { "name": "createdBy", "type": "User Login", "displayName": "Criado por", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": true }, { "name": "Currency", "type": "Currency", "displayName": "Currency", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "Date", "type": "Date", "displayName": "Date", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "Date_Time", "type": "Date and Time", "displayName": "Date and Time", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "Decimal", "type": "Decimal", "displayName": "Decimal", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "Email", "type": "Email", "displayName": "Email", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false }, { "name": "dataEntityId", "type": "Varchar 10", "displayName": "Entidade de dados", "isNullable": false, "isSearchable": true, "isFilter": false, "isInternal": true }, { "name": "File", "type": "File", "displayName": "File", "isNullable": true, "isSearchable": false, "isFilter": false, "isInternal": false }, { "name": "auto_filter", "type": "Text", "displayName": "Filtro automático", "isNullable": true, "isSearchable": false, "isFilter": false, "isInternal": true }, { "name": "accountId", "type": "Varchar 50", "displayName": "ID da loja", "isNullable": false, "isSearchable": false, "isFilter": false, "isInternal": true }, { "name": "id", "type": "Varchar 100", "displayName": "Id do documento", "isNullable": false, "isSearchable": true, "isFilter": false, "isInternal": true }, { "name": "Integer", "type": "Integer", "displayName": "Integer", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "Long", "type": "Long", "displayName": "Long", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "accountName", "type": "Varchar 100", "displayName": "Nome da loja", "isNullable": false, "isSearchable": true, "isFilter": false, "isInternal": true }, { "name": "Percent", "type": "Percent", "displayName": "Percent", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "Relationship", "type": "Relationship", "displayName": "Relationship", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false }, { "name": "Score2", "type": "Score2", "displayName": "Score2", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "followers", "type": "Text", "displayName": "Seguidores", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": true }, { "name": "tags", "type": "Text", "displayName": "Tags", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": true }, { "name": "Text", "type": "Text", "displayName": "Text", "isNullable": true, "isSearchable": false, "isFilter": false, "isInternal": false }, { "name": "Time", "type": "Time", "displayName": "Time", "isNullable": true, "isSearchable": false, "isFilter": false, "isInternal": false }, { "name": "lastInteractionIn", "type": "Date and Time", "displayName": "Ultima interação em", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": true }, { "name": "lastInteractionBy", "type": "User Login", "displayName": "Ultima interação por", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": true }, { "name": "URL", "type": "URL", "displayName": "URL", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": false }, { "name": "User_Login", "type": "User Login", "displayName": "User Login", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false }, { "name": "Varchar10", "type": "Varchar 10", "displayName": "Varchar 10", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false }, { "name": "Varchar100", "type": "Varchar 100", "displayName": "Varchar 100", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false }, { "name": "Varchar50", "type": "Varchar 50", "displayName": "Varchar 50", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false }, { "name": "Varchar750", "type": "Varchar 750", "displayName": "Varchar 750", "isNullable": true, "isSearchable": true, "isFilter": false, "isInternal": false } ] } }, "Field": { "title": "Field", "description": "Field information.", "required": [ "name", "type", "displayName", "isNullable", "isSearchable", "isFilter", "isInternal" ], "type": "object", "properties": { "name": { "type": "string", "description": "Field name." }, "type": { "type": "string", "description": "Field type." }, "displayName": { "type": "string", "description": "Field display name." }, "isNullable": { "type": "boolean", "description": "Defines whether the field is nullable (`true`) or not (`false`)." }, "isSearchable": { "type": "boolean", "description": "Defines whether the field is searchable (`true`) or not (`false`)." }, "isFilter": { "type": "boolean", "description": "Defines whether the field is a filter (`true`) or not (`false`)." }, "isInternal": { "type": "boolean", "description": "Defines whether the field is for internal use only (`true`) or not (`false`)." } }, "example": { "name": "updatedIn", "type": "Date and Time", "displayName": "Atualizado em", "isNullable": true, "isSearchable": false, "isFilter": true, "isInternal": true } }, "IdHrefDocumentID": { "type": "object", "properties": { "Id": { "type": "string", "description": "ID of the document that was created, with data entity prefix." }, "Href": { "type": "string", "description": "Document reference URL." }, "DocumentId": { "type": "string", "description": "Unique identifier of the document." } }, "example": { "Id": "AS-4e4c55ac-e491-11e6-94f4-0ac138d2d42e", "Href": "http://cosmetics2.vtexcommercestable.com.br/api/dataentities/AS/documents/4e4c55ac-e491-11e6-94f4-0ac138d2d42e", "DocumentId": "4e4c55ac-e491-11e6-94f4-0ac138d2d42e" } }, "IdHref": { "title": "IdHref", "required": [ "Id", "Href" ], "type": "object", "properties": { "Id": { "type": "string", "description": "ID of the document that was created, with data entity prefix." }, "Href": { "type": "string", "description": "Document reference URL." } }, "example": { "Id": "CL-b818cbda-e489-11e6-94f4-0ac138d2d42e", "Href": "http://{{accountName}}.vtexcommercestable.com.br/api/dataentities/CL/documents/b818cbda-e489-11e6-94f4-0ac138d2d42e" } }, "PutscoresRequest": { "title": "PutscoresRequest", "required": [ "field", "key", "point", "until" ], "type": "object", "properties": { "field": { "type": "string", "description": "Field name." }, "key": { "type": "string", "description": "Key name." }, "point": { "type": "integer", "format": "int32", "description": "Amount of points to be added to the score." }, "until": { "type": "string", "description": "Amount of time the added points will be valid for." } }, "example": { "field": "carttag", "key": "Payment", "point": 1, "until": "10m" } }, "PutscorebyfieldRequest": { "title": "PutscorebyfieldRequest", "required": [ "key", "point", "until" ], "type": "object", "properties": { "key": { "type": "string", "description": "Key name." }, "point": { "type": "integer", "format": "int32", "description": "Amount of points to be added to the score." }, "until": { "type": "string", "description": "Amount of time the added points will be valid for." } }, "example": { "key": "first key", "point": 1, "until": "10m" } }, "DeletescorebyfieldRequest": { "title": "DeletescorebyfieldRequest", "required": [ "key" ], "type": "object", "properties": { "key": { "type": "string", "description": "Key name." } }, "example": { "key": "first key" } }, "Listversion": { "title": "Listversion", "required": [ "id", "date" ], "type": "object", "properties": { "id": { "type": "string", "description": "Unique identifier of the version." }, "date": { "type": "string", "description": "Date when the version was created, in ISO 8601 format." } }, "example": { "id": "_EAR0cJ7XB5k5grnmm0zeKGlVvVM9WCPV_", "date": "2016-10-18T16:53:32+00:00" } }, "Getversion": { "title": "Getversion", "required": [ "id", "author", "document" ], "type": "object", "properties": { "id": { "type": "string", "description": "Unique identifier of the version." }, "author": { "type": "string", "description": "Unique identifier of the user who created the version." }, "document": { "$ref": "#/components/schemas/Document" } }, "example": { "id": "version-id", "author": "user-id", "document": { "id": "2f5dde81-1613-11ea-82ee-12f868feb457", "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", "accountName": "apiexamples", "dataEntityId": "AS" } } }, "Document": { "title": "Document", "required": [ "id", "dataEntityId", "accountId", "accountName" ], "type": "object", "description": "Object representing each document.", "properties": { "additionalProperties": { "type": "string", "description": "Custom properties." }, "id": { "type": "string", "description": "Unique identifier of the document." }, "accountId": { "type": "string", "description": "Unique identifier of the account." }, "accountName": { "type": "string", "description": "Account name." }, "dataEntityId": { "type": "string", "description": "Two-letter string that identifies the data entity." } }, "example": { "id": "2f5dde81-1613-11ea-82ee-12f868feb457", "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", "accountName": "apiexamples", "dataEntityId": "AS" } } } }, "tags": [ { "name": "Data Entities" }, { "name": "Documents", "description": "The APIs within this group are used to save documents and query them by id.\r\n\r\nIf the document has the id attribute or has fields that have been set to indexes with unique values, VTEX Master Data will attempt to identify the document. If the document is found a change will be made. If it is not found, an inclusion will be made. ** This scenario does not apply to the API with the POST verb**.\r\n\r\nAnother important note: The id field will only be considered on the **POST** verb if the ID type entered in the Data Entity is the option:\r\n\r\n```\r\nA chave primária será informada pelo cliente através do atributo 'id'\r\n```\r\n\r\nOtherwise, a new document will always be created.\r\n\r\n### Response status code\r\n\r\n1. Status Code 201: Document created successfully\r\n2. Status Code 200: Document changed successfully\r\n3. Status Code 304: There were no changes to the document\r\n4. Status Code 400: Invalid information in JSON\r\n5. Status Code 403: Unauthorized access\r\n" }, { "name": "Versions" }, { "name": "Scroll" }, { "name": "Search" }, { "name": "Attachments" }, { "name": "Clusters" }, { "name": "Score" } ] }