Data structures

Data structures define the format of the data being transferred to the Make platform. For example, they are widely used by the Data stores component. The following endpoints allow you to create and manage data structures.

List data structures

get

Retrieves a collection of all data structures for a team with a given ID. Returned data structures are sorted by name in ascending order.

Authorizations
Query parameters
teamIdintegerRequired

The unique ID of the team whose data structures will be retrieved.

Example: 123
pg[sortBy]string · enumOptional

The value that will be used to sort returned entities by.

Possible values:
pg[offset]integerOptional

The value of entities you want to skip before getting entities you need.

pg[sortDir]string · enumOptional

The sorting order. It accepts the ascending and descending direction specifiers.

Possible values:
pg[limit]integerOptional

Sets the maximum number of results per page in the API call response. For example, pg[limit]=100. The default number varies with different API endpoints.

Responses
200
Successful response
application/json
get
GET /api/v2/data-structures HTTP/1.1
Host: eu1.make.com
Authorization: YOUR_API_KEY
Accept: */*
200

Successful response

{
  "dataStructures": [
    {
      "id": 9,
      "name": "Data structure 1",
      "teamId": 1
    },
    {
      "id": 1,
      "name": "Data structure 2",
      "teamId": 1
    }
  ],
  "pg": {
    "sortBy": "name",
    "sortDir": "asc",
    "limit": 10000,
    "offset": 0
  }
}

Create data structure

post

Creates a new data structure with data passed in the request body. In the response, it returns all details of the created data structure including its full specification.

Authorizations
Body
teamIdintegerRequired

The unique ID of the team in which the data structure will be created.

namestring · min: 1 · max: 128Required

The name of the data structure. The maximum length of the name is 128 characters.

strictbooleanRequired

Set to true to enforce strict validation of the data put in the data structure. With the strict validation enabled, the data structure won't store data that don't fit into the structure and the storing module will return an error.

The default value of this parameter is false. With the default setting, the modules using the data structure will process data that don't conform to the data structure.

Example: true
Responses
200
Successful response
application/json
post
POST /api/v2/data-structures HTTP/1.1
Host: eu1.make.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 240

{
  "teamId": 1,
  "name": "Data structure 1",
  "strict": true,
  "spec": [
    {
      "type": "text",
      "name": "txt",
      "label": "Text field",
      "default": "default string",
      "required": true
    },
    {
      "type": "number",
      "name": "num",
      "label": "Number field",
      "default": "1,",
      "required": false
    }
  ]
}
200

Successful response

{
  "dataStructure": {
    "id": 9,
    "name": "Data structure 1",
    "teamId": 1,
    "spec": [
      {
        "type": "text",
        "name": "txt",
        "label": "Text field",
        "default": "default string",
        "required": true
      },
      {
        "type": "number",
        "name": "num",
        "label": "Number field",
        "default": "1,",
        "required": false
      }
    ],
    "strict": true
  }
}

Get data structure

get

Retrieves a data structure with a given ID

Authorizations
Path parameters
dataStructureIdintegerRequired

The data structure ID. Get the dataStructureId with the list data structures endpoint.

Example: 1459
Query parameters
Responses
200
Successful response
application/json
get
GET /api/v2/data-structures/{dataStructureId} HTTP/1.1
Host: eu1.make.com
Authorization: YOUR_API_KEY
Accept: */*
200

Successful response

{
  "dataStructure": {
    "id": 9,
    "name": "Data structure 1",
    "teamId": 1,
    "spec": [
      {
        "type": "text",
        "name": "txt",
        "label": "Text field",
        "default": "default string",
        "required": true
      },
      {
        "type": "number",
        "name": "num",
        "label": "Number field",
        "default": "2,",
        "required": false
      }
    ],
    "strict": true
  }
}

Delete data structure

delete

Deletes a data structure with a given ID and returns the ID in the response.

Authorizations
Path parameters
dataStructureIdintegerRequired

The data structure ID. Get the dataStructureId with the list data structures endpoint.

Example: 1459
Query parameters
confirmedbooleanOptional

Confirms the deletion if a data structure is included in at least one scenario. Confirmation is required because the scenario will stop working without the data structure. If the parameter is missing or it is set to false an error code is returned and the resource is not deleted.

Example: true
Responses
200
Successful response
application/json
delete
DELETE /api/v2/data-structures/{dataStructureId} HTTP/1.1
Host: eu1.make.com
Authorization: YOUR_API_KEY
Accept: */*
200

Successful response

{
  "dataStructure": 1
}

Update data structure

patch

Updates the specified data structure. Make updates only parameters you send in the request body. Note that when you update the data structure specification with the spec parameter, you have to provide all structure fields you want to use. Make replaces the old structure specification with the new one. The response contains all details about the updated data structure.

Authorizations
Path parameters
dataStructureIdintegerRequired

The data structure ID. Get the dataStructureId with the list data structures endpoint.

Example: 1459
Body
namestring · min: 1 · max: 128Optional

The name of the data structure. The maximum length of the name is 128 characters.

strictbooleanOptional

Set to true to enforce strict validation of the data put in the data structure. With the strict validation enabled, the data structure won't store data that don't fit into the structure and the storing module will return an error.

The default value of this parameter is false. With the default setting, the modules using the data structure will process data that don't conform to the data structure.

Example: false
Responses
200
Successful response
application/json
patch
PATCH /api/v2/data-structures/{dataStructureId} HTTP/1.1
Host: eu1.make.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 215

{
  "name": "Data structure 1",
  "spec": [
    {
      "type": "text",
      "name": "txt",
      "label": "Text field",
      "default": "default string",
      "required": true
    },
    {
      "type": "number",
      "name": "num",
      "label": "Number field",
      "default": "2,",
      "required": false
    }
  ]
}
200

Successful response

{
  "dataStructure": {
    "id": 9,
    "name": "Data structure 1",
    "teamId": 1,
    "spec": [
      {
        "type": "text",
        "name": "txt",
        "label": "Text field",
        "default": "default string",
        "required": true
      },
      {
        "type": "number",
        "name": "num",
        "label": "Number field",
        "default": "2,",
        "required": false
      }
    ],
    "strict": true
  }
}

Clone data structure

post

Clones the specified data structure. Use the targetTeamId to clone the data structure to the specified team.

The response contains all details of the data structure clone with data structure full specification.

Authorizations
Path parameters
dataStructureIdintegerRequired

The data structure ID. Get the dataStructureId with the list data structures endpoint.

Example: 1459
Body
namestring · min: 1 · max: 128Required

The name of the data structure clone. The maximum length of the name is 128 characters.

targetTeamIdintegerOptional

The ID of the team that should use the data structure clone. If you don't specify the targetTeamId Make clones the data structure in the original team.

Responses
200
Successful response
application/json
post
POST /api/v2/data-structures/{dataStructureId}/clone HTTP/1.1
Host: eu1.make.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 50

{
  "name": "Cloned data structure",
  "targetTeamId": 22
}
200

Successful response

{
  "dataStructure": {
    "id": 2547,
    "name": "Cloned data structure",
    "teamId": 22,
    "spec": [
      {
        "type": "text",
        "name": "txt",
        "label": "Text field",
        "default": "default string",
        "required": true
      },
      {
        "type": "number",
        "name": "num",
        "label": "Number field",
        "default": "1,",
        "required": false
      }
    ],
    "strict": true
  }
}