Enabling Prefinery API Access

Using our API, you can connect your Prefinery project with other web services, including your own website or application. 

Before you proceed, please keep these best practices in mind when using our API:

  • Always keep your API key a secret as it can be used to access your account. 
  • Never call the API from front-end code, such as a Single Page Application (SPA) as this would expose the API key publicly. Instead, you can follow our recommendations on how to use Prefinery with JavaScript Frameworks
1

From your Prefinery dashboard, click on Settings at the upper-right corner and select Company Settings on the dropdown menu. 

2

In the Company Settings page, go to API Keys and then click the Create API Key button to generate a new API key. 

3

Give your new key an identifiable name and set usage permissions for this key. 

Setting the proper permissions allow you to limit and therefore secure access to your campaign. For example, you may want to make sure that the key can't be used to accidentally delete a project. 

Here's what each of these permissions does: 

Projects 

  • Read: Receive a list of all projects or get information about a specific project (e.g. users total, users count by status, etc.) by its ID. 
  • Delete: Delete a project by its ID. 

Users 

  • Create: Create a new user on a particular project using their email address (required) and other information (e.g. name, status, custom responses, etc.). 
  • Read: Receive a list of all users in the project or get information about a specific user (e.g. email, status, referral count, etc.) by their ID.
  • Update: Update a user's information by their ID or Checkin a user.
  • Delete: Delete a user by their ID from a particular project. 

Rewards

  • Create: Manually issue a reward (by descriptor) to a specific user (by email address). 
  • Read: Receive a list of all rewards in the project or get information about a specific reward (e.g. descriptor, type, user role, etc.) by its ID. 
  • Update: Mark a reward as delivered or revoked

Suppressions

  • Create: Add an email address to the suppressions list. 
  • Read: Receive a list of all email suppressions.
  • Delete: Remove a Manual or HardBounce suppression and reactivate the email address for email delivery.

Friend Invitations

Webhook Subscriptions

  • Create: Allow 3rd party apps to connect to your project and receive events. 
  • Read: Allow 3rd party apps to view the status of their connection.
  • Delete: Allow 3rd party apps to disconnect from your project and no longer receive events.

Webhook Events

  • Read: Allow 3rd party apps to get more details on events that happen in your project.

Full permissions to Webhook Subscriptions and Webhook Events are required in order to connect Prefinery to 3rd party apps such as Zapier, Integromat, Pabbly Connect, Integrately and Sync Spider.

4

Copy your key by clicking on it to use it for you intended purpose. 

You also have the option to Rename your key or set it to Expire

When you Expire a key which happens immediately, all API calls using this key will fail, and the key will be in the Expired Keys section that appears right under Active Keys. You can Reactivate the key at any time.

You also have the option to Delete an expired key which permanently removes it from your account making it irretrievable. 

Tip: You can create multiple keys and give each a unique name. This allows you to do key rotation / rolling by adding a new key, updating your codebase to use the new key, expiring the old key once it's no longer being used, testing your integration works, and finally, deleting the old key.

The API Docs button will direct you to our comprehensive API Documentation

Still need help? How can we help? How can we help?