Back to top

Blaize public API documentation

Authentication

Login

Login
POST/blaize/login

User Login

Example URI

POST /blaize/login
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "identifiers": {
    "email_address": "joe.blow@company.com"
  },
  "validators": {
    "password": "mysecurepassword123"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "identifiers": {
      "type": "object",
      "properties": {
        "email_address": {
          "type": "string"
        }
      }
    },
    "validators": {
      "type": "object",
      "properties": {
        "password": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "identifiers",
    "validators"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "cookie": "blaize_session=0123456789ABCD; Expires=Fri, 16 Nov 2018 12:35:56 GMT; Path=/;",
  "message": "Registration successful",
  "tracking_id": "TT0123456789ABCD"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "cookie": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "tracking_id": {
      "type": "string"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Logout

Logout
POST/blaize/logout

User Logout

Example URI

POST /blaize/logout
Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Session deleted"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json

Start Passwordless

Important Info

For passwordless authentication, first is required to send a POST to request an email to be sent to the User’s email with a link for the user to click on to verify his email.

Start Passwordless
POST/blaize/token-exchange

Start Passwordless Authentication

Example URI

POST /blaize/token-exchange
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "identifiers": {
    "email_address": "joe.blow@company.com"
  },
  "delivery": {
    "method": "email",
    "destination": "joe.blow@company.com",
    "action": "login",
    "redirect": "/"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "identifiers": {
      "type": "object",
      "properties": {
        "email_address": {
          "type": "string"
        }
      }
    },
    "delivery": {
      "type": "object",
      "properties": {
        "method": {
          "type": "string"
        },
        "destination": {
          "type": "string"
        },
        "action": {
          "type": "string"
        },
        "redirect": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "identifiers",
    "delivery"
  ]
}
Response  201
Response  400
HideShow
Headers
Content-Type: application/json

Complete Passwordless

Complete Passwordless
GET/blaize/token-exchange/

Complete Passwordless Authentication

Example URI

GET /blaize/token-exchange/
Response  302
HideShow
Headers
Location: (string)
Set-Cookie: (string)
Response  401
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Start Password Reset

Important Info

To reset a User password, first is required to send a POST to request an email to be sent to the User’s email with a link for the user to click on so as to verify that he requested this password change.

Start password reset
POST/blaize/users/reset

Start password reset

Example URI

POST /blaize/users/reset
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "identifiers": {
    "email_address": "joe.blow@company.com"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "identifiers": {
      "type": "object",
      "properties": {
        "email_address": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "identifiers"
  ]
}
Response  200
Response  404
Response  400
HideShow
Headers
Content-Type: application/json

Complete Password Reset

Complete password reset
POST/blaize/users/reset/{state}

Complete password reset

Example URI

POST /blaize/users/reset/state
URI Parameters
HideShow
state
string (required) 

Unique State identifier

Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "validators": {
    "password": "mysecurepassword123"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "validators": {
      "type": "object",
      "properties": {
        "password": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "validators"
  ]
}
Response  200
Response  404
Response  400
HideShow
Headers
Content-Type: application/json

Password Reset Form

Password Reset Form
GET/blaize/blaize/password-reset.html

Returns the Password Reset Form

Example URI

GET /blaize/blaize/password-reset.html
Response  200
HideShow
Headers
Content-Type: text/html

Anonymous Session

Anonymous Session
POST/blaize/anonymous-session

Create anonymous session.

Example URI

POST /blaize/anonymous-session
Request  with body
HideShow
Headers
Content-Type: application/json
Response  201
HideShow
Headers
Content-Type: application/json
Set-Cookie: blaize_session=5562c0cf-b07a-42d0-ac1a-c0e29735e73a; Expires=Tue, 1 Jan 2019 12:00:00 GMT; Path=/;
Set-Cookie: blaize_tracking_id=33d576c7-d036-40e7-8141-8a91998a5c79; Expires=Tue, 1 Jan 2019 12:00:00 GMT; Path=/;
Body
{
  "message": "Anonymous session created successfully",
  "tracking_id": "33d576c7-d036-40e7-8141-8a91998a5c79"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    },
    "tracking_id": {
      "type": "string"
    }
  }
}

Start update email request

Start update your current email address
POST/blaize/users/update-email

Example URI

POST /blaize/users/update-email
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "new_identifiers": {
    "email_address": "joe.blow@company.com"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "new_identifiers": {
      "type": "object",
      "properties": {
        "email_address": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "new_identifiers"
  ]
}
Response  200
Response  404
Response  400
HideShow
Headers
Content-Type: application/json

Complete update email request

Complete update your current email address
POST/blaize/users/update-email/

Example URI

POST /blaize/users/update-email/
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "validators": {
    "password": "mysecurepassword123"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "validators": {
      "type": "object",
      "properties": {
        "password": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "validators"
  ]
}
Response  200
Response  404
Response  400
HideShow
Headers
Content-Type: application/json

Update email request Form

Update email request Form
GET/blaize/update-email.html

Returns the update email request Form

Example URI

GET /blaize/update-email.html
Response  200
HideShow
Headers
Content-Type: text/html

Change password request

Change your password
POST/blaize/users/change-password

Example URI

POST /blaize/users/change-password
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "current_validators": {
    "password": "mysecurepassword123"
  },
  "new_validators": {
    "password": "mysecurepassword123"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "current_validators": {
      "type": "object",
      "properties": {
        "password": {
          "type": "string"
        }
      }
    },
    "new_validators": {
      "type": "object",
      "properties": {
        "password": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "current_validators",
    "new_validators"
  ]
}
Response  200
Response  403
Response  404
Response  400
HideShow
Headers
Content-Type: application/json

User

Register

Register
POST/blaize/register

Register a new User

Example URI

POST /blaize/register
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "identifiers": {
    "email_address": "joe.blow@company.com"
  },
  "validators": {
    "password": "mysecurepassword123"
  },
  "attributes": {
    "first_name": "Joe",
    "surname": "Blow"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "identifiers": {
      "type": "object",
      "properties": {
        "email_address": {
          "type": "string"
        }
      }
    },
    "validators": {
      "type": "object",
      "properties": {
        "password": {
          "type": "string"
        }
      }
    },
    "attributes": {
      "type": "object",
      "properties": {
        "first_name": {
          "type": "string"
        },
        "surname": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "identifiers",
    "validators"
  ]
}
Response  201
HideShow
Body
{
  "cookie": "blaize_session=0123456789ABCD; Expires=Fri, 16 Nov 2018 12:35:56 GMT; Path=/;",
  "message": "Registration successful",
  "tracking_id": "TT0123456789ABCD"
}
Schema
{
  "type": "object",
  "properties": {
    "cookie": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "tracking_id": {
      "type": "string"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  400
HideShow
Headers
Content-Type: application/json

Account

Account
GET/blaize/account

Retrieves the user’s core account details

Example URI

GET /blaize/account
Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "identifiers": {
    "email_address": "joe.blow@company.com"
  },
  "tracking_id": "123"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "identifiers": {
      "type": "object",
      "properties": {
        "email_address": {
          "type": "string"
        }
      }
    },
    "tracking_id": {
      "type": "string",
      "description": "456 (string)"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json

Profile

Profile
GET/blaize/profile

Retrieves the user’s profile

Example URI

GET /blaize/profile
Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "first_name": "Joe",
  "surname": "Blow"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "surname": {
      "type": "string"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json

Save Profile
PUT/blaize/profile

Creates/Updates the user’s profile

Example URI

PUT /blaize/profile
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: `blaize_session=...` (string)
Body
{
  "first_name": "Joe",
  "surname": "Blow"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "surname": {
      "type": "string"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Update Profile
POST/blaize/profile

Updates the user’s profile, merging with any exist fields

Example URI

POST /blaize/profile
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: `blaize_session=...` (string)
Body
{
  "first_name": "Joe",
  "surname": "Blow"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "surname": {
      "type": "string"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Update Profile
PATCH/blaize/profile

Updates the user’s profile, merging with any exist fields

Example URI

PATCH /blaize/profile
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: `blaize_session=...` (string)
Body
{
  "first_name": "Joe",
  "surname": "Blow"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "surname": {
      "type": "string"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Extended Profile

Extended Profile
GET/blaize/profile/{appId}

Retrieves the user’s Extended Profile

Example URI

GET /blaize/profile/appId
URI Parameters
HideShow
appId
string (required) 

Unique Profile identifier

Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "first_name": "Joe",
  "surname": "Blow"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "surname": {
      "type": "string"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json

Save Extended Profile
PUT/blaize/profile/{appId}

Creates/Updates the user’s Extended Profile

Example URI

PUT /blaize/profile/appId
URI Parameters
HideShow
appId
string (required) 

Unique Profile identifier

Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Body
{
  "first_name": "Joe",
  "surname": "Blow"
}
Schema
{
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "surname": {
      "type": "string"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Authorization Challenge

Authorization Challenge
POST/blaize/authorization/challenge

Authorization Challenge against array of entitlement IDs.

Example URI

POST /blaize/authorization/challenge
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: blaize_session=5562c0cf-b07a-42d0-ac1a-c0e29735e73a;...
Body
{
  "entitlementIds": [
    "68cc48be-e47e-4707-8958-1249d87fca86"
  ],
  "contentIdentifier": "/"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "entitlementIds": {
      "type": "array"
    },
    "contentIdentifier": {
      "type": "string"
    }
  },
  "required": [
    "entitlementIds"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "68cc48be-e47e-4707-8958-1249d87fca86": false
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "68cc48be-e47e-4707-8958-1249d87fca86": {
      "type": "boolean"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json

Decision Engine

Decision Engine

The Blaize Decision Engine can be invoked via the Public API to calculate an HTTP Response based upon Request-Level Rules created in the Admin Console. This functionality is built into the Blaize Dynamic CDN but the API variant is useful for CMS or edge side integrations.

Decision Engine
POST/blaize/decision-engine

Example URI

POST /blaize/decision-engine
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "uri": "/x.html",
  "http_method": "POST",
  "session": "xxx-xxx-xxx",
  "request_headers": {
    "User-Agent": "<userAgent>"
  },
  "content_metadata": {
    "publishedDate": "<contentAge>"
  },
  "jwt": "xxx-xxx-xxx",
  "btr": "17e74b9e49e66282e55d4b7ec73de951"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "uri": {
      "type": "string"
    },
    "http_method": {
      "type": "string"
    },
    "session": {
      "type": "string"
    },
    "request_headers": {
      "type": "object",
      "properties": {
        "User-Agent": {
          "type": "string"
        }
      }
    },
    "content_metadata": {
      "type": "object",
      "properties": {
        "publishedDate": {
          "type": "string"
        }
      }
    },
    "jwt": {
      "type": "string"
    },
    "btr": {
      "type": "string",
      "description": "MD5-hex-encoding of: path + \"|\" + trusted referrer secret"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "301",
  "body": "Redirecting to login page...",
  "headers": {
    "Location": "/login.html"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "status": {
      "type": "string"
    },
    "body": {
      "type": "string"
    },
    "headers": {
      "type": "object",
      "properties": {
        "Location": {
          "type": "string"
        }
      }
    }
  }
}
Response  409

Decision Engine
GET/blaize/decision-engine

For compatibilty with CDN, any web headers (Referrer, User-Agent) will be accepted and passed onto the rule engine

Example URI

GET /blaize/decision-engine
URI Parameters
HideShow
session
string (required) 

Zephr Session ID - same as the blaize_session cookie used by the CDN and authentication endpoints

path
string (required) 

Uniquely identifies the content Zephr is making a decision about. Request rules can be configured to only execute when the request path matches a provided regular expression.

content_id
string (optional) 

Passed as metadata.content_id to the Content API template, used to perform requests to a 3rd party API for additional content information used in making a decision

jwt
string (optional) 

A Json Web Token, may include identity or product holding claims

btr
string (optional) 

A trusted referrer token. If Zephr generates a matching token using path, passed-in Referer header and a configured secret, all entitlements used in this decision will be temporarily granted for this request

Response  200
HideShow

Response status and body are determined by the executed rule. If there is an error executing the rule, a 200 will be returned.

SDK Feature Decision Engine

SDK Feature Decision Engine

The SDK Feature Decision Engine can be invoked via the Public API to calculate a decision output response based upon Feature SDK Rules created in the Zephr Console. This endpoint is used by the Zephr SDK but can be called directly for custom integrations.

SDK Feature Decision Engine
POST/zephr/decision-engine

Example URI

POST /zephr/decision-engine
URI Parameters
HideShow
raw
boolean (optional) Default: false 

Should output raw value

Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "sdkFeatureSlug": "featureX",
  "session": "xxx-xxx-xxx",
  "ip": "x.x.x.x",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11)...",
  "path": "/x.html",
  "contentId": "xxx-xxx-xxx",
  "jwt": "xxx-xxx-xxx",
  "...": "..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "sdkFeatureSlug": {
      "type": "string",
      "description": "Feature SDK slug"
    },
    "session": {
      "type": "string",
      "description": "Zephr Session ID, required for trials"
    },
    "ip": {
      "type": "string",
      "description": "Client IP address, defaults to request IP"
    },
    "userAgent": {
      "type": "string",
      "description": "Client user agent"
    },
    "path": {
      "type": "string",
      "description": "Request path, required for trials"
    },
    "contentId": {
      "type": "string",
      "description": "Content ID, used to perform requests to a 3rd party API for additional content information used in making a decision"
    },
    "jwt": {
      "type": "string",
      "description": "A Json Web Token, may include identity or product holding claims"
    },
    "...": {
      "type": "string",
      "description": "Custom inputs configured in Feature SDK rule"
    }
  },
  "required": [
    "sdkFeatureSlug"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "sdkFeatureSlug": "featureX",
  "outputType": "ENUM",
  "outputValue": "YES"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "sdkFeatureSlug": {
      "type": "string",
      "description": "Feature SDK slug"
    },
    "outputType": {
      "type": "string",
      "enum": [
        "ENUM",
        "STRING",
        "NUMBER"
      ],
      "description": "Feature output type"
    },
    "outputValue": {
      "type": "string",
      "description": "Feature output value"
    }
  }
}
Response  200
HideShow

Raw parameter response

Body
Raw output value

SDK Feature Decision Engine
GET/zephr/decision-engine

For compatibility with CDN, any web headers (Referrer, User-Agent) will be accepted and passed onto the rule engine

Example URI

GET /zephr/decision-engine
URI Parameters
HideShow
sdkFeatureSlug
string (required) Example: featureX

Feature SDK slug

session
string (optional) Example: xxx-xxx-xxx

Zephr Session ID, required for trials

ip
string (optional) Example: x.x.x.x

Client IP address, defaults to request IP

userAgent
string (optional) Example: Mozilla/5.0 (Macintosh; Intel Mac OS X 11)...

Client user agent

path
string (optional) Example: /x.html

Request path, required for trials

content_id
string (optional) Example: xxx-xxx-xxx

Content ID, used to perform requests to a 3rd party API for additional content information used in making a decision

jwt
string (optional) Example: xxx-xxx-xxx

A Json Web Token, may include identity or product holding claims

raw
boolean (optional) Default: false 

Should output raw value

...
string (optional) 

Custom inputs configured in Feature SDK rule

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "sdkFeatureSlug": "featureX",
  "outputType": "ENUM",
  "outputValue": "YES"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "sdkFeatureSlug": {
      "type": "string",
      "description": "Feature SDK slug"
    },
    "outputType": {
      "type": "string",
      "enum": [
        "ENUM",
        "STRING",
        "NUMBER"
      ],
      "description": "Feature output type"
    },
    "outputValue": {
      "type": "string",
      "description": "Feature output value"
    }
  }
}
Response  200
HideShow

Raw parameter response

Body
Raw output value

Browser Feature Decisions

Browser Feature Decisions

Zephr HTML Features can be run in the browser by calling this API directly or using the Zephr Browser SDK.

Browser Feature Decisions
POST/zephr/feature-decisions

For compatibility with CDN, any web headers (Referrer, User-Agent) will be accepted and passed onto the rule engine

Example URI

POST /zephr/feature-decisions
Request  with body
HideShow
Headers
Content-Type: application/json
Cookie: blaize_session=...
Body
{
  "featureIds": [
    "featureX"
  ],
  "session": "xxx-xxx-xxx",
  "referer": "https://www.zephr.com/",
  "path": "/x.html",
  "contentId": "xxx-xxx-xxx",
  "jwt": "xxx-xxx-xxx",
  "customData": {
    "key": "value"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "featureIds": {
      "type": "array",
      "description": "Array of HTML Feature IDs"
    },
    "session": {
      "type": "string",
      "description": "Zephr Session ID"
    },
    "referer": {
      "type": "string",
      "description": "Browser referer"
    },
    "path": {
      "type": "string",
      "description": "Request path, defaults to \"/\""
    },
    "contentId": {
      "type": "string",
      "description": "Content ID, used to perform requests to a 3rd party API for additional content information used in making a decision"
    },
    "jwt": {
      "type": "string",
      "description": "A Json Web Token, may include identity or product holding claims"
    },
    "customData": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Any key value pair"
        }
      },
      "description": "Custom data to be used in Feature HTML browser rule"
    }
  },
  "required": [
    "featureIds"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "featureResults": {
    "featureX": "blaize.transform.resource('...')"
  },
  "resources": {
    "uiComponents": {
      "...": "<h1>Example</h1>"
    }
  },
  "accessDetails": {
    "authenticated": false,
    "accessDecisions": {
      "...": false
    },
    "entitlements": {
      "...": {
        "usedInDecision": false,
        "decrementedInDecision": false
      }
    },
    "credits": {
      "...": {
        "usedInDecision": false,
        "decrementedInDecision": false,
        "totalCredits": 0,
        "remainingCredits": 0
      }
    },
    "meters": {
      "...": {
        "usedInDecision": false,
        "decrementedInDecision": false,
        "totalCredits": 0,
        "remainingCredits": 0
      }
    },
    "trialTrackingDetails": [
      {
        "entitlementId": "...",
        "entitlementType": "entitlement",
        "trackCreditsUsed": false,
        "trackCreditsRemaining": false,
        "creditsUsedKey": "",
        "creditsRemainingKey": ""
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "featureResults": {
      "type": "object",
      "properties": {
        "featureX": {
          "type": "string",
          "description": "Feature result transformations"
        }
      },
      "description": "Map of HTML Feature IDs and feature result transformations"
    },
    "resources": {
      "type": "object",
      "properties": {
        "forms": {
          "type": "object",
          "properties": {},
          "description": "Forms used in feature results"
        },
        "paymentForms": {
          "type": "object",
          "properties": {},
          "description": "Payment Forms used in feature results"
        },
        "uiComponents": {
          "type": "object",
          "properties": {
            "...": {
              "type": "string"
            }
          },
          "description": "UI Components used in feature results"
        },
        "hostedUiComponents": {
          "type": "object",
          "properties": {},
          "description": "Hosted UI Components used in feature results"
        },
        "componentTemplates": {
          "type": "object",
          "properties": {},
          "description": "Component Templates used in feature results"
        }
      },
      "description": "Map of transformation resources"
    },
    "accessDetails": {
      "type": "object",
      "properties": {
        "authenticated": {
          "type": "boolean",
          "description": "Is the session authenticated"
        },
        "accessDecisions": {
          "type": "object",
          "properties": {
            "...": {
              "type": "boolean",
              "description": "Whether the user has access or not"
            }
          },
          "description": "Map of access decisions for this feature"
        },
        "entitlements": {
          "type": "object",
          "properties": {
            "...": {
              "type": "object",
              "properties": {
                "usedInDecision": {
                  "type": "boolean"
                },
                "decrementedInDecision": {
                  "type": "boolean"
                }
              }
            }
          },
          "description": "Map of entitlement usage"
        },
        "credits": {
          "type": "object",
          "properties": {
            "...": {
              "type": "object",
              "properties": {
                "usedInDecision": {
                  "type": "boolean"
                },
                "decrementedInDecision": {
                  "type": "boolean"
                },
                "totalCredits": {
                  "type": "number"
                },
                "remainingCredits": {
                  "type": "number"
                }
              }
            }
          },
          "description": "Map of credit usage"
        },
        "meters": {
          "type": "object",
          "properties": {
            "...": {
              "type": "object",
              "properties": {
                "usedInDecision": {
                  "type": "boolean"
                },
                "decrementedInDecision": {
                  "type": "boolean"
                },
                "totalCredits": {
                  "type": "number"
                },
                "remainingCredits": {
                  "type": "number"
                }
              }
            }
          },
          "description": "Map of meter usage"
        },
        "trialTrackingDetails": {
          "type": "array",
          "description": "Array of trial tracking details"
        }
      },
      "description": "Feature access details"
    }
  }
}

OAuth Flow

Start

Start
POST/blaize/oauth/state

Start OAuth Flow

Example URI

POST /blaize/oauth/state
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "start_url": "http://blaize.io",
  "target_url": "http://blaize.io"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "start_url": {
      "type": "string"
    },
    "target_url": {
      "type": "string"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "State initialized"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

Google

Google
GET/blaize/oauth/google/callback{?code}

Callback for Google OAuth Flow.

Example URI

GET /blaize/oauth/google/callback?code=
URI Parameters
HideShow
code
string (required) 

OAuth code

Response  302
HideShow
Headers
Location: (string)
Set-Cookie: (string)

Facebook

Facebook
GET/blaize/oauth/facebook/callback{?code}

Callback for Google OAuth Flow.

Example URI

GET /blaize/oauth/facebook/callback?code=
URI Parameters
HideShow
code
string (required) 

OAuth code

Response  302
HideShow
Headers
Location: (string)
Set-Cookie: (string)

Linkedin

Linkedin
GET/blaize/oauth/linkedin/callback{?code}

Callback for Linkedin OAuth Flow.

Example URI

GET /blaize/oauth/linkedin/callback?code=
URI Parameters
HideShow
code
string (required) 

OAuth code

Response  302
HideShow
Headers
Location: (string)
Set-Cookie: (string)

Third-Party Authentication

Oauth2 Auth Code Flow

Start

Start
GET/zephr/oauth2

Start OAuth2 Authorization Code Flow. The resource owner will be authenticated and will be presented with the third party application access request.

Example URI

GET /zephr/oauth2
URI Parameters
HideShow
client_id
string (required) 

Zephr Site Oauth2 Client ID

response_type
string (required) 

Must be set to “code”

redirect_uri
string (required) 

Client’s redirection endpoint. Must be an absolute URI.

scope
string (required) 

The scope of the access request.

state
string (required) 

An opaque value used by the client to maintain state between the request and callback.

Response  302
HideShow
Headers
Location: (Error response to the redirect URI with error and state params)

Grant

Grant
POST/zephr/oauth2/grant

The resource owner will consent or deny the third party application access request, and Zephr will return an authorization code upon user’s consent.

Example URI

POST /zephr/oauth2/grant
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "client_id": "1234567890",
  "response_type": "code",
  "redirect_uri": "https://someUrl.com/callback",
  "scope": "user.account:read user.profile:read",
  "state": "abcdefghijklmnopqrstuvwsyz",
  "allow": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "client_id": {
      "type": "string",
      "description": "Zephr Site Oauth2 Client ID"
    },
    "response_type": {
      "type": "string",
      "description": "Must be set to `code`"
    },
    "redirect_uri": {
      "type": "string",
      "description": "Client's redirection endpoint. Must be an absolute URI"
    },
    "scope": {
      "type": "string",
      "description": "The scope of the access request. Supported scopes: user.account:read, user.profile:read and user.profile:update"
    },
    "state": {
      "type": "string",
      "description": "An opaque value used by the client to maintain state between the request and callback"
    },
    "allow": {
      "type": "boolean",
      "description": "Resource owner consent"
    }
  },
  "required": [
    "client_id",
    "response_type",
    "redirect_uri",
    "scope",
    "state",
    "allow"
  ]
}
Response  200
HideShow
Headers
Location: (Successful response to the redirect URI with code and state params)
Body
{
  "state": "Hello, world!",
  "code": "Hello, world!"
}
Schema
{
  "type": "object",
  "properties": {
    "state": {
      "type": "string",
      "description": "State (string)"
    },
    "code": {
      "type": "string",
      "description": "Authorization code (string)"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  401
HideShow
Body
{
  "state": "Hello, world!",
  "error": "Hello, world!"
}
Schema
{
  "type": "object",
  "properties": {
    "state": {
      "type": "string",
      "description": "State (string)"
    },
    "error": {
      "type": "string",
      "description": "Error type (string)"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Braintree Payments

Get Braintree Token

Get Braintree Token
GET/blaize/payment/braintree/token

Issue a Braintree client token for the current blaize session. This holds the user’s userId, and can be used to request a payment nonce.

Example URI

GET /blaize/payment/braintree/token
Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "eyJ2ZXmsaW5nQW...(lots more random-looking characters)...dyZWmVubW8iOiJvZmYifQ=="
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "token": {
      "type": "string"
    }
  }
}

Start Braintree Subscription

Start Braintree Subscription
POST/blaize/payment/braintree/subscribe

Use the payment info captured by the braintree drop-in UI and encoded in the payment nonce to create a braintree customer in with a recurring payment. When braintree responds successfully, the logged-in user will be temporarily granted all entitlements in the product’s associated bundle.

Example URI

POST /blaize/payment/braintree/subscribe
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "product_id": "premium-access-monthly-recurring",
  "payment_nonce": "eyJ2ZXmsaW5nQW...(lots more random-looking characters)...dyZWmVubW8iOiJvZmYifQ=="
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "Product Id/slug"
    },
    "payment_nonce": {
      "type": "string",
      "description": "Payment method nonce from Braintree drop-in UI"
    }
  },
  "required": [
    "product_id",
    "payment_nonce"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "grant_id": "33d576c7-d036-40e7-8141-8a91998a5c79"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "grant_id": {
      "type": "string",
      "description": "New grant of product bundle to user"
    }
  }
}

Subscription start callback

Callback
POST/blaize/payment/braintree/subscriptionChargedCallback/

To use subscriptions, braintree callback must be configured to point to this endpoint.

Example URI

POST /blaize/payment/braintree/subscriptionChargedCallback/
Request  with body
HideShow
Headers
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json

Cancel Braintree Subscription

Cancel Braintree Subscription
DELETE/blaize/payment/braintree/subscriptions/{subscriptionId}

Cancel a Braintree subscription by ID.

Example URI

DELETE /blaize/payment/braintree/subscriptions/subscriptionId
URI Parameters
HideShow
subscriptionId
string (required) 

Subscription ID

Response  200
Response  404
Response  409

Braintree Buy One-Off

Braintree Buy (one-off)
POST/blaize/payment/braintree/buy

Use the payment info captured by the braintree drop-in UI and encoded in the payment nonce to create a braintree customer and issue a one-off payment. When braintree responds successfully, the logged-in user will be granted all entitlements in the product’s associated bundle.

Example URI

POST /blaize/payment/braintree/buy
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "product_id": "lifetime-membership",
  "price_point_id": "gold-package",
  "payment_nonce": "eyJ2ZXmsaW5nQW...(lots more random-looking characters)...dyZWmVubW8iOiJvZmYifQ=="
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "Product Id/slug"
    },
    "price_point_id": {
      "type": "string",
      "description": "Price Point Id/slug"
    },
    "payment_nonce": {
      "type": "string",
      "description": "Payment method nonce from Braintree drop-in UI"
    }
  },
  "required": [
    "product_id",
    "price_point_id",
    "payment_nonce"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "grant_id": "aa583cb8-51d1-4bd9-9ec7-3a43796ef8e5"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "grant_id": {
      "type": "string",
      "description": "New grant of product bundle to user"
    }
  }
}

Stripe Payments

Get Stripe Public Key

Get Stripe Public Key
GET/blaize/payment/stripe/publicKey

Retrieve the public key for a tenant to process a payment

Example URI

GET /blaize/payment/stripe/publicKey
Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
pk_live_PFghBsstUo5FwUGcXBiNvIkY00X1YHtpnJ - String key

Start Stripe Subscription

Start Stripe Subscription
POST/blaize/payment/stripe/subscribe

Use the payment method info captured by the Stripe Elements UI to create a Stripe customer with a recurring payment. When Stripe responds successfully, the logged-in user will be temporarily granted all entitlements in the product’s associated bundle.

Example URI

POST /blaize/payment/stripe/subscribe
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "product_id": "premium-access-monthly-recurring",
  "payment_method": "pm_123456789"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "Product Id/slug"
    },
    "payment_method": {
      "type": "string",
      "description": "Payment method from Stripe Elements UI"
    }
  },
  "required": [
    "product_id",
    "payment_method"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "grant_id": "33d576c7-d036-40e7-8141-8a91998a5c79",
  "clientSecret": "src_client_secret_QfsM25CJ2uCMon72MiOmUNTj",
  "paymentIntentStatus": "requires_action | requires_payment_method"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "grant_id": {
      "type": "string",
      "description": "New grant of product bundle to user"
    },
    "clientSecret": {
      "type": "string",
      "description": "reference to Stripe payment required to process payment in front end"
    },
    "paymentIntentStatus": {
      "type": "string",
      "description": "status of the payment which may require further action"
    }
  }
}

Start Stripe Subscription Confirmation

Start Stripe Subscription Confirmation
POST/blaize/payment/stripe/subscription/confirmation

If a payment requires confirmation (3dSecure etc), the payment is confirmed in the front end,

Example URI

POST /blaize/payment/stripe/subscription/confirmation
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "subscriptionId": "sub_H8eIeMFwMawg6w"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "subscriptionId": {
      "type": "string"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "grant_id": "aa583cb8-51d1-4bd9-9ec7-3a43796ef8e5"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "grant_id": {
      "type": "string",
      "description": "New grant of product bundle to user"
    }
  }
}

Stripe Buy

Stripe Buy
POST/blaize/payment/stripe/buy

Uses the payment method collected by Stripe Elements to create a one off payment

Example URI

POST /blaize/payment/stripe/buy
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "product_id": "lifetime-membership",
  "price_point_id": "gold-package",
  "payment_method": "pm_123456789",
  "payment_intent_id": "pi_1GYZYWLgUJT2XNPAYQMomeqf"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "Product Id/slug"
    },
    "price_point_id": {
      "type": "string",
      "description": "Price Point Id/slug"
    },
    "payment_method": {
      "type": "string",
      "description": "Payment method from Stripe Elements UI"
    },
    "payment_intent_id": {
      "type": "string",
      "description": "PaymentIntent id returned after confirming a card payment"
    }
  },
  "required": [
    "product_id",
    "price_point_id",
    "payment_method"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "grant_id": "aa583cb8-51d1-4bd9-9ec7-3a43796ef8e5",
  "client_secret": "src_client_secret_QfsM25CJ2uCMon72MiOmUNTj`",
  "payment_intent_id": "pi_1GYZYWLgUJT2XNPAYQMomeqf"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "grant_id": {
      "type": "string",
      "description": "New grant of product bundle to user"
    },
    "client_secret": {
      "type": "string",
      "description": "reference to Stripe payment required to process payment in front end"
    },
    "payment_intent_id": {
      "type": "string",
      "description": "reference to the payment intent if payment requires confirmation"
    }
  }
}

WebHook

WebHook
POST/blaize/payment/stripe/subscriptionChargedCallback

To use subscriptions, Stripe Webhooks for invoice.payment_succeeded must be configured to point to this endpoint.

Example URI

POST /blaize/payment/stripe/subscriptionChargedCallback
Request  with body
HideShow
Headers
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json

Web Analytics

Get Datalayer

Get Datalayer
GET/blaize/datalayer

Get the datalayer object for the current session. All fields configured in the admin console will be resolved against the current session and returned

Example URI

GET /blaize/datalayer
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "dataLayer": [
    "[ {key1: value1}, {key2: value2} ]"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "dataLayer": {
      "type": "array",
      "description": "Resolved datalayer fields. Any fields that cannot be resolved will be present as fieldKey: null"
    }
  }
}

Generated by aglio on 15 Jan 2021