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.
Finding your API key
First, navigate to Dashboard. Then click on your profile icon โ My account โ API Settings
Generating an API key
When you first enter the API Settings section in your account, you'll see a Generate API key button.
As soon as you hit the button, the generated API key will appear. Here, you can View, Copy, Regenerate, or Delete the key.
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.
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).
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.
Last updated on March 29, 2024