33
apps/docs/api-reference/authentication.mdx
Normal file
33
apps/docs/api-reference/authentication.mdx
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
title: 'Authentication'
|
||||
---
|
||||
|
||||
Some API endpoints are protected, and therefore require that you authenticate using an API token.
|
||||
|
||||
## Generate a token
|
||||
|
||||
1. Navigate to your typebot dashboard (https://app.typebot.io/typebots)
|
||||
2. Click on Settings & Members > My account
|
||||
3. Under the "API tokens" section, click on "Create"
|
||||
4. Give it a name, then click on "Create token"
|
||||
5. Copy your token.
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="/images/api/authentication/generateToken.png"
|
||||
width="900"
|
||||
alt="Generate token"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
## Use your token
|
||||
|
||||
You can authenticate by adding an `Authorization` header to all your HTTP calls. The Authorization header is formatted as such: `Authorization: Bearer <token>` (replace `<token>` with your token previously generated).
|
||||
|
||||
Example:
|
||||
|
||||
```sh
|
||||
curl -L -X GET 'https://app.typebot.io/api/typebots/:typebotId/results' \
|
||||
-H 'Accept: application/json' \
|
||||
-H 'Authorization: Bearer myAwesomeToken'
|
||||
```
|
||||
4
apps/docs/api-reference/billing/get-usage.mdx
Normal file
4
apps/docs/api-reference/billing/get-usage.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Get current usage'
|
||||
openapi: GET /v1/billing/usage
|
||||
---
|
||||
4
apps/docs/api-reference/billing/list-invoices.mdx
Normal file
4
apps/docs/api-reference/billing/list-invoices.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'List invoices'
|
||||
openapi: GET /v1/billing/invoices
|
||||
---
|
||||
4
apps/docs/api-reference/chat/continue-chat.mdx
Normal file
4
apps/docs/api-reference/chat/continue-chat.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Continue chat'
|
||||
openapi: POST /v1/sessions/{sessionId}/continueChat
|
||||
---
|
||||
4
apps/docs/api-reference/chat/save-logs.mdx
Normal file
4
apps/docs/api-reference/chat/save-logs.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Save logs'
|
||||
openapi: POST /v1/sessions/{sessionId}/clientLogs
|
||||
---
|
||||
4
apps/docs/api-reference/chat/start-chat.mdx
Normal file
4
apps/docs/api-reference/chat/start-chat.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Start chat'
|
||||
openapi: POST /v1/typebots/{publicId}/startChat
|
||||
---
|
||||
4
apps/docs/api-reference/chat/start-preview-chat.mdx
Normal file
4
apps/docs/api-reference/chat/start-preview-chat.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Start preview chat'
|
||||
openapi: POST /v1/typebots/{typebotId}/preview/startChat
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Update typebot in session'
|
||||
openapi: POST /v1/sessions/{sessionId}/updateTypebot
|
||||
---
|
||||
84
apps/docs/api-reference/endpoint/create.mdx
Normal file
84
apps/docs/api-reference/endpoint/create.mdx
Normal file
@@ -0,0 +1,84 @@
|
||||
---
|
||||
title: "Create User"
|
||||
api: "POST https://api.mintlify.com/api/user"
|
||||
description: "This endpoint creates a new user"
|
||||
---
|
||||
|
||||
### Body
|
||||
|
||||
<ParamField body="current_token" type="string">
|
||||
This is the current user group token you have for the user group that you want
|
||||
to rotate.
|
||||
</ParamField>
|
||||
|
||||
### Response
|
||||
|
||||
<ResponseField name="success" type="number">
|
||||
Indicates whether the call was successful. 1 if successful, 0 if not.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="user_group" type="object">
|
||||
|
||||
The contents of the user group
|
||||
|
||||
<Expandable title="Toggle object">
|
||||
|
||||
<ResponseField name="team_id" type="number">
|
||||
This is the internal ID for this user group. You don't need to record this
|
||||
information, since you will not need to use it.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="token" type="string">
|
||||
This is the user group token (userGroupToken or USER_GROUP_TOKEN) that will be
|
||||
used to identify which user group is viewing the dashboard. You should save
|
||||
this on your end to use when rendering an embedded dashboard.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="name" type="string">
|
||||
This is the name of the user group provided in the request body.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="provided_id" type="string">
|
||||
This is the user_group_id provided in the request body.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="api_environment_tag" type="JSON or null">
|
||||
This is the environment tag of the user group. Possible values are 'Customer'
|
||||
and 'Testing'. User group id's must be unique to each environment, so you can
|
||||
not create multiple user groups with with same id. If you have a production
|
||||
customer and a test user group with the same id, you will be required to label
|
||||
one as 'Customer' and another as 'Testing'
|
||||
</ResponseField>
|
||||
|
||||
</Expandable>
|
||||
|
||||
</ResponseField>
|
||||
|
||||
<RequestExample>
|
||||
|
||||
```bash Example Request
|
||||
curl --location --request POST 'https://api.mintlify.com/api/user' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'Authorization: Token <token>' \
|
||||
--data-raw '{
|
||||
"current_token": ""
|
||||
}'
|
||||
```
|
||||
|
||||
</RequestExample>
|
||||
|
||||
<ResponseExample>
|
||||
|
||||
```json Response
|
||||
{
|
||||
"success": 1,
|
||||
"user_group": {
|
||||
"team_id": 3,
|
||||
"token": "<user_group_token_to_auth_dashboard>",
|
||||
"name": "Example 1",
|
||||
"provided_id": "example_1"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</ResponseExample>
|
||||
47
apps/docs/api-reference/endpoint/delete.mdx
Normal file
47
apps/docs/api-reference/endpoint/delete.mdx
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
title: "Delete User"
|
||||
api: "DELETE https://api.mintlify.com/api/user"
|
||||
description: "This endpoint deletes an existing user."
|
||||
---
|
||||
|
||||
### Body
|
||||
|
||||
<ParamField body="data_source_provided_id" type="string">
|
||||
The data source ID provided in the data tab may be used to identify the data
|
||||
source for the user group
|
||||
</ParamField>
|
||||
|
||||
<ParamField body="current_token" type="string">
|
||||
This is the current user group token you have for the user group you want to
|
||||
delete
|
||||
</ParamField>
|
||||
|
||||
### Response
|
||||
|
||||
<ResponseField name="success" type="number">
|
||||
Indicates whether the call was successful. 1 if successful, 0 if not.
|
||||
</ResponseField>
|
||||
|
||||
<RequestExample>
|
||||
|
||||
```bash Example Request
|
||||
curl --location --request DELETE 'https://api.mintlify.com/api/user' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'Authorization: Token <token>' \
|
||||
--data-raw '{
|
||||
"user_group_id": "example_1"
|
||||
"current_token": "abcdef"
|
||||
}'
|
||||
```
|
||||
|
||||
</RequestExample>
|
||||
|
||||
<ResponseExample>
|
||||
|
||||
```json Response
|
||||
{
|
||||
"success": 1
|
||||
}
|
||||
```
|
||||
|
||||
</ResponseExample>
|
||||
101
apps/docs/api-reference/endpoint/get.mdx
Normal file
101
apps/docs/api-reference/endpoint/get.mdx
Normal file
@@ -0,0 +1,101 @@
|
||||
---
|
||||
title: "Get User"
|
||||
api: "GET https://api.mintlify.com/api/user"
|
||||
description: "This endpoint gets or creates a new user."
|
||||
---
|
||||
|
||||
### Body
|
||||
|
||||
<ParamField body="name" type="string">
|
||||
This is the name of the user group.
|
||||
</ParamField>
|
||||
|
||||
<ParamField body="user_group_id" type="string">
|
||||
This is the ID you use to identify this user group in your database.
|
||||
</ParamField>
|
||||
|
||||
<ParamField body="mapping" type="object">
|
||||
This is a JSON mapping of schema id to either the data source that this user group should be
|
||||
associated with or id of the datasource you provided when creating it.
|
||||
</ParamField>
|
||||
|
||||
<ParamField body="properties" type="object">
|
||||
This is a JSON object for properties assigned to this user group. These will be accessible through
|
||||
variables in the dashboards and SQL editor
|
||||
</ParamField>
|
||||
|
||||
### Response
|
||||
|
||||
<ResponseField name="success" type="number">
|
||||
Indicates whether the call was successful. 1 if successful, 0 if not.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="new_user_group" type="boolean">
|
||||
Indicates whether a new user group was created.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="user_group" type="object">
|
||||
|
||||
The contents of the user group
|
||||
|
||||
<Expandable title="Toggle object">
|
||||
|
||||
<ResponseField name="team_id" type="number">
|
||||
This is the internal ID for this user group. You don't need to record this information, since
|
||||
you will not need to use it.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="token" type="string">
|
||||
This is the user group token (userGroupToken or USER_GROUP_TOKEN) that will be used to identify
|
||||
which user group is viewing the dashboard. You should save this on your end to use when rendering
|
||||
an embedded dashboard.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="name" type="string">
|
||||
This is the name of the user group provided in the request body.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="provided_id" type="string">
|
||||
This is the user_group_id provided in the request body.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="properties" type="JSON or null">
|
||||
This is the properties object if it was provided in the request body
|
||||
</ResponseField>
|
||||
|
||||
</Expandable>
|
||||
|
||||
</ResponseField>
|
||||
|
||||
<RequestExample>
|
||||
|
||||
```bash Example Request
|
||||
curl --location --request GET 'https://api.mintlify.com/api/user' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'Authorization: Token <token>' \
|
||||
--data-raw '{
|
||||
"user_group_id": "example_1",
|
||||
"name": "Example 1",
|
||||
"mapping": {"40": "213", "134": "386"},
|
||||
"properties": {"filterValue": "value"}
|
||||
}'
|
||||
```
|
||||
|
||||
</RequestExample>
|
||||
|
||||
<ResponseExample>
|
||||
|
||||
```json Response
|
||||
{
|
||||
"success": 1,
|
||||
"new_user_group": true,
|
||||
"user_group": {
|
||||
"team_id": 3,
|
||||
"token": "<user_group_token_to_auth_dashboard>",
|
||||
"name": "Example 1",
|
||||
"provided_id": "example_1"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</ResponseExample>
|
||||
101
apps/docs/api-reference/endpoint/update.mdx
Normal file
101
apps/docs/api-reference/endpoint/update.mdx
Normal file
@@ -0,0 +1,101 @@
|
||||
---
|
||||
title: "Update User"
|
||||
api: "PUT https://api.mintlify.com/api/user"
|
||||
description: "This endpoint updates an existing user."
|
||||
---
|
||||
|
||||
### Body
|
||||
|
||||
<ParamField body="name" type="string">
|
||||
This is the name of the user group.
|
||||
</ParamField>
|
||||
|
||||
<ParamField body="user_group_id" type="string">
|
||||
This is the ID you use to identify this user group in your database.
|
||||
</ParamField>
|
||||
|
||||
<ParamField body="mapping" type="object">
|
||||
This is a JSON mapping of schema id to either the data source that this user
|
||||
group should be associated with or id of the datasource you provided when
|
||||
creating it.
|
||||
</ParamField>
|
||||
|
||||
<ParamField body="properties" type="object">
|
||||
This is a JSON object for properties assigned to this user group. These will
|
||||
be accessible through variables in the dashboards and SQL editor
|
||||
</ParamField>
|
||||
|
||||
### Response
|
||||
|
||||
<ResponseField name="success" type="number">
|
||||
Indicates whether the call was successful. 1 if successful, 0 if not.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="user_group" type="object">
|
||||
|
||||
The contents of the user group
|
||||
|
||||
<Expandable title="Toggle object">
|
||||
|
||||
<ResponseField name="team_id" type="number">
|
||||
Indicates whether a new user group was created.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="token" type="string">
|
||||
This is the user group token (userGroupToken or USER_GROUP_TOKEN) that will be
|
||||
used to identify which user group is viewing the dashboard. You should save
|
||||
this on your end to use when rendering an embedded dashboard.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="name" type="string">
|
||||
This is the name of the user group provided in the request body.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="provided_id" type="string">
|
||||
This is the user_group_id provided in the request body.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="properties" type="JSON | Null">
|
||||
This is the properties object if it was provided in the request body
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="api_environment_tag" type="JSON or null">
|
||||
This is the environment tag of the user group. Possible values are 'Customer'
|
||||
and 'Testing'
|
||||
</ResponseField>
|
||||
|
||||
</Expandable>
|
||||
|
||||
</ResponseField>
|
||||
|
||||
<RequestExample>
|
||||
|
||||
```bash Example Request
|
||||
curl --location --request PUT 'https://api.mintlify.com/api/user' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'Authorization: Token <token>' \
|
||||
--data-raw '{
|
||||
"user_group_id": "example_1",
|
||||
"name": "Example 1",
|
||||
"mapping": {"40": "213", "134": "386"},
|
||||
"properties": {"filterValue": "value"}
|
||||
}'
|
||||
```
|
||||
|
||||
</RequestExample>
|
||||
|
||||
<ResponseExample>
|
||||
|
||||
```json Response
|
||||
{
|
||||
"success": 1,
|
||||
"user_group": {
|
||||
"team_id": 113,
|
||||
"token": "<user_group_token_to_auth_dashboard>",
|
||||
"name": "ok",
|
||||
"provided_id": "6"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</ResponseExample>
|
||||
21
apps/docs/api-reference/how-to.mdx
Normal file
21
apps/docs/api-reference/how-to.mdx
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: How-to
|
||||
---
|
||||
|
||||
### How to find my `typebotId`
|
||||
|
||||
If you'd like to execute the typebot in preview mode, you will need to provide the ID of the building typebot available in the editor URL:
|
||||
|
||||
<Frame>
|
||||
<img src="/images/api/typebotId.png" alt="Get typebot ID" />
|
||||
</Frame>
|
||||
|
||||
### How to find my `publicId`
|
||||
|
||||
For published typebot execution, you need to provide the public typebot ID available here:
|
||||
|
||||
<img src="/images/api/publicId.png" alt="Get typebot ID" />
|
||||
|
||||
### How to find my `workspaceId`
|
||||
|
||||
In your workspace dashboard, head over to `Settings & Members > Workspace > Settings` and copy the workspace ID
|
||||
4
apps/docs/api-reference/results/delete.mdx
Normal file
4
apps/docs/api-reference/results/delete.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Delete results'
|
||||
openapi: DELETE /v1/typebots/{typebotId}/results
|
||||
---
|
||||
4
apps/docs/api-reference/results/get.mdx
Normal file
4
apps/docs/api-reference/results/get.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Get a result'
|
||||
openapi: GET /v1/typebots/{typebotId}/results/{resultId}
|
||||
---
|
||||
4
apps/docs/api-reference/results/list-logs.mdx
Normal file
4
apps/docs/api-reference/results/list-logs.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'List logs in result'
|
||||
openapi: GET /v1/typebots/{typebotId}/results/{resultId}/logs
|
||||
---
|
||||
4
apps/docs/api-reference/results/list.mdx
Normal file
4
apps/docs/api-reference/results/list.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'List results'
|
||||
openapi: GET /v1/typebots/{typebotId}/results
|
||||
---
|
||||
4
apps/docs/api-reference/typebot/create.mdx
Normal file
4
apps/docs/api-reference/typebot/create.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Create a typebot'
|
||||
openapi: POST /v1/typebots
|
||||
---
|
||||
4
apps/docs/api-reference/typebot/delete.mdx
Normal file
4
apps/docs/api-reference/typebot/delete.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Delete a typebot'
|
||||
openapi: DELETE /v1/typebots/{typebotId}
|
||||
---
|
||||
4
apps/docs/api-reference/typebot/get-published-bot.mdx
Normal file
4
apps/docs/api-reference/typebot/get-published-bot.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Get published bot'
|
||||
openapi: GET /v1/typebots/{typebotId}/publishedTypebot
|
||||
---
|
||||
4
apps/docs/api-reference/typebot/get.mdx
Normal file
4
apps/docs/api-reference/typebot/get.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Get a typebot'
|
||||
openapi: GET /v1/typebots/{typebotId}
|
||||
---
|
||||
4
apps/docs/api-reference/typebot/import.mdx
Normal file
4
apps/docs/api-reference/typebot/import.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Import a typebot'
|
||||
openapi: POST /v1/typebots/import
|
||||
---
|
||||
4
apps/docs/api-reference/typebot/list.mdx
Normal file
4
apps/docs/api-reference/typebot/list.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'List typebots'
|
||||
openapi: GET /v1/typebots
|
||||
---
|
||||
4
apps/docs/api-reference/typebot/publish.mdx
Normal file
4
apps/docs/api-reference/typebot/publish.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Publish typebot'
|
||||
openapi: POST /v1/typebots/{typebotId}/publish
|
||||
---
|
||||
4
apps/docs/api-reference/typebot/unpublish.mdx
Normal file
4
apps/docs/api-reference/typebot/unpublish.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Unpublish typebot'
|
||||
openapi: POST /v1/typebots/{typebotId}/unpublish
|
||||
---
|
||||
4
apps/docs/api-reference/typebot/update.mdx
Normal file
4
apps/docs/api-reference/typebot/update.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Update a typebot'
|
||||
openapi: PATCH /v1/typebots/{typebotId}
|
||||
---
|
||||
4
apps/docs/api-reference/workspace/create.mdx
Normal file
4
apps/docs/api-reference/workspace/create.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Create a workspace'
|
||||
openapi: POST /v1/workspaces
|
||||
---
|
||||
4
apps/docs/api-reference/workspace/delete.mdx
Normal file
4
apps/docs/api-reference/workspace/delete.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Delete a workspace'
|
||||
openapi: DELETE /v1/workspaces/{workspaceId}
|
||||
---
|
||||
4
apps/docs/api-reference/workspace/get.mdx
Normal file
4
apps/docs/api-reference/workspace/get.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Get a workspace'
|
||||
openapi: GET /v1/workspaces/{workspaceId}
|
||||
---
|
||||
4
apps/docs/api-reference/workspace/list-members.mdx
Normal file
4
apps/docs/api-reference/workspace/list-members.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'List members'
|
||||
openapi: GET /v1/workspaces/{workspaceId}/members
|
||||
---
|
||||
4
apps/docs/api-reference/workspace/list.mdx
Normal file
4
apps/docs/api-reference/workspace/list.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'List workspaces'
|
||||
openapi: GET /v1/workspaces
|
||||
---
|
||||
4
apps/docs/api-reference/workspace/update.mdx
Normal file
4
apps/docs/api-reference/workspace/update.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: 'Update a workspace'
|
||||
openapi: PATCH /v1/workspaces/{workspaceId}
|
||||
---
|
||||
Reference in New Issue
Block a user