Cohort
HomeSign in
  • WHAT IS COHORT?
  • WHAT'S NEW?
  • Concepts
    • Experience Space
    • Campaigns
    • Standalone campaign
    • Rewards
    • Users
    • Experiences
  • GETTING STARTED
    • Overview
    • Admin Authentication
      • Setup a SAML SSO provider
      • Setup a OIDC SSO provider
    • Test mode
    • Adding Team members
    • Languages Admin interface
    • Languages User interfaces
  • Campaigns
    • Overview
    • Create a campaign
      • Challenge campaign
      • Store campaign
      • Airdrop campaign
      • Standalone campaign
    • Manage a campaign
      • Consult the indicators
      • Share a campaign
      • See the participants
      • Modify a campaign
      • End a campaign
      • Archive a campaign
      • Delete a campaign
    • Campaign display mode
  • REWARDS
    • Overview
    • Perk
      • Create a Perk
      • Manage a Perk
    • Digital Asset
      • Create a Digital Asset
      • Manage a Digital Asset
    • Rewards Distribution mode
  • USER INTERFACES
    • Experience Space
      • Configure your Experience Space branding
      • Customize your Experience Space
      • Customize your Membership Pass
    • Standalone campaigns
  • USERS
    • Overview
    • Import and export users
    • Custom user properties
    • Lists and Segments
    • Badges
  • Integrations
    • Apps
      • Brevo
      • Comarch
      • Facebook
      • Klaviyo
      • Maxxing
      • PostgreSQL
      • Salesforce
      • Shopify
      • Spotify
      • Talon.One
      • Tiktok
      • Typeform
      • Youtube
  • USER ACTIONS
    • Overview
    • Native Applications
    • Social Media
    • Lifestyle
    • Quizz and Surveys
  • INDICATORS
    • Overview
    • General indicators
    • Users indicators
    • Campaigns indicators
  • Developers
    • Overview
    • Embed
    • Merchants API
    • Campaign diffusion
  • Security
    • Security at Cohort
  • GLOSSARY
Powered by GitBook
On this page
  • Authentication
  • Test and Live modes
  • Errors
  • API Reference
  • Webhooks
  1. Developers

Merchants API

PreviousEmbedNextCampaign diffusion

Last updated 6 months ago

The Merchants API allows you to interact with Cohort programmatically.

It is organized around . Our API has predictable resource-oriented URLs, returns responses, and uses standard HTTP response codes, authentication, and verbs.

The base URL for the API is

Authentication

The Cohort API uses API keys to authenticate requests. You can view and manage your API keys in the Settings > Integrations section of the Cohort Admin.

At the moment, API keys are not scoped and have full permissions.

Every call to the API requires to be authenticated by passing your API key in the authorization header: Authorization: Bearer <your-api-key>

A 401 HTTP error will be returned if the API key is not provided or invalid.

Do not share your API keys with anyone. Anyone with this API Key can use the Cohort API on your behalf. If you have any reason to believe it has been compromised, please send us an email and it can be deactivated or changed.

Test and Live modes

Cohort does not provide a dedicated staging / sandbox environment. Instead, every organization is provided with a whose data are completely separated.

In the Cohort Admin, you can create different API keys for each mode.

Test mode API keys have the prefix test_ and live mode API keys have the prefix live_.

Errors

Cohort uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success.

For all errors that are due to invalid or unexpected input (a missing parameter, an invalid state, ..) the API will return a 417 status code with a code and message providing context about the error.

{
    "code": "generic.invalid-request", // The type of the error
    "message": "Parameter email not provided" // More context about the error
}

Codes in the 5xx range indicate an error with Cohort’s servers (these should not happen, feel free to reach out at support@getcohort.com if you are encountering them).

API Reference

Webhooks

Cohort offers Webhooks that you can subscribe to in order to get notified when specific events happen in Cohort.

Go to your Cohort Admin > Settings > Integrations and use your Webhooks Portal to register new Webhooks.

At the moment, there is no way to register new Webhooks programmatically.

The detail of all the Webhooks Events that can be subscribed to can be found here:

The full API Reference is available at

REST
JSON-encoded
https://api.getcohort.com
Test and a Live merchant
https://api.getcohort.com/docs/merchants-api
https://www.svix.com/event-types/eu/org_2Osm3gZeJWuhjTsaGO0Sz5C1RzZ/