API Setup and Endpoints

Softr API key generation and available endpoints.

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

๐Ÿ’ก
You need to be the owner of the application or a workspace collaborator to be able to make API calls. Thus, guest collaborators of the application wonโ€™t be able to make calls.
๐Ÿ‘‰
Depending on your needs, you can also consider using a Call API action.

Finding your API key

First, navigate to Dashboard. Then click on your profile icon โ†’ My account โ†’ API Settings

Notion image

Generating an API key

When you first enter the API Settings section in your account, you'll see a Generate API key button.

Generate API Key
Generate API Key

As soon as you hit the button, the generated API key will appear. Here, you can View, Copy, Regenerate, or Delete the key.

API Key actions
API Key actions

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

๐Ÿ’ก
Make sure to have your Softr app published before making API calls.

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.

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 your API key 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).

๐Ÿ’ก
If you don't specify a password, it will be generated for the user automatically.

Finally, you can set the value of generate_magic_link to "true" or "false" depending on whether you want to generate a Magic Link 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.

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 with the actual email of the user you need to delete as well as provide your API key (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.

Generate a Magic Link for the User

Using this endpoint, you can generate a Magic Link for the specified user in your Softr app. Bellow is an example of an API call.

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 with the actual email of the user as well as provide your API key (the value next to Softr-Api-Key) and the domain/subdomain of your Softr app (the value next to Softr-Domain).

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.

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 and Make to take you through the setup process.

Did this answer your question?
๐Ÿ˜ž
๐Ÿ˜
๐Ÿคฉ

Last updated on March 29, 2024