# API reference

## Record types

### List record types

This endpoint returns the available record types, e.g. `movie`, `organization`, `person`, etc.

#### Response parameters

<table><thead><tr><th width="208">Name</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td>Name of the record type.</td></tr><tr><td><code>label</code></td><td>Label of the record type.</td></tr><tr><td><code>creatable</code></td><td>The record type supports operation <code>create</code>.</td></tr><tr><td><code>updatable</code></td><td>The record type supports operation <code>update</code>.</td></tr><tr><td><code>readable</code></td><td>The record type supports operation <code>read</code>.</td></tr><tr><td><code>searchable</code></td><td>The record type supports operation <code>search</code>.</td></tr><tr><td><code>searchesIn</code></td><td>The list of parameters to search by in the records of the record type.</td></tr><tr><td><code>deletable</code></td><td>The record type suuports operation <code>delete</code>.</td></tr><tr><td><code>triggerable</code></td><td><p>The record type supports firing webhooks when a new event is logged.</p><p>The record type records the date and time of the event.</p></td></tr></tbody></table>

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/recordTypes" method="get" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/recordTypes/{name}" method="get" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

### Retrieve a record type

This endpoint retrieves the JSON file of a record type. This JSON file contains the list of parameters available in the record type.

#### Response parameters

<table><thead><tr><th width="212">Name</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td>Name of the parameter.</td></tr><tr><td><code>label</code></td><td>Label of teh parameter.</td></tr><tr><td><code>mandatory</code></td><td>The parameter is mandatory.</td></tr><tr><td><code>readable</code></td><td>The parameter is returned in the response body when the record is fetched.</td></tr><tr><td><code>updatable</code></td><td>The parameter can be used to create/update a record.</td></tr><tr><td><code>refersTo</code></td><td>Name of the record type to which the parameter refers. Only available for the parameters of type ID.</td></tr><tr><td><code>type</code></td><td>JSON type of the parameter, e.g. <code>text</code>, <code>number</code>, <code>array</code>.</td></tr><tr><td><code>nestedParameters</code></td><td>The parameters that are nested to the parameter.</td></tr></tbody></table>

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/{recordType}/query" method="post" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

## Records

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/{recordType}/query" method="post" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

#### Filtering records

The search records endpoint supports chained filters. The filter is sent in body of the request.

```
{
    "or":[
        {
            "and":[
                {
                    "property": "name",
                    "startsWith": "R"    
                },
                {
                    "property": "name",
                    "contains": "o"
                }
            ]
        },
        {
            "and":[
                {
                    "property": "name",
                    "startsWith": "G"
                },
                {
                    "property": "name",
                    "contains": "w"
                }
            ]
        }
    ]
}
```

In addition to chained filters, records can be queried with single filters as well.

<pre><code>{
<strong>    "and":[
</strong>        {
            "property": "name",
            "startsWith": "R"
        }
    ]
}
</code></pre>

#### Supported operators for filtering

* `startsWith`
* `endsWith`
* `contains`
* `equalsTo`

### Retrieve a record

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/{recordType}/{id}" method="get" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

### Create a record

{% hint style="info" %}
Each user is granted access to 6 default movie records that cannot be updated or deleted.

Each user can create up to 14 movie records, resulting in 20 retrievable movie records.
{% endhint %}

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/{recordType}" method="post" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

