> ## Documentation Index
> Fetch the complete documentation index at: https://docs.softr.io/llms.txt
> Use this file to discover all available pages before exploring further.

# API Setup and Endpoints

> Softr API key generation and available endpoints.

You can generate an API token for your Softr account to be used when interacting with the API endpoints. Let's first see how you can generate the token, and then we'll review the available endpoints and provide API call examples.

<Tip>You need to be **the owner of the application or a workspace collaborator** to be able to make API calls. Thus, [guest collaborators](/workspace-and-billing/jZP6yaeXMiJCuB6HhS4xKd/workspaces-and-applications/kTbEWSYXhBCbtTB4K9dpKs) of the application won’t be able to make calls.</Tip>
<Note>Depending on your needs, you can also consider using a [Call API](/actions/ntEfT9zSJk6aY54G6W5KGU/call-api/i9f1s3w9wib3oRmS4HZ7MX) action. </Note>

## Generating an API token

You authenticate API calls with a **Personal Access Token**. To create one:

1. Open your Softr [Dashboard](https://studio.softr.io/dashboard), click on your workspace in the top-left corner, and go to **API tokens**.
   <Frame>
     <img src="https://mintcdn.com/softr-2b8a27e1/uAkqr-2ahbgf7XTE/softr-api/images/api-setup-and-endpoints/image1.png?fit=max&auto=format&n=uAkqr-2ahbgf7XTE&q=85&s=f0c489f72a6bdf291999109f03ce269a" alt="API tokens page" width="2880" height="1800" data-path="softr-api/images/api-setup-and-endpoints/image1.png" />
   </Frame>

2. Click **Create**, give your token a recognizable name, and pick an expiration period.
   <Frame caption="Name your token">
     <img src="https://mintcdn.com/softr-2b8a27e1/uAkqr-2ahbgf7XTE/softr-api/images/api-setup-and-endpoints/image2.png?fit=max&auto=format&n=uAkqr-2ahbgf7XTE&q=85&s=d42e4d9afbb060e220833ffc67d0402d" alt="Create new token" width="2880" height="1800" data-path="softr-api/images/api-setup-and-endpoints/image2.png" />
   </Frame>

3. Define the **scopes** — choose what the token can access and the permissions it should have — then click **Continue**.
   <Frame caption="Define scopes">
     <img src="https://mintcdn.com/softr-2b8a27e1/uAkqr-2ahbgf7XTE/softr-api/images/api-setup-and-endpoints/image3.png?fit=max&auto=format&n=uAkqr-2ahbgf7XTE&q=85&s=afc0f79340a8494110178d4707953682" alt="Define scopes" width="2880" height="1800" data-path="softr-api/images/api-setup-and-endpoints/image3.png" />
   </Frame>

4. Copy the token and store it somewhere safe — for security reasons it's shown only once.
   <Frame caption="Copy your token">
     <img src="https://mintcdn.com/softr-2b8a27e1/uAkqr-2ahbgf7XTE/softr-api/images/api-setup-and-endpoints/image4.png?fit=max&auto=format&n=uAkqr-2ahbgf7XTE&q=85&s=d4752a42a6fba3bdb6a5a272813ce655" alt="Token created" width="2880" height="1800" data-path="softr-api/images/api-setup-and-endpoints/image4.png" />
   </Frame>

You'll pass this token in the **Softr-Api-Key** header of every request (see the examples below).

That's it. Now you have your API token that you can use when interacting with your Softr apps through the API. Let's proceed to see what endpoints are available.

<Tip>Make sure to have your **Softr app published** before making API calls.</Tip>

## API Endpoints

### **Create User**

This endpoint allows creating a user inside the specified Softr app within your account. Below is an example of an API call.

```javascript theme={null}
curl --request POST 'https://studio-api.softr.io/v1/api/users' \
--header 'Softr-Api-Key: uYGskr7MqMeRYrjQjsB8uEQ8n' \
--header 'Softr-Domain: yourdomain.com' \
--header 'Content-Type: application/json' \
--data-raw '{
  "full_name": "John Richardson",
  "email": "johnr@gmail.com",
  "password": "12345678",
  "generate_magic_link":true
}'
```

Here, you need to replace the value next to **Softr-Api-Key** with the API token you've generated and add your Softr app's domain/subdomain instead of **yourdomain.com**.

Next, you need to provide the **Full Name** of the new user along with an **Email** and **Password** (replace the values next to **full\_name**, **email**, and **password**).

<Tip>If you don't specify a password, it will be generated for the user automatically.</Tip>

Finally, you can set the value of **generate\_magic\_link** to "true" or "false" depending on whether you want to generate a [Magic Link](/add-and-manage-users/pxnkp9H3qyEVMF6XUceqnj/add-or-import-users-manually/g5R1bGnBTFJ3sWLR8Mgdng) for the user or not.

### **Delete User**

Using this endpoint, you can delete a user from the specified Softr app. Bellow is an example of an API call.

```javascript theme={null}
curl --location --request DELETE 'https://studio-api.softr.io/v1/api/users/user@softr.io' \
-header 'Softr-Api-Key: pYSskw7MqMeRUgjQtsf9uRQ5n' \
-header 'Softr-Domain: yourdomain.com'
```

Just replace **[user@softr.io](mailto:user@softr.io)** with the actual email of the user you need to delete as well as provide your API token (the value next to **Softr-Api-Key**) and the domain/subdomain of the Softr app (the value next to **Softr-Domain**) you want to delete the user from. **The rest needs to remain the same as in the example.**

### **Deactivate User**

Using this endpoint, you can deactivate a user in the specified Softr app. Deactivated users cannot log in and don't count toward your plan's user limit, but their record is retained and they can be re-activated later. Below is an example of an API call.

```javascript theme={null}
curl --location --request POST 'https://studio-api.softr.io/v1/api/users/user@softr.io/deactivate' \
--header 'Softr-Api-Key: pYSskw7MqMeRUgjQtsf9uRQ5n' \
--header 'Softr-Domain: yourdomain.com'
```

Just replace **[user@softr.io](mailto:user@softr.io)** with the actual email of the user you need to deactivate as well as provide your API token (the value next to **Softr-Api-Key**) and the domain/subdomain of the Softr app (the value next to **Softr-Domain**) you want to deactivate the user in. **The rest needs to remain the same as in the example.**

### **Activate User**

Using this endpoint, you can re-activate a previously deactivated user in the specified Softr app. Below is an example of an API call.

```javascript theme={null}
curl --location --request POST 'https://studio-api.softr.io/v1/api/users/user@softr.io/activate' \
--header 'Softr-Api-Key: pYSskw7MqMeRUgjQtsf9uRQ5n' \
--header 'Softr-Domain: yourdomain.com'
```

Just replace **[user@softr.io](mailto:user@softr.io)** with the actual email of the user you need to activate as well as provide your API token (the value next to **Softr-Api-Key**) and the domain/subdomain of the Softr app (the value next to **Softr-Domain**) you want to activate the user in. **The rest needs to remain the same as in the example.**

### **Invite User**

Using this endpoint, you can send an invitation email to an existing user of the specified Softr app. Once invited, the user's status changes to **Invited**. Note that the **app must be published** for invitations to be sent. Below is an example of an API call.

```javascript theme={null}
curl --location --request POST 'https://studio-api.softr.io/v1/api/users/user@softr.io/invite' \
--header 'Softr-Api-Key: pYSskw7MqMeRUgjQtsf9uRQ5n' \
--header 'Softr-Domain: yourdomain.com'
```

Just replace **[user@softr.io](mailto:user@softr.io)** with the actual email of the user you need to invite as well as provide your API token (the value next to **Softr-Api-Key**) and the domain/subdomain of the Softr app (the value next to **Softr-Domain**) you want to invite the user in. **The rest needs to remain the same as in the example.**

### **Generate a Magic Link for the User**

Using this endpoint, you cangenerate a [Magic Link](/add-and-manage-users/pxnkp9H3qyEVMF6XUceqnj/add-or-import-users-manually/g5R1bGnBTFJ3sWLR8Mgdng) for the specified user in your Softr app. Bellow is an example of an API call.

```javascript theme={null}
curl --location --request POST 'https://studio-api.softr.io/v1/api/users/magic-link/generate/user@softr.io' \
--header 'Softr-Api-Key: pYSskw7MqMeRUgjQtsf9uRQ5n' \
--header 'Softr-Domain: yourdomain.com'
```

Just replace **[user@softr.io](mailto:user@softr.io)** with the actual email of the user as well as provide your API token (the value next to **Softr-Api-Key**) and the domain/subdomain of your Softr app (the value next to **Softr-Domain**).

### Sync a Single User, Group of Users, or All Users

Use this endpoint to sync a single user, an array of users, or if no email is included, trigger a user sync for all users.
**Single User or Group of Users:**

```javascript theme={null}
curl --location --request POST 'https://studio-api.softr.io/v1/api/users/sync' \
--header 'Softr-Api-Key: pYSskw7MqMeRUgjQtsf9uRQ5n' \
--header 'Softr-Domain: yourdomain.com'
--data-raw '["email1@example.com", "email2@example.com", "email3@example.com"]'
```

**Sync All Users:**

```javascript theme={null}
curl --location --request POST 'https://studio-api.softr.io/v1/api/users/sync' \
--header 'Softr-Api-Key: pYSskw7MqMeRUgjQtsf9uRQ5n' \
--header 'Softr-Domain: yourdomain.com'
```

### **Validate an Authentication Token**

Using this endpoint you can validate a user authentication JWT token. This could be used in cases when you use Softr users data (e.g. to show content based on user ID) in external systems outside of Softr and need to authenticate the users with Softr. Here's how you can do that. The following is an example of an API call, where you need to replace **"yourdomain.softr.app"** with your Softr subdomain or custom domain you have connected as well as use the specific token you need to authenticate instead of **your jwt token value**.

```javascript theme={null}
curl --location --request POST '[https://yourdomain.softr.app/v1/api/users/validate-token](https://yourdomain.softr.app/v1/api/users/validate-token)' \
--header 'Content-Type: application/json' \
--data-raw '{"jwt":"your jwt token value"}'
```

## Use Cases

There are certainly a lot of different use cases for interacting with the Softr API. But if you're working with no-code tools, you can make API calls with such tools as Zapier or Integromat. In subsections to this article, we consider some use cases involving [Zapier](/softr-api/tTFQ5vSAUozj5MsKixMH8C/use-case-adding-users-through-zapier/mhCMmdRcJL2UDsprwzFYuT) and [Make](/softr-api/tTFQ5vSAUozj5MsKixMH8C/use-case-adding-users-through-make-formerly-integromat/vFH1YQTF7At7FwCYSmJKYz) to take you through the setup process.