{% hint style="info" %}
The `body` of the request contains the parameters available in the selected [record type](#record-types).
{% endhint %}

### Update a record

{% hint style="info" %}
Only the records created by the user can be updated.
{% endhint %}

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/{recordType}/{id}" method="patch" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

{% hint style="info" %}
The `body` of the request contains the parameters available in the selected [record type](#record-types).
{% endhint %}

### Delete a record

{% hint style="info" %}
Only the records created by the user can be deleted.
{% endhint %}

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/{recordType}/{id}" method="delete" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/files" method="get" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

## Files/Folders

### Retrieve files or folders

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/files" method="get" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

### Download a file

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/files/{id}" method="get" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

### Delete a file

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/files/{id}" method="delete" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

### Upload a file

{% hint style="info" %}
Each user is granted access to 1 default record that can't be deleted.

Each user can upload up to 1 file, resulting in 2 retrievable files.
{% endhint %}

The maximum size of a file one can upload to an upload session is 4 bytes. A single request within the upload session cannot exceed 1 byte. Example: If a file has 4 bytes, the file has to be split into 4 separate requests containing a block of data (bytes).

#### Step one: Open a slot for a file uplod

Open a slot for an upload session and save the file's name and the given file path where the file should be uploaded.&#x20;

Only one slot can be open at a time. The slot can be open for max 1 minute. The session is dropped if the file upload is not finished by that time or if the upload session ends up with an error.

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/files/upload/openSlot" method="post" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

#### Step two: Upload the first block of data of the file

Upload the first block of data to an uplaod session.

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/files/upload/start" method="post" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

#### Step three: Upload the other blocks of data of the file

Append more data to an upload session.

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/files/upload/append" method="post" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

#### Step four: Upload the last block of data of the file and close the session

Finish the upload session by uploading the last block (byte) of the file's data.

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/files/upload/finish" method="post" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

## Webhooks

### Verification of the webhook

The Make Academy API version 3 uses a digital signature which is generated using the secret key entered when creating a webhook and the body of the webhook’s request. This data is contained within the `Signature` header.

The header contains the SHA algorithm used to generate the signature. To verify that the request originates from the App Academy API, you'll need to compute the HMAC 256 using your secret key and the body and compare it to the signature contained in the header. The successful matching of these values ensures that the webhook's source is the App Academy API.

#### Example of computing HMAC 256 in JavaScript

<pre class="language-javascript"><code class="lang-javascript">import * as crypto from 'crypto';
<strong>
</strong><strong>function generateHMACSHA256(secretKey: string, data: string): string {
</strong>    const hmac = crypto.createHmac('sha256', secretKey);
    hmac.update(data);
    return hmac.digest('hex');
}
const secretKey ='yourSecretKey';
const body ='yourBodyContent';

const hmacSHA256 = generateHMACSHA256(secretKey, body);
console.log(`HMAC-SHA256: ${hmacSHA256}`);
</code></pre>

### Responding to the webhook

{% hint style="info" %}
You must set up the verification of the webhook.
{% endhint %}

When a webhook is attached, the verification payload is sent to the webhook. You must respond with the correct **HTTP** code:

* `200` for correct signature
* `400` for incorrect signature

For the 400 code, you must respond with the following response:

#### Headers

```
"Content-type": "application/json"
```

#### Body

```
{
    "message": "Invalid signature"
}
```

### Webhook's payload

#### Payload parameters

| Name      | Description                                                                                    |
| --------- | ---------------------------------------------------------------------------------------------- |
| eventType | The type of event that fired the webhook. Available types: `verification`, `create`, `update`. |
| data      | The body of the [record type](#record-types).                                                  |

```json
{
    "eventType": "verification",
    "data": {...}
}
```

### Attach a webhook

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/webhooks" method="post" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}

### Detach a webhook

{% openapi src="/files/s6wx6XkGUizJ2QMbu4kc" path="/webhooks/{id}" method="delete" %}
[KLOBOUCKOVATEREZA\_1-chall-1.0.0-swagger (28) (1).yaml](https://3114796191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNTg64InL2Ea6QArLuAq%2Fuploads%2FACccs2rUqMsgLVbM3coK%2FKLOBOUCKOVATEREZA_1-chall-1.0.0-swagger%20\(28\)%20\(1\).yaml?alt=media\&token=41b4a806-1330-422c-92f3-81f6e39a833a)
{% endopenapi %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.make.com/custom-apps-development-training/version-3/api-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
