PactSafe

The PactSafe Developer Hub

Welcome to the PactSafe developer hub. You'll find comprehensive guides and documentation to help you start working with PactSafe as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Guides
Suggest Edits

Introduction

 

Welcome to PactSafe's Reference Documentation!

Here you'll find all the details you need to authenticate into our REST API, work in the details of our JavaScript Library, get a signature through our REST API, and understand the inner workings of our entire platform. Questions? Give us a shout.

Suggest Edits

Reference Overview

 

Hi there! Welcome to PactSafe's Developer Portal. We have a rich set of developer tools to help you easily integrate our legal system of record into your own apps.

We have 3 options for integration into your app that are all really easy to get plugged into:

Our JavaScript Library
Our Activity API
Our REST API

Our JavaScript Library

What is it?

The JavaScript library is designed to be as seamless and straightforward as possible to get PactSafe integrated, to start tracking who accepted important legal terms, and get back to innovating!

When should I use it?

You should be using our JavaScript library when you're plugging us into your website and web app. This would include ecommerce, your SaaS app, and more.

Where do I learn more?

Our Activity API

What is it?

Our Activity API is a legal microservice located at https://pactsafe.io that was built from the ground up to support the functionality behind our JavaScript library. It has 3 calls:

  1. latest returns a JSON object set of Contract IDs and boolean true/false values based on whether or not a signer has accepted the latest versions of a Group of Contracts.
  2. retrieve returns a JSON object set of Contract IDs and Version IDs to tell you which versions your signer has accepted.
  3. send will send us Contract IDs and Version IDs (as well as signer information and site Access ID) to track who's accepted what.

When should I use it?

Generally, customers will use our Activity API directly when you have a strong preference of not using JavaScript on your site, or you have a specific need to retrieve information on a user outside the context of a form on a page.

For example, if you have a persistent session in your web app you can call the following to determine whether or not to show a clickwrap agreement to a user:

GET https://pactsafe.io/latest?sig=sample@pactsafe.com&sid=ACCESS_ID&gkey=register-clickwrap

That call would return:

{"53":false,"316":false}

Where do I learn more?

Read up more on our Activity API here.

Our REST API

What is it?

Our REST API is a comprehensive set of APIs to connect to PactSafe for things like creating or versioning contracts, updating user information, sending contracts manually, and more.

When should I use it?

Our entire user interface is built on top of our REST API, so any function besides the simple latest, retrieve, and send calls of our Activity API will require our REST API.

Here are some examples for when you'd want to use our API:

  • You need to retrieve the content of a Contract stored in PactSafe.
  • You want to send a Contract to an individual for electronic signature.
  • You want to retrieve or update metadata about a contract like tags, name, or description.
  • You want to update a user's login details.
  • You want to retrieve detailed activity for a signer.

Where do I learn more?

Check out our REST API docs for more information. There are a lot of amazing resources to help you get started–including sample code, the API explorer, and more.

Who is PactSafe? PactSafe is a secure contract management platform, the world's fastest electronic signature, and contract analytics solution for business contracts, web and mobile apps, and other contracts that are executed online with your customers. The Vault Developer Tooklit provides you tools to plug in to your websites or mobile apps to help your business unify signatures across all your contracts.

The rest API exposes CRUD operations on all of the core PactSafe resources. We follow conventional RESt methods and protocols using POST (create), GET (retrieve), PATCH (update), and DELETE (delete).

All data is sent and received as JSON, and all requests require an OAuth Access Token for authorization. An OAuth Access Token can be created for your user bycreating one in your account.

Suggest Edits

Setting up the JavaScript Snippet

 

This reference documents the JavaScript Snippet used to include the PactSafe Library on a website.

Note: This snippet includes the option to include a backup copy of ps.min.js on your own server or one you specify should our snippet fail to load on the page. If our snippet does not load successfully after 4 seconds (notice the configurable timeout in the last parameter), then it will load the backup. Notice the cloudfront.net URL which you can replace with ps.min.js hosted on your own servers.

Minified

(function(w,d,s,c,f,n,t,g,a,b,l){w['PactSafeObject']=n;w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)},w[n].on=function(){(w[n].e=w[n].e||[]).push(arguments)},w[n].once=function(){(w[n].eo=w[n].eo||[]).push(arguments)},w[n].off=function(){(w[n].o=w[n].o||[]).push(arguments)},w[n].t=1*new Date(),w[n].l=0;a=d.createElement(s);b=d.getElementsByTagName(s)[0];a.async=1;a.src=c;a.onload=a.onreadystatechange=function(){w[n].l=1};a.onerror=a.onabort=function(){w[n].l=0};b.parentNode.insertBefore(a,b);setTimeout(function(){if(!w[n].l&&!w[n].loaded){w[n].error=1;a=d.createElement(s);a.async=1;a.src=f;a.onload=a.onreadystatechange=function(){w[n].l=1};a.onerror=a.onabort=function(){w[n].l=0};b.parentNode.insertBefore(a,b);l=function(u,e){try{e=d.createElement('img');e.src='https://d3r8bdci515tjv.cloudfront.net/error.gif?t='+w[n].t+'&u='+encodeURIComponent(u);d.getElementsByTagName('body')[0].appendChild(e)}catch(x){}};l(c);setTimeout(function(){if(!w[n].l&&!w[n].loaded){w[n].error=1;if(g&&'function'==typeof g){g.call(this);}l(f)}},t)}},t)})(window,document,'script','//vault.pactsafe.io/ps.min.js','//d3l1mqnl5xpsuc.cloudfront.net/ps.min.js','_ps',4000);

_ps('create', '25b2b173-632a-4227-9877-31d2109d8c98');

Unminified

  (function(w, d, s, c, f, n, t, g, a, b, l) {
    // Defines the global _ps object and initializes the _ps() function
    // that will queue commands until the PactSafe Library is ready.
    w['PactSafeObject'] = n;
    w[n] = w[n] || function() {
      (w[n].q = w[n].q || []).push(arguments)
    },

    // Defines the event functions for the global _ps object.
    w[n].on = function() {
      (w[n].e = w[n].e || []).push(arguments)
    },
    w[n].once = function() {
      (w[n].eo = w[n].eo || []).push(arguments)
    },
    w[n].off = function() {
      (w[n].o = w[n].o || []).push(arguments)
    },

    // Marks the time that the script is inserted.
    w[n].t = 1 * new Date(),
    w[n].l = 0;

    // Inserts a new script element to load the PactSafe Library JS file (ps.js).
    a = d.createElement(s);
    b = d.getElementsByTagName(s)[0];
    a.async = 1;
    a.src = c;

    // Marks that the script has started loading or failed to load.
    a.onload = a.onreadystatechange = function() { w[n].l = 1 };
    a.onerror = a.onabort = function() { w[n].l = 0 };
    b.parentNode.insertBefore(a, b);

    // Retry loading the script from a fallback location after 4 seconds.
    setTimeout(function() {
      if (!w[n].l && !w[n].loaded) {
        w[n].error = 1;
        a = d.createElement(s);
        a.async = 1;
        a.src = f;
        a.onload = a.onreadystatechange = function() { w[n].l = 1 };
        a.onerror = a.onabort = function() { w[n].l = 0 };
        b.parentNode.insertBefore(a, b);

        // Log the loading error via beacon.
        l = function(u, e) {
          try {
            e = d.createElement('img');
            e.src = 'https://d3r8bdci515tjv.cloudfront.net/error.gif?t=' + w[n].t + '&u=' + encodeURIComponent(u);
            d.getElementsByTagName('body')[0].appendChild(e);
          }
          catch(x) {}
        };
        l(c);

        // Call the optional error callback function after a second failed attempt.
        setTimeout(function() {
          if (!w[n].l && !w[n].loaded) {
            w[n].error = 1;
            if (g && 'function' == typeof g) {
              g.call(this);
            }
            l(f);
          }
        }, t);
      }
    }, t);
  })(window, document, 'script', '//vault.pactsafe.io/ps.min.js', '//d3l1mqnl5xpsuc.cloudfront.net/ps.min.js', '_ps', 4000, function optionalErrorCallback() { alert('Unable to load the JS Library.') });

// Creates a Site object with the default configuration.
_ps('create', '25b2b173-632a-4227-9877-31d2109d8c98');
Suggest Edits

Global_ps Object

 

This reference documents the properties and methods available on the global _ps object, and details on using the async queue.

Properties

_ps.Sites Object <String, Site>

An object used internally by _ps to store and reference all of the Site objects. Rather than accessing it directly, you should use one of the methods below, such as getByName() or remove().

_ps.loaded Boolean

A boolean flag indicating if ps.js has finished loading and is ready to use.

Methods

create

Creates a new Site object.

_ps.create(access_id, [name], [options]);

Arguments

NAME REQUIRED TYPE DESCRIPTION
access_id True String The unique access_id assigned to your PactSafe Site, which can be found on the Site Settings page within PactSafe.
name False String A name to assign to the Site object. This property is optional for the initial Site, and will default to 's0', but a name must be provided for any additional Sites.
options False Object An object containing properties to set on the Site.

Returns

Site The created Site object.

Examples

// Creates a Site with the default configuration.
_ps.create('0207a846-d9bf-4b13-8430-1344e86ff7b1');
// Creates a Site named "pactsafe".
_ps.create('0207a846-d9bf-4b13-8430-1344e86ff7b1', 'pactsafe');
// Creates a Site named "pactsafe", enables localization
// and sets the signer_id to "john@pactsafe.com".
_ps.create('0207a846-d9bf-4b13-8430-1344e86ff7b1', 'pactsafe', {
  localized: true,
  signer_id: 'john@pactsafe.com'
});
// Creates a Site with the default name and disables sending.
_ps.create('0207a846-d9bf-4b13-8430-1344e86ff7b1', null, {
  disable_sending: true
});

remove

Removes a Site object by name.

_ps.remove(name);

Arguments

NAME REQUIRED TYPE DESCRIPTION
name True String The name of the Site to remove.

Returns

No Return Value

Examples

// Removes the default Site.
_ps.remove('s0');
// Removes a Site named "pactsafe".
_ps.remove('pactsafe');

getByName

Returns a Site object by name.

_ps.getByName(name);

Arguments

NAME REQUIRED TYPE DESCRIPTION
name True String The name of the Site to return.

Returns

Site The Site object.

Examples

// Returns a Site that was given the default name.
var site = _ps.getByName('s0');

getAll

Returns all of the Site objects that have been created.

_ps.getAll();

Arguments

No Arguments

Returns

Array<Site> An array containing all of the Site objects.

Examples

// Returns all Sites that have been created.
var sites = _ps.getAll();

getByKey

Returns a Group object by key.

_ps.getByKey(key);

Arguments

NAME REQUIRED TYPE DESCRIPTION
key True String The key of the Group to return.

Returns

BrowsewrapGroup or ClickwrapGroup The Group object.

Examples

// Returns a Group with the key "login-contracts".
var group = _ps.getByKey('login-contracts');

getAllGroups

Returns all of the Group objects that have been loaded.

_ps.getAllGroups();

Arguments

No Arguments

Returns

Array<BrowsewrapGroup or ClickwrapGroup> An array containing all of the Group objects.

Examples

// Returns all Groups that have been loaded in any Site.
var groups = _ps.getAllGroups();

Event Methods

See the Events reference for a list of available events.

on

Listens for an event to be triggered.

_ps.on(event, callback);

Arguments

NAME REQUIRED TYPE DESCRIPTION
event True String The name of the event to listen for.
callback True Function The callback function to execute when the event is triggered. The arguments that are passed to the function vary between events.

Returns

No Return Value

Examples

// Listens for a Group to be initialized.
_ps.on('initialized', function(key, group) {
  console.log('Group ' + key + ' has been initialized.');
});
// Toggles a form submit button when a Group
// is either validated or invalidated.
_ps.on('valid', function(parameters, group) {
  $('#submit-button').prop('disabled', false);
});
_ps.on('invalid', function(parameters, group) {
  $('#submit-button').prop('disabled', true);
});
// Logs all events to the browser's console.
_ps.on('all', function() {
  console.log(arguments);
});

once

Listens for an event to be triggered once. The event listener is then removed.

_ps.once(event, callback);

Arguments

NAME REQUIRED TYPE DESCRIPTION
event True String The name of the event to listen for.
callback True Function The callback function to execute once the event is triggered. The arguments that are passed to the function vary between events.

Returns

No Return Value

Examples

// Submits the form once the contracts have been accepted.
_ps.once('valid', function(parameters, group) {
  $('#login-form').submit();
});

off

Removes an event listener.

_ps.off([event], [callback]);

Arguments

NAME REQUIRED TYPE DESCRIPTION
event False String The name of the event to remove the listener or listeners from. If blank, all event listeners will be removed from the _ps object.
callback False Function The callback function to remove. If blank, all listeners for the provided event will be removed from the _ps object.

Returns

No Return Value

Examples

// Removes a logging handler that was attached to 'error' events.
_ps.off('error', logger);
// Removes all 'sent' event listeners.
_ps.off('sent');
// Removes all event listeners.
_ps.off();

The Async Queue

_ps()

The async queue is created by the snippet and available for use even before ps.js has finished downloading. The _ps object itself serves as the async command queue function.

Commands can be used to call any method on a Site or Group object asynchronously, forwarding all arguments directly to the method. The ps() function accepts a variety of command formats, which are detailed below.

_ps([siteName.][groupKey:]method, [arg1, arg2, ..., argN]);
_ps([siteName.][groupKey:]method, [parameters]);
_ps(callback);

Arguments

--- NAME REQUIRED TYPE DESCRIPTION
method True String The name of the method to invoke on a Site or Group object. To target methods on the default Site, just provide the name of the method. If you have multiple Sites, you will need to prepend the Site's name to the method, separated by a .. To target a Group method, prepend the Group's key, separated by a :.
Option 1 arg1, arg2, ..., argN Conditional Any The in-line arguments to pass to the method.
Option 2 parameters Conditional Object A single object containing parameter name and value pairs. This format is supported by set, send and retrieve commands.
Option 3 callback True Function A callback function to execute. All commands in the queue are executed in order, so a callback function can be used to determine when the _ps object is ready, or when the previous set of commands have been run.

Returns

No Return Value

Examples

// Creates a Site.
_ps('create', '0207a846-d9bf-4b13-8430-1344e86ff7b1');
// Sends an "agreed" action from the default Site.
_ps('send', 'agreed', [ 10, 14 ], [ '5589bf606e7b9c1b1deef447', '5589bf606e7b9c1b1deef450' ], 33);
// Sends an "agreed" action from a Site named "pactsafe".
_ps('pactsafe.send', 'agreed', [ 10, 14 ], [ '5589bf606e7b9c1b1deef447', '5589bf606e7b9c1b1deef450' ], 33);
// Sends an "agreed" action with a parameters
// object and an event callback.
_ps('send', 'agreed', {
  contracts: [ 10, 14 ],
  versions: [ '5589bf606e7b9c1b1deef447', '5589bf606e7b9c1b1deef450' ],
  group: 33
  event_callback: function() {
    alert('Action sent.');
  }
});
// Sets the "signer_id" parameter to "john@pactsafe.com".
_ps('set', 'signer_id', 'john@pactsafe.com');
// Loads a Group with the key "login-contracts".
_ps('load', 'login-contracts');
// Sends an "agreed" action for a Group
// with the key "login-contracts".
_ps('login-contracts:send', 'agreed');
// Adds a callback function to the queue.
_ps(function() {
  alert('All commands have been executed.');
});
Suggest Edits

Site Object

 

This reference documents the properties and methods available on the Site object.

Properties

Site.parameters ParameterStore

A DataObject used by a Site to store its properties, parameters, and various data gathered about the browsing session. The values stored in parameters are appended to the payload of every request sent to the Action API, where they're saved as metadata on the action.

Site.groups GroupStore

An object used internally by a Site to store and reference all of the Group objects loaded within that Site. The GroupStore maintains which Groups have been loaded, which have been initialized, and any configuration options passed to the load command.

Site.tasks TaskStore

A chain of functions that every send and retrieve command is passed through in order to validate, build and send a request to the Action API. Each of the tasks is described in the table below.

Note: If a validation task fails, the command will be aborted and a 'ps:error' DOM event will be triggered, identifying which function failed.

Tasks

_ NAME ABORTS DESCRIPTION
1 optOutTask True Validates that the visitor has not opted-out of tracking.
2 previewTask True Validates that the browser is not in a preview or preload state.
3 checkProtocolTask True Validates that the protocol is either HTTP or HTTPS.
4 requiredParametersTask True Validates that all required parameters are present. The access_id parameter is always required, and signer_id is required for all actions except 'visited' and 'displayed'.
5 checkStorageTask True Validates that a uuid for the signer has been stored in a first-party cookie.
6 rateLimitTask True Enforces a limit of 1,000 requests per session, and throttles excessive request rate.
7 buildActionTask False Forms a singe URL-encoded string for the request payload by combining all of the Site's parameters with any override values that were passed into the send command. Parameter names are substituted with their shortened code to save bytes.
8 sendActionTask False Sends the payload generated by the buildActionTask to the Action API. Browser compatibility and the length of the payload will determine the transport type of the request: 'beacon', 'image' or 'xhr'.

Methods

get

Returns the value of a parameter or property stored on the Site.

site.get(parameter);

Arguments

_ NAME TYPE DESCRIPTION
parameter True String The name of the parameter to return.

Returns

String, Number, Boolean, Object, etc. The value of the parameter or property, or undefined if the parameter isn't set.

Examples

// Returns the "name" property.
var val = site.get('name');  // 's0'
// Returns the "signer_id" parameter.
var val = site.get('signer_id');  // 'john@pactsafe.com'
// Returns undefined if the parameter hasn't been set.
var val = site.get('event_callback');  // undefined

set

Sets the value of one or more parameters on the Site. Accepts either a single parameter name and value, or an object of multiple parameter name and value pairs to set.

Note: This method only applies to parameters. All properties must be set when the Site object is created.

site.set(parameter, value);
site.set(parameters);

Arguments

_ NAME REQUIRED TYPE DESCRIPTION
Option 1 parameter True String The name of the parameter to set.
value True String, Number, Object, Function, etc. The value of the parameter to set.
Option 2 parameters True Object An object containing one or more parameter name and value pairs to set.

Returns

No Return Value

Examples

// Sets the "signer_id" parameter.
site.set('signer_id', 'john@pactsafe.com');
// Unsets the "signer_id" parameter.
site.set('signer_id', null);
// Sets the "event_callback" parameter.
site.set('event_callback', function(err) {
  if (err) console.error(err);
});
// Sets multiple parameters at once.
site.set({ localized: true, signer_id: 'john@pactsafe.com', event_callback: submitForm });
// Cannot update Site properties such as "name".
site.get('name');  // 'p0'
site.set('name', 'pactsafe');
site.get('name');  // 'p0'

getByKey

Returns a Group object by key.

Note: Because Groups are loaded asynchronously, this method should only be used when you are certain the Group has already been loaded and initialized. For example, within the handler of an 'initialized' event, or the callback of a load command.

site.getByKey(key);

Arguments

NAME REQUIRED TYPE DESCRIPTION
key True String The key of the Group to return.

Returns

BrowsewrapGroup or ClickwrapGroup The initialized Group object.

Examples

// Returns a Group with the key "login-contracts".
var group = site.getByKey('login-contracts');
// Loads a Group with the key "login-contracts".
site.load('login-contracts');
// Waits to assign the Group to a local variable until it's actually
// needed for form validation within the "click" event handler.
$('#submit-login').on('click', function(evt) {
  var group = site.getByKey('login-contracts');
  if (group && group.block()) {
    alert(group.get('alert_message'));
    return false;
  }
});
// Waits for an "initialized" event on the Document object
// before assigning the Group to a variable.
var group;
$(document).on('initialized', function(evt) {
  group = site.getByKey('login-contracts');
});
// Uses the command queue to load a Group.
_ps('load', 'login-contracts');

Mistakes to Avoid

// Loads the Group and immediately assigns it to a local variable.
// The async "load" command hasn't finished, so "group" is undefined.
_ps('load', 'login-contracts');
var group = site.getByKey('login-contracts');  // undefined

getAllGroups

Returns all of the Group objects that have been loaded by the Site.

site.getAllGroups();

Arguments

No Arguments

Returns

Array<BrowsewrapGroup or ClickwrapGroup> An array containing all of the initialized Group objects.

Examples

// Returns all Groups that have been loaded and initialized.
var groups = site.getAllGroups();

send

Tracks an action by sending a request to the Action API.

Note: Any parameter values passed into the send method are treated as temporary overrides. They apply only to the current action and leave the Site's existing parameters unchanged.

site.send(event_type, [param1, param2, ..., paramN]);
site.send(event_type, [parameters]);

Arguments

_ NAME REQUIRED TYPE DESCRIPTION
event_type True String The type of the action being sent. Supported values include: 'agreed', 'disagreed', 'displayed', 'visited' and 'updated'.
Option 1 param1, param2, ..., paramN Conditional Any Parameter values that can be supplied as in-line arguments for convenience. The parameter that corresponds to each argument position varies based on the event_type of the send.
Option 2 parameters Conditional Object A single object containing parameter name and value pairs to use for this send only.

Returns

No Return Value

Examples

// Sends an "agreed" action with in-line parameters
// for "contracts", "versions" and "group".
site.send('agreed', [ 10, 14 ], [ '5589bf606e7b9c1b1deef447', '5589bf606e7b9c1b1deef450' ], 33);
// Sends an "agreed" action with a parameters object.
site.send('agreed', {
  contracts: [ 10, 14 ],
  versions: [ '5589bf606e7b9c1b1deef447', '5589bf606e7b9c1b1deef450' ],
  group: 33
});
// Sends an "updated" action.
site.send('updated', {
  signer_id: 'john@pactsafe.com',
  custom_data: { first_name: 'John', gender: 'male' }
});

retrieve

Retrieves the signer's latest acceptance data from the Action API.

Note: This method requires that the Site's signer_id parameter is set.

site.retrieve(contracts, [event_callback]);

Arguments

NAME REQUIRED TYPE DESCRIPTION
contracts True Array<Number> An array of contract ids to query for the signer.
event_callback False Function A callback function to execute once the request is complete. The function receives four arguments: err, responseJSON, xhr and context.

Returns

No Return Value

Examples

// Sets the "signer_id" to "john@pactsafe.com".
site.set('signer_id', 'john@pactsafe.com');
// Retrieves the latest version of contracts
// 10 and 14 that the signer has accepted.
site.retrieve([ 10, 14 ], function(err, data, xhr, site) {
  if (err) console.error(err);
  else console.log(data);  // { '10': '5589bf606e7b9c1b1deef447', '14': '5589bf606e7b9c1b1deef448' }
});

load

Registers a Group object on the Site, and inserts a new <script> element on the page to load the Group's published group.js file. The group.js file contains the Group's configuration, HTML content, and initialize command.

Note: The Group object will not be available until its group.js file finishes loading and the initialize command has been executed. Since this occurs asynchronously, any code that needs to reference the Group should be contained in a callback function.

site.load(key, [selector], [event_callback]);
site.load(key, [options], [event_callback]);
site.load(key, [event_callback]);

Arguments

_ NAME REQUIRED TYPE DESCRIPTION
key True String The key of the Group to load.
Option 1 selector False String The id attribute of an HTML element where the Group's content will be injected.
Option 2 optionsFalse Object Configuration options and parameters to set on the Group object. These will override options contained in the group.js file.
event_callback False Function A callback function to execute once the Group has been loaded and initialized. The function receives two arguments: err and group.

Returns

No Return Value

Examples

// Loads a Group with the key "login-contracts".
site.load('login-contracts');
// Loads a Group with the key "login-contracts"
// and provides the selector "container".
site.load('login-contracts', 'container');
// Loads a Group with additional configuration options
// and an event_callback function.
site.load('login-contracts', { selector: 'container', allow_disagreed: true }, function(err, group) {
  if (err) console.error(err);
  else console.log('Group ' + group.get('key') + ' initialized.');
});
// Loads a Group with an event_callback function,
// but no selector or options argument.
site.load('login-contracts', function(err, group) {
  if (err) console.error(err);
  else console.log('Group ' + group.get('key') + ' initialized.');
});
// Loads a Group using the command queue,
// and provides an event_callback function.
_ps('load', 'login-contracts', 'container', function(err, group) {
  if (err) console.error(err);
  else console.log('Group ' + group.get('key') + ' initialized.');
});

initialize

Creates a new instance of a BrowsewrapGroup or ClickwrapGroup from a configuration object.

Note: This command is already included at the bottom of every group.js file, and should rarely need to be called manually.

site.initialize(key, type, options);

Arguments

NAME REQUIRED TYPE DESCRIPTION
key True String The key of the Group to initialize.
type True String The type of Group object to initialize, 'group' or 'badge'.
options True Object The configuration options and parameters to set on the Group object.

Returns

No Return Value

Examples

// Initializes a BrowsewrapGroup with the key "legal-badge".
site.initialize('legal-badge', 'badge', {
  key: 'ps-app-browsewrap',
  type: 'badge',
  group: 32,
  contracts: [ 10, 14 ],
  versions: [ '5589bf606e7b9c1b1deef447', '5589bf606e7b9c1b1deef450' ],
  target_selector: 'footer-legal-terms',
  style: 'floating',
  position: 'left',
  class_name: 'ps-browsewrap-badge',
  stylesheet: '<style scoped>#ps-badge-ps-app-browsewrap.ps-browsewrap-wrapper { ... }</style>',
  legal_center_url: 'https://vault.pactsafe.io/s/0207a846-d9bf-4b13-8430-1344e86ff7b1/legal.html?g=32',
  open_legal_center: true,
  always_visible: false,
  badge_text: 'Legal Terms'
});

render

Invokes the render() method on every Group that has been loaded by the Site.

site.render([force]);

Arguments

NAME REQUIRED TYPE DESCRIPTION
force False Boolean If true, previously rendered Groups will be forced to re-render. By default, they will be skipped.

Returns

No Return Value

Examples

// Renders any Group that hasn't been rendered yet.
site.render();
// Renders any Group that hasn't been rendered yet, and
// re-renders Groups that have already been rendered.
site.render(true);
Suggest Edits

Triggered Events

 

Real-time events to interact with your own app

This reference documents the events that are triggered on the global _ps object. Events are triggered based on interactions with the PactSafe JavaScript library. Examples include when a user clicks all checkboxes (_ps.on('valid')), when acceptance is sent to PactSafe (_ps.on('sent')), or when an error occurs (_ps.on('error')). These callbacks are used to manage interactions so that the experience of plugging PactSafe into your own apps does not disrupt your own flows.

Events

all

A special event that is triggered when any other event is triggered. The name of the original event is always the first argument passed to the callback function. The rest of the arguments will match whatever arguments were passed to the original event's callback function.

_ps.on('all', callback);

Callback Arguments

NAME TYPE DESCRIPTION
event String The name of the event that was triggered.
[arguments] Any All of the arguments that were passed to the original event.

ready

Triggered once ps.js has been loaded and the _ps object is setup.

_ps.on('ready', callback);

Callback Arguments

No Arguments

create

Triggered when a Site object is created.

_ps.on('create', callback);

Callback Arguments

NAME TYPE DESCRIPTION
context Site The created Site object.

sent

Triggered when a send command has been completed successfully.

_ps.on('sent', callback);

Callback Arguments

NAME TYPE DESCRIPTION
event_type String The type of action that was sent. Supported values include: 'agreed', 'disagreed', 'displayed', 'visited' and 'updated'.
parameters Object An object containing the contract and group details that were sent. Contains three parameters: 'contracts', 'versions' and 'group'.
context Site, BrowsewrapGroup or ClickwrapGroup The Site or Group object that initiated the send command.
payload String The URL-encoded payload that would have been sent to the Action API. This argument is only present when the Site's disable_sending property is set to true.

retrieved

Triggered when a retrieve command has been completed successfully.

_ps.on('retrieved', callback);

Callback Arguments

NAME TYPE DESCRIPTION
responseJSON Object The JSON response body returned by the XMLHttpRequest.
xhr XMLHttpRequest The raw XMLHttpRequest that was sent to the Action API.
context Site, BrowsewrapGroup or ClickwrapGroup The Site or Group object that initiated the retrieve command.

set

Triggered when a parameter is set.

Note: This event will only be triggered for specific parameters. Supported parameters include: signer_id, signer_id_selector, form_selector, position and always_visible.

_ps.on('set', callback);

Callback Arguments

NAME TYPE DESCRIPTION
parameter String The name of the parameter that was set.
value String, Number, Object, Function, etc. The value that was set.
context Site, BrowsewrapGroup or ClickwrapGroup The Site or Group object on which the parameter was set.

set:parameter

Triggered when the named parameter is set.

Note: This event will only be triggered for specific parameters. Supported parameters include: signer_id, signer_id_selector, form_selector, position and always_visible.

_ps.on('set:[parameter]', callback);

Callback Arguments

NAME TYPE DESCRIPTION
value String, Number, Object, Function, etc. The value that was set.
context Site, BrowsewrapGroup or ClickwrapGroup The Site or Group object on which the parameter was set.

Examples

// Listens for the signer_id parameter to be set.
_ps.on('set:signer_id', function(value, context) {
  console.log(value);
});

initialized

Triggered when a Group object is initialized and ready to use.

_ps.on('initialized', callback);

Callback Arguments

NAME TYPE DESCRIPTION
key String The unique key of the Group object.
context BrowsewrapGroup or ClickwrapGroup The initialized Group object.

rendered

Triggered when a Group object has been rendered.

_ps.on('rendered', callback);

Callback Arguments

NAME TYPE DESCRIPTION
context BrowsewrapGroup or ClickwrapGroup The Group object that was rendered.

displayed

Triggered when a Group object displays a contract.

_ps.on('displayed', callback);

Callback Arguments

NAME TYPE DESCRIPTION
element HTMLElement The contract's HTMLElement that was displayed.
context BrowsewrapGroup or ClickwrapGroup The Group object that displayed the contract.

hidden

Triggered when a Group object hides a contract.

_ps.on('displayed', callback);

Callback Arguments

NAME TYPE DESCRIPTION
element HTMLElement The contract's HTMLElement that was hidden.
context BrowsewrapGroup or ClickwrapGroup The Group object that hid the contract.

valid

Triggered when all of the contracts in a Group have been accepted by a signer.

Note: If a Group's display_all parameter is set to true, this event will only be triggered when all contracts have been accepted and checked.

_ps.on('valid', callback);

Callback Arguments

NAME TYPE DESCRIPTION
parameters Object An object containing the contracts and versions that belong to the Group. Contains three parameters: 'contracts', 'versions' and 'group'.
context BrowsewrapGroup or ClickwrapGroup The Group object that was validated.

invalid

Triggered when all of the contracts in a Group are no longer accepted by a signer. This event will be triggered if a signer un-checks a contract on a valid Group.

_ps.on('invalid', callback);

Callback Arguments

NAME TYPE DESCRIPTION
parameters Object An object containing the contracts and versions that belong to the Group. Contains three parameters: 'contracts', 'versions' and 'group'.
context BrowsewrapGroup or ClickwrapGroup The Group object that was invalidated.

scrolled:contract

Triggered when "Force Scroll" has been enabled in your Group Settings and one of the contracts in a Group has been scrolled to the bottom of a "Scroll" or "Embedded" Group style/layout.

_ps.on('scrolled:contract', function(contractHTML, group){
  // you can output what is passed in this callback like so
  // this is called for EACH contract that the user reaches 
  // the bottom of...
  console.log(contractHTML);
  console.log(group);
  console.log(group.get("contracts"));
}););

Callback Arguments

NAME TYPE DESCRIPTION
contractHTML Object An object containing the HTML of the contract that has been scrolled to the bottom.
group ClickwrapGroup The Group object that was invalidated.

scrolled

Triggered when "Force Scroll" has been enabled in your Group Settings and all of the contracts in a Group have been scrolled to the bottom of within a "Scroll" or "Embedded" Group style/layout.

_ps.on('scrolled:contract', function(contractsElement, group){
  // you can output what is passed in this callback like so
  // this is called for EACH contract that the user reaches 
  // the bottom of...
  console.log(contractsElement);
  console.log(contractsElement.innerHTML);
  console.log(group);
  console.log(group.get("contracts"));
}););

Callback Arguments

NAME TYPE DESCRIPTION
contractsElement Object The element containing the entire container selector of the group.
group ClickwrapGroup The Group object that was invalidated.

error

Triggered when a send or retrieve command encounters an error before being sent.

_ps.on('error', callback);

Callback Arguments

NAME TYPE DESCRIPTION
message String A message describing why the error occurred.
event_type String The type of action that was being sent.
context Site, BrowsewrapGroup or ClickwrapGroup The Site or Group object that initiated the command.

Common use cases

Let's say you wanted to enable a button once a checkbox is checked:

_ps.on('valid', function(){
  console.log(arguments);
  $('#button').prop('disabled', false);
});
 

This reference documents each type of Action available to be sent.

Event Callback Function

event_callback

All send commands support an optional callback function that will be executed once the command is complete, successful or not.

The function can either be provided to an individual command as an argument, or it can be set as a Site's event_callback parameter, which will be used by every send command executed by the Site.

function(err, event_type, context, [payload]) { ... }

Callback Arguments

NAME TYPE DESCRIPTION
err String This argument will be null if the command was completed successfully. If the command encountered an error, this argument will contain a message describing the error.
event_type String The type of action that was sent. Supported values include: 'agreed', 'disagreed', 'displayed', 'visited' and 'updated'.
context Site, BrowsewrapGroup or ClickwrapGroup The Site or Group object that initiated the send command.
payload String This argument is only present when the Site's disable_sending property is set to true. It contains the URL-encoded payload that would have been sent to the Action API.

Event Types

agreed

Indicates that a signer has accepted a specific version of a contract.

Note: The signer_id must be set for this type.

send('agreed', contracts, versions, [group], [event_callback]);

Arguments

NAME REQUIRED TYPE DESCRIPTION
contracts True Array<Number> The id of each contract included in the action.
versions True Array<String> The id of each version included in the action. Ordering matters, as each id will be paired with its corresponding position in the contracts array.
group False Number The numeric id of the group containing the contracts.
event_callback False Function A callback function to execute once the command is complete.

disagreed

Indicates that a signer has disagreed to a previously accepted version of a contract.

Note: The signer_id must be set for this type.

send('disagreed', contracts, versions, [group], [event_callback]);

Arguments

NAME REQUIRED TYPE DESCRIPTION
contracts True Array<Number> The id of each contract included in the action.
versions True Array<String> The id of each version included in the action. Ordering matters, as each id will be paired with its corresponding position in the contracts array.
group False Number The numeric id of the group containing the contracts.
event_callback False Function A callback function to execute once the command is complete.

displayed

Indicates that a specific version of a contract was displayed on the page.

Note: The signer_id is not required for this type.

send('displayed', contracts, versions, [group], [event_callback]);

Arguments

NAME REQUIRED TYPE DESCRIPTION
contracts True Array<Number> The id of each contract included in the action.
versions True Array<String> The id of each version included in the action. Ordering matters, as each id will be paired with its corresponding position in the contracts array.
group False Number The numeric id of the group containing the contracts.
event_callback False Function A callback function to execute once the command is complete.

visited

Indicates that a group's legal center was visited.

Note: The signer_id is not required for this type.

send('visited', [contracts], [versions], group, [event_callback]);

Arguments

NAME REQUIRED TYPE DESCRIPTION
contracts False Array<Number> The id of each contract included in the action.
versions False Array<String> The id of each version included in the action. Ordering matters, as each id will be paired with its corresponding position in the contracts array.
group True Number The numeric id of the group containing the contracts.
event_callback False Function A callback function to execute once the command is complete.

updated

Saves additional name and value pairs to the signer's record.

Note: The signer_id and custom_data must be set for this type.

send('updated', parameters);

Arguments

NAME REQUIRED TYPE DESCRIPTION
parameters Conditional Object An object containing name and value pairs to send with the action. If the custom_data parameter hasn't already been set at the Site level, it should be passed as a property of the parameters argument.
Suggest Edits

ClickwrapGroup Object

 

This reference documents the properties and methods available on the ClickwrapGroup object.

Properties

ClickwrapGroup.parameters ParameterStore

A DataObject used by a ClickwrapGroup to store its properties and parameters. During initialization, the parameters object is populated with all of the Group's configuration and display options, as well as the latest id of each contract and version that are a part of the Group.

ClickwrapGroup.agreed ParameterStore

A DataObject that stores which contracts in the Group have been accepted by the signer, either previously or during this session.

ClickwrapGroup.checked ParameterStore

A DataObject that stores which contracts in the Group have had their checkbox manually checked by the signer.

ClickwrapGroup.rendered Boolean

A boolean flag indicating if the render() method has been executed successfully, injecting the Group's HTML content into the page.

ClickwrapGroup.inputInjected Boolean

A boolean flag indicating if the <input type="hidden" name="__ps-contracts" class="__ps-contracts"> element has been injected into the form. The value of this input element specifies whether all contracts in the Group have been accepted.

ClickwrapGroup.signerIdListening Boolean

A boolean flag indicating if the Group is listening for 'blur' and 'change' events on an input element, which contains the value for the signer_id parameter.

Methods

get

Returns the value of a parameter or property stored on the Group.

group.get(parameter);

Arguments

NAME REQUIRED TYPE DESCRIPTION
parameter True String The name of the parameter to return.

Returns

String, Number, Boolean, Object, etc. The value of the parameter or property, or undefined if the parameter isn't set.

Examples

// Returns the "key" property.
var val = group.get('key');  // 'login-contracts'
// Returns the "contracts" parameter, which contains
// the id of each contract included in this Group.
var contracts = group.get('contracts');  // [ 10, 14 ]

set

Sets the value of one or more parameters on the Group. Accepts either a single parameter name and value, or an object of multiple parameter name and value pairs to set.

Note: This method only applies to parameters. All properties must be set when the ClickwrapGroup object is created.

group.set(parameter, value);
group.set(parameters);

Arguments

_ NAME REQUIRED TYPE DESCRIPTION
Option 1 parameter True String The name of the parameter to set.
value True String, Number, Object, Function, etc. The value of the parameter to set.
Option 2 parameters True Object An object containing one or more parameter name and value pairs to set.

Returns

No Return Value

Examples

// Sets the "alert_message" parameter.
group.set('alert_message', 'Please accept all legal contracts.');

getAgreed

Returns the Group's contracts, versions and group parameters, filtered for accepted contracts only.

group.getAgreed();

Arguments

No Arguments

Returns

Object An object containing the Group's contracts, versions and group parameters.

Examples

// Returns "contracts", "versions" and "group".
var params = group.getAgreed();

// Only returns contracts that have been accepted:
// {
//   contracts: [ 10 ],
//   versions: [ '5589bf606e7b9c1b1deef447' ],
//   group: 33
// }

getChecked

Returns the Group's contracts, versions and group parameters, filtered to include checked contracts only.

group.getChecked(filter);

Arguments

NAME REQUIRED TYPE DESCRIPTION
filter False Boolean If true, only checked contracts that haven't been accepted will be returned.

Returns

Object An object containing the Group's contracts, versions and group parameters.

Examples

// Returns "contracts", "versions" and "group".
var params = group.getChecked();

// Only returns contracts that have been checked by the signer:
// {
//   contracts: [ 10 ],
//   versions: [ '5589bf606e7b9c1b1deef447' ],
//   group: 33
// }

send

Invokes a send command on the Site, with the contracts, versions and group parameters automatically populated with the Group's values.

group.send(event_type, [parameters]);

Arguments

NAME REQUIRED TYPE DESCRIPTION
event_type True String The type of the action being sent. Supported values include: 'agreed', 'disagreed', 'displayed', 'visited' and 'updated'.
parameters Conditional Object A single object containing parameter name and value pairs to use for this send only. The contracts, versions and group parameters are included by default.

Returns

No Return Value

Examples

// Sends an "agreed" action for the Group.
group.send('agreed');

// Automatically adds the Group's parameters to the command:
// {
//   contracts: [ 10, 14 ],
//   versions: [ '5589bf606e7b9c1b1deef447', '5589bf606e7b9c1b1deef450' ],
//   group: 33
// }

sendChecked

Sends an 'agreed' action for the Group's contracts that have been checked.

group.sendChecked();

Arguments

No Arguments

Returns

No Return Value

Examples

// Sends an "agreed" action for the Group.
group.sendChecked();

// Automatically adds the Group's checked contracts to the command:
// {
//   contracts: [ 10 ],
//   versions: [ '5589bf606e7b9c1b1deef447' ],
//   group: 33
// }

render

Injects the contract HTML into the page and sends a retrieve command if the signer_id parameter is set. Once rendered, either display() or displayAll() is called to show the contracts on the page.

group.render([force]);

Arguments

NAME REQUIRED TYPE DESCRIPTION
force False Boolean If true, the Group will be forced to re-render.

Returns

No Return Value

Examples

// Injects the Group's contract HTML into the DOM.
group.render();

displayRequired

Displays only the contracts that haven't been accepted by the signer.

group.displayRequired();

Arguments

No Arguments

Returns

No Return Value

Examples

// Displays the rendered contracts that need
// to be accepted by the signer.
group.displayRequired();

displayAll

Displays all contracts in the Group, even those that have previously been accepted by the signer.

Note: To invoke this method after render(), set the Group's display_all property to true.

group.displayAll();

Arguments

No Arguments

Returns

No Return Value

Examples

// Displays all of the rendered contracts.
group.displayAll();

hide

Hides one or more contracts on the page.

group.hide(contracts);

Arguments

NAME REQUIRED TYPE DESCRIPTION
contracts True Array<Number> The id of each contract to hide.

Returns

No Return Value

Examples

// Hides contracts 10 and 14 on the page.
group.hide([ 10, 14 ]);

hideAll

Hides all contracts in the Group.

group.hideAll();

Arguments

No Arguments

Returns

No Return Value

Examples

// Hides all of the Group's contracts on the page.
group.hideAll();

allChecked

Returns a boolean flag indicating if all contracts in the Group have been checked.

Note: This only factors in the state of the HTML checkbox, and does not consider whether or not 'agreed' actions have actually been sent to the Activity API.

group.allChecked();

Arguments

No Arguments

Returns

Boolean A flag indicating if every contract's checkbox is checked.

Examples

// Blocks form submission if any contracts are unchecked.
$('#submit-button').on('click', function(evt) {
  if (!group.allChecked()) {
    alert(group.get('alert_message'));
    return false;
  }
  else {
    group.send('agreed', {
      disable_sending: false,
      function(err) {
        if (err) handleError();
        else form.submit();
      }
    });
  }
});

block

Returns a boolean flag indicating if any contracts in the Group still need to be accepted.

Note: If the Group's display_all property is set to true, this method will determine if every contract is both accepted and checked.

group.block();

Arguments

No Arguments

Returns

Boolean A flag indicating if at least one contract still needs to be accepted.

Examples

// Blocks form submission if any contracts
// still need to be accepted.
$('#submit-button').on('click', function(evt) {
  if (group.block()) {
    alert(group.get('alert_message'));
    return false;
  }
  else form.submit();
});
Suggest Edits

BrowsewrapGroup Object

 

This reference documents the properties and methods available on the BrowsewrapGroup object.

Properties

BrowsewrapGroup.parameters ParameterStore

A DataObject used by a BrowsewrapGroup to store its properties and parameters. During initialization, the parameters object is populated with all of the Group's configuration and display options, as well as the latest id of each contract and version that are a part of the Group.

BrowsewrapGroup.rendered Boolean

A boolean flag indicating if the render() method has been executed successfully, injecting the Group's HTML content into the page.

BrowsewrapGroup.eventsAttached Boolean

A boolean flag indicating if the setupEvents() method has been executed successfully, attaching all of the event listeners used to update the badge's position. If the removeEvents() method is executed, this property will be set back to false.

Methods

get

Returns the value of a parameter or property stored on the Group.

group.get(parameter);

Arguments

NAME REQUIRED TYPE DESCRIPTION
parameter True String The name of the parameter to return.

Returns

String, Number, Boolean, Object, etc. The value of the parameter or property, or undefined if the parameter isn't set.

Examples

// Returns the "key" property.
var val = group.get('key');  // 'legal-badge'
// Returns the "contracts" parameter, which contains
// the id of each contract included in this Group.
var contracts = group.get('contracts');  // [ 10, 14 ]

set

Sets the value of one or more parameters on the Group. Accepts either a single parameter name and value, or an object of multiple parameter name and value pairs to set.

Note: This method only applies to parameters. All properties must be set when the BrowsewrapGroup object is created.

group.set(parameter, value);
group.set(parameters);

Arguments

_ NAME REQUIRED TYPE DESCRIPTION
Option 1 parameter True String The name of the parameter to set.
value True String, Number, Object, Function, etc. The value of the parameter to set.
Option 2 parameters True Object An object containing one or more parameter name and value pairs to set.

Returns

No Return Value

Examples

// Sets the "position" parameter.
group.set('position', 'right');
// Sets the "position" to "center", and
// makes the badge visible at all times.
group.set({ position: "center", always_visible: true });

send

Invokes a send command on the Site, with the contracts, versions and group parameters automatically populated with the Group's values.

group.send(event_type, [parameters]);

Arguments

NAME REQUIRED TYPE DESCRIPTION
event_type True String The type of the action being sent. Supported values include: 'agreed', 'disagreed', 'displayed', 'visited' and 'updated'.
parameters Conditional Object A single object containing parameter name and value pairs to use for this send only. The contracts, versions and group parameters are included by default.

Returns

No Return Value

Examples

// Sends a "visited" action for the Group.
group.send('visited');

// Automatically adds the Group's parameters to the command:
// {
//   contracts: [ 10, 14 ],
//   versions: [ '5589bf606e7b9c1b1deef447', '5589bf606e7b9c1b1deef450' ],
//   group: 32
// }

render

Injects the badge HTML into the page and runs setupEvents().

group.render([force]);

Arguments

NAME REQUIRED TYPE DESCRIPTION
force False Boolean If true, the Group will be forced to re-render.

Returns

No Return Value

Examples

// Renders the browsewrap badge on the page.
group.render();

openLegalCenter

Opens the Group's Legal Center page in a new tab. The URL is stored in the legal_center_url parameter.

group.openLegalCenter();

Arguments

No Arguments

Returns

No Return Value

Examples

// Opens the Group's Legal Center page.
group.openLegalCenter();

setupEvents

Attaches the badge_updater function to multiple events on the window object, including 'load', 'scroll' and 'resize'. This function is responsible for updating the badge's position on the page.

Note: This method will only run if the Group's eventsAttached property is false.

group.setupEvents();

Arguments

No Arguments

Returns

No Return Value

Examples

// Attaches badge_updater function to 'load', 'scroll' and 'resize' events.
group.setupEvents();

removeEvents

Clears all of the event listeners that were attached by setupEvents().

Note: This method will only run if the Group's eventsAttached property is true.

group.removeEvents();

Arguments

No Arguments

Returns

No Return Value

Examples

// Clears the 'load', 'scroll' and 'resize'
// listeners from the window object.
group.removeEvents();

forceUpdate

Forces the badge to update its position using the badge_updater function. This method can be used as an alternative to the event listeners.

group.forceUpdate();

Arguments

No Arguments

Returns

No Return Value

Examples

// Forces the badge to update its position.
group.forceUpdate();
Suggest Edits

ParameterStore Object

 

This reference documents the properties and methods available on the ParameterStore object.

Properties

ParameterStore.data DataObject

A DataObject used to store a set of parameters and their corresponding values.

Methods

get

Returns the value of a parameter using the getter function defined by the parameter definition.

parameters.get(parameter);

Arguments

NAME REQUIRED TYPE DESCRIPTION
parameter True String The name of the parameter to return.

Returns

String, Number, Boolean, Object, etc. The value of the parameter or property, or undefined if the parameter isn't set.

Examples

// Returns the "signer_id" parameter.
var val = parameters.get('signer_id');  // 'john@pactsafe.com'

set

Sets the value of one or more parameters, using the setter function defined by the parameter definition. Accepts either a single parameter name and value, or an object of multiple parameter name and value pairs to set.

parameters.set(parameter, value, override);
parameters.set(parameters, override);

Arguments

_ NAME REQUIRED TYPE DESCRIPTION
Option 1 parameter True String The name of the parameter to set.
value True String, Number, Object, Function, etc. The value of the parameter to set.
Option 2 parameters True Object An object containing one or more parameter name and value pairs to set.
`override False Boolean A flag indicating if the parameters should be set as temporary override values.

Returns

No Return Value

Examples

// Sets the "signer_id" parameter.
parameters.set('signer_id', 'john@pactsafe.com', false);
// Sets the "contracts" parameter as an override value.
parameters.set('contracts', [ 10, 14 ], true);
Suggest Edits

GroupStore Object

 

This reference documents the properties and methods available on the GroupStore object.

Properties

GroupStore.loaded DataObject

A DataObject used to store details about the load command.

GroupStore.initialized DataObject

A DataObject used to store the initialized Group object.

Methods

get

Returns a Group object by key from the initialized property.

groups.get(key);

Arguments

NAME REQUIRED TYPE DESCRIPTION
key True String The key of the Group to return.

Returns

GroupObject The initialized Group object.

Examples

// Returns a Group with the key "login-contracts".
var group = groups.get('login-contracts');

add

Initializes a new Group object and stores the object in the initialized property.

groups.add(site, key, type, options, callback);

Arguments

NAME REQUIRED TYPE DESCRIPTION
site True Site The Site object that the Group belongs to.
key True String The unique key of the Group.
type True String The type of Group object to initialize, 'group' or 'badge', or a constructor function.
options True Object The configuration options and parameters to set on the Group object.
callback False Function A callback function to execute once the Group has been initialized. The function receives two arguments: error and group.

Returns

No Return Value

Examples

// Initializes a ClickwrapGroup with the key "login-contracts".
groups.add(site, 'login-contracts', 'group', config, function(err, group) {
  if (err) console.error(err);
  else console.log('Group ' + group.get('key') + ' initialized.');
});

getLoading

Returns the value stored in the loaded property for the given key.

groups.getLoading(key);

Arguments

NAME REQUIRED TYPE DESCRIPTION
key True String The key of the Group to return.

Returns

String, Boolean, Object The value stored in the loaded property.

Examples

// Returns the details about the load command for "login-contracts".
var val = groups.getLoading('login-contracts');  // 'true'

setLoading

Sets the value for a given key on the loaded property.

groups.setLoading(key, value);

Arguments

NAME REQUIRED TYPE DESCRIPTION
key True String The key of the Group to return.
value True String, Boolean, Object Details about the load command.

Returns

No Return Value

Examples

// Sets the details about the load command for "login-contracts".
groups.setLoading('login-contracts', 'contracts-container');
Suggest Edits

DataObject

 

This reference documents the properties and methods available on the DataObject.

Properties

DataObject.keys Array<String>

An array of all the parameter names stored in the object.

DataObject.values Object

An object that holds the persistent name-value pairs stored in the object.

DataObject.overrides Object

An object that holds the temporary name-value pairs stored in the object.

Methods

get

Returns the value stored in the object at the given parameter name.
data.get(parameter);

Arguments

NAME REQUIRED TYPE DESCRIPTION
parameter True String The name of the parameter to return. If an override value exists, that value will be returned.

Returns

String, Number, Boolean, Object, etc. The value of the parameter or property, or undefined if the parameter isn't set.

Examples

// Returns the "key" parameter.
var val = data.get('key');  // 'login-contracts'

set

Sets the value of a parameter by name.

data.set(parameter, value, override);

Arguments

NAME REQUIRED TYPE DESCRIPTION
parameter True String The name of the parameter to set.
value True String, Number, Object, Function, etc. The value of the parameter to set.
override False Boolean A flag indicating if the parameter should be set as a temporary override value. Defaults to false.

Returns

No Return Value

Examples

// Sets the "signer_id" parameter.
data.set('signer_id', 'john@pactsafe.com', false);
// Sets the "contracts" parameter as an override value.
data.set('contracts', [ 10, 14 ], true);

map

Invokes a callback function for each name and value pair stored in the object.

data.map(callback);

Arguments

NAME REQUIRED TYPE DESCRIPTION
callback True Function The callback function to execute for each name and value pair. The function receives two arguments: name and value.

Returns

No Return Value

Examples

// Logs each name and value pair to the console.
data.map(function(name, value) {
  console.log(name + ': ' + value);
});
Suggest Edits

Check "Latest" Versions signed by a Signer

The purpose of the "Latest" call is so you can get a fast, real-time response to determine if your Signer has accepted the latest versions of Contracts in a Group or List of comma-separated IDs.

 

Query Auth

 Authentication is required for this endpoint.
gethttps://pactsafe.io/latest
curl --request GET \
  --url https://pactsafe.io/latest
var request = require("request");

var options = { method: 'GET', url: 'https://pactsafe.io/latest' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://pactsafe.io/latest")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://pactsafe.io/latest");

xhr.send(data);
import requests

url = "https://pactsafe.io/latest"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "282": true, 
  "1241": false
}

Query Params

sig
string

Signer ID. The unique identifier used to save your signer's signature. Can be email, mobile number, GUID, UUID, or any integer. Should be URL encoded.

gkey
string

Optional. The key for a group of Contracts that will be evaluated, with all the latest versions being accepted and returned as true or false.

gid
int32

Optional. The ID for a group of Contracts that will be evaluated, with all the latest versions being accepted and returned as true or false.

cid
string

Optional. A set of comma separated values requesting if a Signer has accepted the latest version of a set of Contract IDs.

tm
boolean

Optional. For a full-scale testing flow, you can enable test_mode when checking acceptance records for a Signer in this call, too. To be used when sending acceptance in test_mode.

 

What's required? What's optional?

In order to get the information back you'd like, we give you the flexibility to decide what you want to query against to get the info you need. Only one of the following is required:

  • Include a Group Key to check against all Contracts in a specific Group.
  • Include a Group ID (an integer) — this is used by our JavaScript library.
  • Specify Contract IDs — If you don't use Groups or prefer to just check the latest by Contract ID, include a comma-separated set of Contract IDs.

Response 200 (application/json)

Returns a JSON object of contract IDs with a true or false value based upon whether or not the Signer has signed/accepted the latest contract version.

Suggest Edits

Get the Latest Published Versions for a Group

"Published" versions for the Contracts included in a Group. The purpose of the "Published" call is so that you can get a fast, real-time response to get the Version IDs of the Contracts you'e displaying to your Signer. If you're doing a full server-side flow using the Activity API, you'll be able to follow this flow on the Activity API:

  1. To get the Versions your signer should be accepting, use HTTP GET => /published?sid={site_access_id}&key={group_key}

  2. If you want to get the latest Version IDs already accepted by your user, do something like `HTTP GET => /latest?sig={signer_id}&sid={site_access_id}&gkey={group_key}

  3. Load form on the page to capture user sign up and acceptance.

  4. Pass Version IDs and Contract IDs to HTTP POST => /send?sid={site_access_id}&cid={contract_ids}&vid={version_ids}&sig={signer_ids}&gid={group-id}

 

Query Auth

 Authentication is required for this endpoint.
gethttps://pactsafe.io/published
curl --request GET \
  --url https://pactsafe.io/published
var request = require("request");

var options = { method: 'GET', url: 'https://pactsafe.io/published' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://pactsafe.io/published")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://pactsafe.io/published");

xhr.send(data);
import requests

url = "https://pactsafe.io/published"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
    "282":  "592491db0a8eb8133e7a3c5b",
    "1241": "592494670a8eb8133e7a3c67"
}

Query Params

gkey
string

Optional. The key for a group of Contracts that will be evaluated, with all the latest versions being accepted and returned as true or false.

gid
int32

Optional. The ID for a group of Contracts that will be evaluated, with all the latest versions being accepted and returned as true or false.

cid
string

Optional. A set of comma separated values requesting if a Signer has accepted the latest version of a set of Contract IDs.

 

What's required? What's optional?

In order to get the information back you'd like, we give you the flexibility to decide what you want to query against to get the info you need. Only one of the following is required:

  • Include a Group Key to check against all Contracts in a specific Group.
  • Include a Group ID (an integer) — this is used by our JavaScript library.
  • Specify Contract IDs — If you don't use Groups or prefer to just check the latest by Contract ID, include a comma-separated set of Contract IDs.

Response 200 (application/json)

Returns a JSON object of contract IDs with respective UUIDs representing their corresponding Versions in PactSafe.

Suggest Edits

Get ("Retrieve") Contracts by Signer

The purpose of the "Retrieve" call is for a fast, real-time response of the actual Version IDs accepted by a user. You can then use the REST API.

 

Query Auth

 Authentication is required for this endpoint.
gethttps://pactsafe.io/retrieve
curl --request GET \
  --url https://pactsafe.io/retrieve
var request = require("request");

var options = { method: 'GET', url: 'https://pactsafe.io/retrieve' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://pactsafe.io/retrieve")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://pactsafe.io/retrieve");

xhr.send(data);
import requests

url = "https://pactsafe.io/retrieve"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
    "53": "592491db0a8eb8133e7a3c5b",
    "1241": "592494670a8eb8133e7a3c67"
}

Query Params

sig
string

Signer ID. The unique identifier used to save your signer's signature. Can be email, mobile number, GUID, UUID, or any integer. Should be URL encoded.

cid
string

Optional. Contract IDs. A set of comma separated values requesting if a Signer has accepted the latest version of a set of Contract IDs.

tm
boolean

Optional. For a full-scale testing flow, you can enable test_mode when checking acceptance records for a Signer in this call, too. To be used when sending acceptance in test_mode.

 

What's required? What's optional?

To get specific contract IDs, you need to pass in a comma separated list of contract IDs. Alternatively, you can not pass in contract IDs to get contract ID and version ID for every contract accepted within a Site.

Response 200 (application/json)

Returns a JSON object of contract IDs with a UUID representing the Version ID accapted in PactSafe.

Suggest Edits

Send Contracts Signed/Accepted by Signer

The purpose of the "Send" call is so that you can send a fast, real-time call to PactSafe to capture an electronic signature of your Contracts.

Note: This will return a response as a web beacon, or a 1x1 pixel image. Either GET or POST will work.

 

Query Auth

 Authentication is required for this endpoint.
gethttps://pactsafe.io/send
curl --request GET \
  --url https://pactsafe.io/send
var request = require("request");

var options = { method: 'GET', url: 'https://pactsafe.io/send' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://pactsafe.io/send")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://pactsafe.io/send");

xhr.send(data);
import requests

url = "https://pactsafe.io/send"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Query Params

sig
string

Signer ID. The unique identifier used to save your signer's signature. Can be email, mobile number, GUID, UUID, or any integer. Should be URL encoded.

cid
string

Optional. Contract IDs. A set of comma separated values requesting if a Signer has accepted the latest version of a set of Contract IDs.

vid
string

Version IDs. Note: NOT an integer, this is a UUID found in the version details of your contract. A set of comma separated values requesting if a Signer has accepted the latest version of a set of Contract IDs. *Only optional if passing an updated event type`.

et
string

Event Type. Any value can be accepted here, but the default events you can pass to the Activity API are displayed, updated, agreed, visited, sent, and disagreed.

gid
int32

Optional. The Group ID that all the Contracts are a part of will also be added to your call if added.

cnf
string

Optional. Email Confirmation. Use 1 or true here to send an email confirmation to the signer.

cus
object

Optional. Custom Data. URL encode a JSON object to attach custom data to your Activity. The example is URL encoded for { "first name": "Eric" } Using this in an update Activity will append the data to the Signer, otherwise it will be added to the specific Activity call/transaction.

 
cus.first_name
string

Reserved property of Signer.

cus.last_name
string

Reserved property of Signer.

cus.company
string

Reserved property of Signer.

cus.title
string

Reserved property of Signer.

cus.customer_id
string

Example of a custom property.

tm
string

Optional. Test Mode. Whether or not to process the acceptance in test_mode. Defaults to false, pass either 1 or true to enable it.

 

What's required? What's optional?

The following fields are required in order for the acceptance/signature to be processed:

  • Signer ID
  • Site Access ID
  • Contract IDs
  • Version IDs

Response 200 (application/json)

Returns a web beacon or 1x1 pixel image response.

Suggest Edits

Possible URL Parameters to Track

There are lots of URL parameters you can pass to https://pactsafe.io/send.

 

Want to send your calls to pactsafe.io/send on the back-end? Then you may want to customize the URL parameters that you send so PactSafe tracks the right metadata about your acceptance/transaction. Here are all the parameters you need:

  sid: 'site_id',
  et: 'event_type',
  em: 'execution_method',
  sig: 'signer_id',
  uid: 'uuid',
  rev: 'revision',
  vid: 'version',
  cid: 'contract',
  gid: 'group',
  gkey: 'group_key',
  srid: 'request',
  xt: 'external',
  xtu: 'external_url',
  cus: 'custom_data',
  pat: 'page_title',
  pau: 'page_url',
  pad: 'page_domain',
  pap: 'page_path',
  paq: 'page_query',
  hn: 'hostname',
  ref: 'referrer',
  addr: 'remote_address',
  btz: 'browser_timezone',
  bl: 'browser_locale',
  bua: 'user_agent',
  df: 'device_fingerprint',
  os: 'operating_system',
  env: 'environment',
  scd: 'screen_color_depth',
  res: 'screen_resolution',
  ck: 'cookies',
  nc: 'nonce',
  ts: 'timestamp',
  _s: 'send_count',
  tm: 'test_mode',
  rdid: 'render_id',
  rnd: 'render_data',
  dyn: 'dynamic',
  _ct: 'certification_token',
  _noerr: 'silent_error',
  _srv: 'server_side',
  _lib: 'client_library',
  _libv: 'client_version',
  jur: 'jurisdiction',
  /* Virtual Group properties */
  sty: 'style',
  gtyp: 'type',
  vrt: 'virtual',
  fltr: 'filter',
  csty: 'custom_styles',
  csel: 'container_selector',
  ssel: 'signer_id_selector',
  fsel: 'form_selector',
  blk: 'block_submission',
  fs: 'force_scroll',
  arun: 'auto_run',
  disp: 'display_all',
  amsg: 'alert_message',
  lang: 'acceptance_language',
  cnf: 'confirmation_email',
  ntf: 'notification_email'
Suggest Edits

Getting Activity on a specific Signer via the API

 

We often get the question about how to get specific information about activity related to a signer via our REST API. The answer is simple, and we're so happy about that! It's as simple as a couple of additional parameters to pass in your call. So let's get started.

Use cases

Generally, the use case or question we get is:

  • "I want to get the IP address for my signer for all their activity."
  • "I want to grab all historical information about my signer."
  • "How can I see what URL they accepted my contract from?"

What you'll need

  • Firstly, you'll need some activity in your account. :-) Check to see if you have some here. If you don't, get started by sending a contract to yourself.

  • Next, you'll need to get an access token to start playing with the API. You can get one right here.

  • You'll need a bit of knowledge on how to work with REST APIs.

Getting Activity via the REST API

In PactSafe, there are a couple of ways to get activity in your account. We have ways to segregate/segment the data that you're getting back from our API. For example, we have Sites that can be used to segregate contracts and signer information between different business units, geographies, or development environments.

So, you can get all activity for your account by calling the following:

GET -> https://api.pactsafe.com/v1.1/activity

OR, you can segregate the activity in your API call to come back based on your site ID (which can be found by calling GET -> /v1.1/sites):

GET -> https://api.pactsafe.com/v1.1/sites/228/activity

Getting Activity for a specific Signer

To get activity for a specific signer, you need to use the filter parameter on the API call to filter your results according to your specs. Pretty easy!

Let's say you want to grab all your "agreed" activities (people who signed or accepted a contract). You'd hit our API with the following filter:

GET -> https://api.pactsafe.com/v1.1/sites/2/activity?filter=event_type==agreed

Which will return you a JSON object and will look like this:

{
  "page": 1,
  "per_page": 25,
  "count": 218,
  "data": [
    {
      "uuid": "55e0820564a5846a5a0387c4",
      "version": "55d33b2b7b45fcac4f845841",
      "custom_data": null,
      "connection_data": {
        "page_title": "Login | ilawnow.com",
        "page_url": "http://ilawnow.com/login/",
        "page_domain": "ilawnow.com",
        "page_path": "/login/",
        "page_query": null,
        "hostname": "response.pactsafe.com",
        "referrer": "http://ilawnow.com/register/",
        "browser_timezone": "4",
        "browser_locale": "en-us",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36",
        "device_fingerprint": null,
        "operating_system": "MacOS",
        "environment": "desktop",
        "screen_color_depth": "24-bit",
        "screen_resolution": "1680x1050",
        "cookies": null,
        "remote_address": "172.31.43.73",
        "headers": {
          "host": "response.pactsafe.com",
          "accept": "*/*",
          "accept-encoding": "gzip, deflate",
          "accept-language": "en-US,en;q=0.8",
          "cache-control": "max-age=0",
          "content-type": "text/plain;charset=UTF-8",
          "cookie": "",
          "origin": "http://ilawnow.com",
          "referer": "http://ilawnow.com/login/",
          "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36",
          "x-forwarded-for": "104.137.190.15",
          "x-forwarded-port": "80",
          "x-forwarded-proto": "http",
          "content-length": "423",
          "connection": "keep-alive"
        }
      },
      "site": 2,
      "account": 2,
      "signer_id": "eric@pactsafe.com",
      "group": 4,
      "contract": 4,
      "event_type": "agreed",
      "batch": "1440786453975",
      "created_time": "2015-08-28T18:27:33.975Z",
      "id": "55e0a81564a5846a5a0387ec"
    },
    ...
  ]
}

If you guessed that your next step to get Signer-specific info back was to add to that filter, you'd be right! To get back "agreed" activity for a signer, you just append the filter to your GET call like so:

GET -> https://api.pactsafe.com/v1.1/sites/2/activity?filter=event_type==agreed and signer_id=eric@pactsafe.com

Note: Some development platforms need to be URL encoded. Looking for sample code for your dev stack? Head on over to our API docs to see how to construct your calls.

Ordering by date and setting pagination

Additional parameters in your call allow you to set the order and the number of results you'd like for a result to contain.

order

You can order your results by any top-level field in your API call. Default value is created_time asc for activity.

per_page

This allows you to set pagination according to how many results you'd like to handle per page. Default value is 25.

Here's an example of both in action.

GET -> https://api.pactsafe.com/v1.1/sites/2/activity?order=created_time desc&per_page=200
Suggest Edits

Get your Requests

Pull down all Requests that your user has access to.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/requests
curl --request GET \
  --url https://api.pactsafe.com/v1.1/requests
var request = require("request");

var options = { method: 'GET', url: 'https://api.pactsafe.com/v1.1/requests' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/requests")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/requests");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/requests"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "page": 1,
    "per_page": 25,
    "count": 25,
    "total_count": 285,
    "has_more": true,
    "data": [
        {
            "acceptance_language": "",
            "key": "order-form-for-customer",
            "subject": "Email subject line",
            "name": "Order Form for Customer",
            "created_by": 297,
            "updated_by": 297,
            "account": 174,
            "site": 228,
            "form_fields": [],
            "render_data": {
                "upgrade_product": "4GB Additional Storage",
                "upgrade_cost": "540 per year",
                "total_cost": "540",
                "payment_terms": "paid by credit card of Customer"
            },
            "sent_by": 297,
            "fields": [],
            "fileformat_download": false,
            "force_scroll": false,
            "tags": [],
            "status": "complete",
            "approval_requested_time": null,
            "approved_time": null,
            "approved": false,
            "expired": false,
            "paused_time": null,
            "paused": false,
            "published_time": null,
            "sent_time": "2016-08-08T23:36:01.537Z",
            "completed_time": "2016-10-11T19:49:15.801Z",
            "complete": true,
            "archived": false,
            "updated_time": "2016-10-11T19:49:15.801Z",
            "created_time": "2016-08-08T23:23:29.110Z",
            "smartpact": false,
            "identity_confirmation": false,
            "signing_order": false,
            "invite_only": true,
            "followers": [],
            "signers": [
                {
                    "signer_id": "eric+test@pactsafe.com",
                    "signer": "57a90e627e89583c6f15a101",
                    "reopened": false,
                    "completed_time": "2016-10-11T19:49:15.790Z",
                    "complete": true,
                    "opened_time": "2016-10-11T19:49:07.080Z",
                    "open": true,
                    "sent_time": "2016-08-08T23:36:01.537Z",
                    "sent": true,
                    "added_time": "2016-08-08T23:23:29.110Z",
                    "notify": true,
                    "allow_revisions": false,
                    "allow_comments": false,
                    "order": 0,
                    "send_to": {
                        "mobile_number": false,
                        "email": true
                    },
                    "role": "signer",
                    "undeliverable": false,
                    "id": "eric+test@pactsafe.com"
                }
            ],
            "approvers": [],
            "contracts": [
                "57fd421c707c542f2474d245"
            ],
            "id": "57a91471e300f5e014008198"
        },
        {
            "acceptance_language": "",
            "key": "5-seats-of-neighborino",
            "render_data": {
                "number_of_seats": "5",
                "cost_per_seat": "45",
                "api_access_cost": "3,000",
                "custom_description": "Standard Implementation",
                "custom_cost": "1,500",
                "payment_terms": "Net 15",
                "total_cost": "7,200"
            },
            "message": "Hi Eric, please take a look at the Order Form and sign at your convenience.",
            "subject": "Please review the Neighborino contract",
            "name": "5 Seats of Neighborino",
            "created_by": 297,
            "updated_by": 297,
            "account": 174,
            "site": 228,
            "form_fields": [],
            "sent_by": 297,
            "fields": [],
            "fileformat_download": false,
            "force_scroll": false,
            "tags": [],
            "status": "complete",
            "approval_requested_time": null,
            "approved_time": null,
            "approved": false,
            "expired": false,
            "paused_time": null,
            "paused": false,
            "published_time": null,
            "sent_time": "2016-08-09T13:23:33.489Z",
            "completed_time": "2016-08-09T13:26:00.608Z",
            "complete": true,
            "archived": false,
            "updated_time": "2016-08-09T13:26:00.608Z",
            "created_time": "2016-08-09T13:23:32.038Z",
            "smartpact": false,
            "identity_confirmation": false,
            "signing_order": false,
            "invite_only": true,
            "followers": [],
            "signers": [
                {
                    "signer_id": "eric@pactsafe.com",
                    "signer": "57a8a126f7d1df132c6ef572",
                    "reopened": false,
                    "completed_time": "2016-08-09T13:26:00.569Z",
                    "complete": true,
                    "opened_time": "2016-08-09T13:25:36.145Z",
                    "open": true,
                    "sent_time": "2016-08-09T13:23:33.489Z",
                    "sent": true,
                    "added_time": "2016-08-09T13:23:32.038Z",
                    "notify": true,
                    "allow_revisions": false,
                    "allow_comments": false,
                    "order": 0,
                    "send_to": {
                        "mobile_number": false,
                        "email": true
                    },
                    "role": "signer",
                    "undeliverable": false,
                    "id": "eric@pactsafe.com"
                }
            ],
            "approvers": [],
            "contracts": [
                "57a9d9544fc34f110d914598"
            ],
            "id": "57a9d9544fc34f110d914596"
        },
    ]
}

Query Params

expand
string

Expands objects that only return an ID. Works up to 2 levels deep.

sort
string

Sort the results of your call by a field in the Request.

filter
string

Filter requests by the various fields.

page
int32

Page number to offset results for pagination. Defaults to 1.

per_page
int32

How many results per page you'd like to return.

 
Suggest Edits

Get all Requests for a Site

Pull down all Requests that your user has access to.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/site/site_id/requests
curl --request GET \
  --url https://api.pactsafe.com/v1.1/site/site_id/requests
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/site/site_id/requests' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/site/site_id/requests")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/site/site_id/requests");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/site/site_id/requests"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "page": 1,
    "per_page": 25,
    "count": 25,
    "total_count": 285,
    "has_more": true,
    "data": [
        {
            "acceptance_language": "",
            "key": "order-form-for-customer",
            "subject": "Email subject line",
            "name": "Order Form for Customer",
            "created_by": 297,
            "updated_by": 297,
            "account": 174,
            "site": 228,
            "form_fields": [],
            "render_data": {
                "upgrade_product": "4GB Additional Storage",
                "upgrade_cost": "540 per year",
                "total_cost": "540",
                "payment_terms": "paid by credit card of Customer"
            },
            "sent_by": 297,
            "fields": [],
            "fileformat_download": false,
            "force_scroll": false,
            "tags": [],
            "status": "complete",
            "approval_requested_time": null,
            "approved_time": null,
            "approved": false,
            "expired": false,
            "paused_time": null,
            "paused": false,
            "published_time": null,
            "sent_time": "2016-08-08T23:36:01.537Z",
            "completed_time": "2016-10-11T19:49:15.801Z",
            "complete": true,
            "archived": false,
            "updated_time": "2016-10-11T19:49:15.801Z",
            "created_time": "2016-08-08T23:23:29.110Z",
            "smartpact": false,
            "identity_confirmation": false,
            "signing_order": false,
            "invite_only": true,
            "followers": [],
            "signers": [
                {
                    "signer_id": "eric+test@pactsafe.com",
                    "signer": "57a90e627e89583c6f15a101",
                    "reopened": false,
                    "completed_time": "2016-10-11T19:49:15.790Z",
                    "complete": true,
                    "opened_time": "2016-10-11T19:49:07.080Z",
                    "open": true,
                    "sent_time": "2016-08-08T23:36:01.537Z",
                    "sent": true,
                    "added_time": "2016-08-08T23:23:29.110Z",
                    "notify": true,
                    "allow_revisions": false,
                    "allow_comments": false,
                    "order": 0,
                    "send_to": {
                        "mobile_number": false,
                        "email": true
                    },
                    "role": "signer",
                    "undeliverable": false,
                    "id": "eric+test@pactsafe.com"
                }
            ],
            "approvers": [],
            "contracts": [
                "57fd421c707c542f2474d245"
            ],
            "id": "57a91471e300f5e014008198"
        },
        {
            "acceptance_language": "",
            "key": "5-seats-of-neighborino",
            "render_data": {
                "number_of_seats": "5",
                "cost_per_seat": "45",
                "api_access_cost": "3,000",
                "custom_description": "Standard Implementation",
                "custom_cost": "1,500",
                "payment_terms": "Net 15",
                "total_cost": "7,200"
            },
            "message": "Hi Eric, please take a look at the Order Form and sign at your convenience.",
            "subject": "Please review the Neighborino contract",
            "name": "5 Seats of Neighborino",
            "created_by": 297,
            "updated_by": 297,
            "account": 174,
            "site": 228,
            "form_fields": [],
            "sent_by": 297,
            "fields": [],
            "fileformat_download": false,
            "force_scroll": false,
            "tags": [],
            "status": "complete",
            "approval_requested_time": null,
            "approved_time": null,
            "approved": false,
            "expired": false,
            "paused_time": null,
            "paused": false,
            "published_time": null,
            "sent_time": "2016-08-09T13:23:33.489Z",
            "completed_time": "2016-08-09T13:26:00.608Z",
            "complete": true,
            "archived": false,
            "updated_time": "2016-08-09T13:26:00.608Z",
            "created_time": "2016-08-09T13:23:32.038Z",
            "smartpact": false,
            "identity_confirmation": false,
            "signing_order": false,
            "invite_only": true,
            "followers": [],
            "signers": [
                {
                    "signer_id": "eric@pactsafe.com",
                    "signer": "57a8a126f7d1df132c6ef572",
                    "reopened": false,
                    "completed_time": "2016-08-09T13:26:00.569Z",
                    "complete": true,
                    "opened_time": "2016-08-09T13:25:36.145Z",
                    "open": true,
                    "sent_time": "2016-08-09T13:23:33.489Z",
                    "sent": true,
                    "added_time": "2016-08-09T13:23:32.038Z",
                    "notify": true,
                    "allow_revisions": false,
                    "allow_comments": false,
                    "order": 0,
                    "send_to": {
                        "mobile_number": false,
                        "email": true
                    },
                    "role": "signer",
                    "undeliverable": false,
                    "id": "eric@pactsafe.com"
                }
            ],
            "approvers": [],
            "contracts": [
                "57a9d9544fc34f110d914598"
            ],
            "id": "57a9d9544fc34f110d914596"
        },
    ]
}

Query Params

expand
string

Expands objects that only return an ID. Works for up to 2 levels deep.

sort
string

Sort your results of your call by a field in the Request.

filter
string

Filter requests by the various fields.

page
int32

Page number to offset results for pagination. Defaults to 1.

per_page
int32

How many results per page you'd like to return.

 
Suggest Edits

Create a New Request

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.pactsafe.com/v1.1/sites/site_id/requests
curl --request POST \
  --url https://api.pactsafe.com/v1.1/sites/1/requests
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.pactsafe.com/v1.1/sites/1/requests' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/sites/1/requests")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.pactsafe.com/v1.1/sites/1/requests");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/sites/1/requests"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "id": "56bc8b14ecd32bc82c4c227a",
    "created_by": 6,
    "updated_by": 6,
    "account": 2,
    "site": 2,
    "name": "New Request",
    "description": "This is an internal description of the request",
    "subject": "Subject line for email",
    "message": "Message to signers",
    "status": "draft",
    "sent_time": "foo",
    "completed_time": "foo",
    "complete": false,
    "updated_time": "2016-02-11T13:22:28.349Z",
    "created_time": "2016-02-11T13:22:28.349Z",
    "signing_order": false,
    "invite_only": true,
    "signers": [
      {
        "download_request_url": "https://public.pactsafe.com/v1.1/download/requests/5a9d9ca028e2a004677ed81a/record?expires=0&r=5a9d9ca028e2a004677ed81a&s=5a9d9ca028e2a004677ed81b&signature=mW4zT49YOXEYbTxpy-52HRkzgEDP-8btfzGOdiLWw5ylwTk70ToESRHbvG1urKCwzxye6iH3IIEvPLYc-WR2xmGN9cMtgUtixAPqHZL~nrqFukqJxpcKSFyNYKOlvOzJdBuP58HXyOcmcrEvJzEX~DGpx7p9CjxRSLvDmnzLzoGbEYt1lr2MbOInhVp0FGSQWu2RIQvjd08xqQXILoHO6d78ZXJ4Y0TPsAM0WZ80AO8x4nRsk-k4f2COOdOsmGRW53a1gZixZAxgwUnCZ6XsA2eIWdrD6Ab7z4v4MvFckM3yrE1JRzIwE2Zy8VI5nyh~XH77DiAcuFgjW1VSI887Qw__",
        "request_url": "https://app.pactsafe.com/sign?r=5a9d9ca028e2a004677ed81a&s=5a9d9ca028e2a004677ed81b&signature=s9GMRhaf7r4UNbu6jhQ5rKh2HSDbFDSkU~Rmd4rwEIet3uqPTsOc6VPQIRH7kTVxoty1CrqpoY~r-kriYPge3zVOwZyeJUkKMzALeb1r-iiNGig0IxTzSOwMHIFUR1yx86l0-lccasH9vbqbn9nlO2I1Em1c6Amd0TzvyaQvuUp3ol9UhLlXPTes6cC64pqd2AeJB6j2EDzo3i8KZt-qwahWgHMUlW8jolt7QyyBLrI11KEAEo2GD4yveIzsbC6sWRxD-ksh2Adtm27WXfNT2O~BP1emgE~4i8L80Y2Y-2VKQ8bN-K8XVT8CjMpooikbcbYEOiPfNWQJZCOsmLdZzA__",
        "signer_id": "eric+0307",
        "signer": {
          "email_hash": "8a05450d2fde8513f635111dded75ff9",
          "name": "Eric Prugh",
          "company_name": "PactSafe 2",
          "title": "CF",
          "additional_attributes": {
            "first_name": "Eric",
            "last_name": "Prugh",
            "title": "CF",
            "company_name": "PactSafe 2"
          },
          "email": "eric+0307@pactsafe.com",
          "mobile_number": "+13175551234",
          "signer_id": "eric+0307",
          "account": 2,
          "site": 2,
          "notify": true,
          "test_mode": false,
          "source": "api",
          "last_downloaded_time": null,
          "latest_activity_time": null,
          "updated_time": "2018-03-05T19:38:08.689Z",
          "created_time": "2018-03-05T19:38:08.676Z",
          "deliverable": {
            "mobile_number": true,
            "email": true
          },
          "sendable": true,
          "uuid": "5a9d9ca028e2a004677ed81b"
        },
        "reopened": false,
        "reminded_time": null,
        "completed_time": null,
        "complete": false,
        "opened_time": null,
        "open": false,
        "sent_time": null,
        "sent": false,
        "added_time": "2018-03-05T19:38:08.696Z",
        "notify": true,
        "allow_revisions": false,
        "allow_comments": false,
        "order": 1,
        "send_to": {
          "mobile_number": false,
          "email": false
        },
        "role": "signer",
        "undeliverable": false,
        "id": "eric+0307"
      },
      {
        "download_request_url": "https://public.pactsafe.com/v1.1/...",
        "request_url": "https://app.pactsafe.com/sign?r=5a9d9ca028e2a004677ed81a...",
        "signer_id": "eric+0306",
        "signer": {
          "email_hash": "82fd11808d3990d7cde57edda93ec7fc",
          "name": "Eric Prugh",
          "company_name": "PactSafe 2",
          "title": "CF",
          "additional_attributes": {
            "last_name": "Prugh",
            "first_name": "Eric",
            "title": "CF",
            "company_name": "PactSafe 2"
          },
          "email": "eric+0306@pactsafe.com",
          "mobile_number": "+13175551235",
          "signer_id": "eric+0306",
          "account": 2,
          "site": 2,
          "notify": true,
          "test_mode": false,
          "source": "api",
          "last_downloaded_time": null,
          "latest_activity_time": null,
          "updated_time": "2018-03-05T19:38:08.694Z",
          "created_time": "2018-03-05T19:28:37.886Z",
          "deliverable": {
            "mobile_number": true,
            "email": true
          },
          "sendable": true,
          "uuid": "5a9d9a65304439046fcc2531"
        },
        "reopened": false,
        "reminded_time": null,
        "completed_time": null,
        "complete": false,
        "opened_time": null,
        "open": false,
        "sent_time": null,
        "sent": false,
        "added_time": "2018-03-05T19:38:08.698Z",
        "notify": true,
        "allow_revisions": false,
        "allow_comments": false,
        "order": 0,
        "send_to": {
          "mobile_number": false,
          "email": false
        },
        "role": "signer",
        "undeliverable": false,
        "id": "eric+0306"
      }
    ],
    "contracts": [
      {
        "download_endpoint": "s/25b2b173-632a-4227-9877-31d2109d8c98/revisions/5a9d9ca028e2a004677ed81f.pdf",
        "site": 2,
        "request": "5a9d9ca028e2a004677ed81a",
        "account": 2,
        "contract": 13072,
        "version": "59c15ad819feae0e9d976f15",
        "created_by": 2,
        "updated_by": 2,
        "title": "Engagement Letter",
        "pages": null,
        "render_data": null,
        "tokens": [
          "59c15b2ec68e8c30d4c0b04d",
          "59c15affc68e8c30d4c0b048",
          "59c15b1c19feae0e9d976f18",
          "58f8c9de347dc069e58e793d"
        ],
        "fields": [
          {
            "completed_value": null,
            "completed_time": null,
            "label": "Firm Signature",
            "name": "firm_signature",
            "locked": false,
            "complete": false,
            "locations": [
              {
                "height": null,
                "width": null,
                "page": null,
                "top": null,
                "left": null
              }
            ],
            "options": null,
            "required": true,
            "type": "signature",
            "id": "59c15b5f1ad5e947116b7feb"
          }
        ],
        "suggestions": [],
        "comments": [],
        "locked": false,
        "change_summary": "",
        "dynamic": true,
        "type": "html",
        "protected": false,
        "body": "Dear {{{Name}}}...",
        "updated_time": "2018-03-05T19:38:08.758Z",
        "created_time": "2018-03-05T19:38:08.742Z",
        "active": true,
        "revision_number": 1,
        "id": "5a9d9ca028e2a004677ed81f"
      }
    ]
  }

Path Params

site_id
int32
required

The ID (number) of the Site you're creating a Request in.

Body Params

name
string

Optional.

description
string

Optional.

subject
string

Optional. Choose the subject line of the email sent when sending the agreement.

message
string

Optional. Include a custom message (can include email-friendly HTML) in the email you send when sending your Request.

contracts
array of integers

Optional.

signers
array of objects

Optional.

signer_id
signer 
order
allow_comments
boolean

Optional. Requires "Comment mode" to be enabled within your account. Will allow signers and recipients to add comments to the contracts in your Request.

signing_order
boolean

Optional. Will enable signing order (requires an "order" parameter as specified in the "signers" object).

force_scroll
boolean

Optional. Will force a Signer to scroll to the bottom of the Request before the "Agree" button is displayed.

smartpact
boolean

Optional. Will set the Request to be a SmartPact. More info on SmartPacts can be found here

render_data
object

Optional.

 
render_data.key1
string
render_data.key2
string
 

Example use of "signers" in your HTTP POST

In the above call, you'll see an array of "signers" that you can add. In order to add signers correctly into your Request, you'll want to apply the following structure to create the Signer.

You can do the following in a single call:

  • Include email & mobile number
  • Add the Signer's name
  • Add the Signer's company name and title
  • Enable or disable email and SMS once the Request is sent
  • Pass in the designated order for signing if signer_order is set to true on the top level of the Request

This is an example of the Signers object constructed within the HTTP POST call mentioned above:

{
  ...
  "signers": [
    {
      "signer_id": "12346", // => email, mobile number, GUID, etc.
      "signer": {
        "email": "your@email.com",
        "mobile_number": "+13175551234",
        "order": 0,
        "additional_attributes": {
          "first_name": "Jimbo",
          "last_name": "Smith"
          "company_name": "PactSafe",
          "title": "Product Manager"
        }
      },
      "send_to": {
        "email": true,
        "mobile_number": false
      }
    }
  ],
  ...
}
Suggest Edits

Add a Contract to a Request

When a Contract is added to a Request, a new Revision is created from the published Version of that Contract, and the new Revision is returned. That Revision is unique to the Request, and can be customized independently of the Contract/Version.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.pactsafe.com/v1.1/requests/request_id/contracts/contract_id
curl --request POST \
  --url https://api.pactsafe.com/v1.1/requests/request_id/contracts/1
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.pactsafe.com/v1.1/requests/request_id/contracts/1' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/requests/request_id/contracts/1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.pactsafe.com/v1.1/requests/request_id/contracts/1");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/requests/request_id/contracts/1"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "id": "56c5db601b2b0712628ec420",
    "account": 2,
    "site": 2,
    "contract": 48,
    "version": "565350aec33484a90a13d811",
    "created_by": 6,
    "created_time": "2016-02-11T13:43:20.591Z",
    "updated_by": 6,
    "updated_time": "2016-02-11T14:29:10.118Z",
    "title": "Terms of Service",
    "body": "&lt;div&gt;&lt;span style=&quot;font-size: 18px; color: rgb(102, 163, 224);&quot;&gt;THIS IS A CONTRACT&lt;/span&gt;&lt;/div&gt;",
    "customized": false,
    "locked": false,
    "suggestions": [
      "foo",
      "foo",
      "foo",
    ],
    "comments": [
      "foo",
      "foo",
      "foo",
    ]
  }

Path Params

request_id
string
required

id of the Signature Request. Has example value

contract_id
int32
required

Numeric id of the Contract to add. Has example value.

 
Suggest Edits

Update a Request

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
patchhttps://api.pactsafe.com/v1.1/requests/request_id
curl --request PATCH \
  --url https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a
var request = require("request");

var options = { method: 'PATCH',
  url: 'https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a"

response = requests.request("PATCH", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "id": "56bc8b14ecd32bc82c4c227a",
    "created_by": 6,
    "updated_by": 6,
    "account": 2,
    "site": 2,
    "name": "Purchase Order",
    "description": "Purchase Order for iLawNow",
    "subject": "Please sign these contracts",
    "message": "Here are the contracts we discussed.",
    "status": "draft",
    "sent_time": "foo",
    "completed_time": "foo",
    "complete": false,
    "updated_time": "2016-02-11T13:45:30.221Z",
    "created_time": "2016-02-11T13:22:28.349Z",
    "signing_order": true,
    "invite_only": true,
    "signers": [
      "foo",
      "foo",
      "foo",
    ],
    "contracts": [
      "foo",
      "foo",
      "foo",
    ]
  }

Path Params

request_id
string
required

id of the Signature Request to retrieve. Has example value..

Body Params

name
string
description
string
message
string
signing_order
boolean

Headers

Content-Type
string
 
Suggest Edits

Retrieve a Request

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/requests/request_id
curl --request GET \
  --url https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{ "data": {
    "id": "56bc8b14ecd32bc82c4c227a",
    "created_by": 6,
    "updated_by": 6,
    "account": 2,
    "site": 2,
    "name": "Purchase Order",
    "description": "Purchase Order for iLawNow",
    "subject": "Please sign these contracts",
    "message": "Here are the contracts we discussed.",
    "status": "open",
    "sent_by": 6,
    "sent_time": "2016-02-11T14:29:10.118Z",
    "completed_time": "foo",
    "complete": false,
    "updated_time": "2016-02-11T13:45:30.221Z",
    "created_time": "2016-02-11T13:22:28.349Z",
    "signing_order": true,
    "invite_only": true,
    "signers": [
      {
        "signer_id": "eric@pactsafe.com",
        "signer": "55e0820564a5846a5a0387c4",
        "completed_time": "2016-02-11T14:34:12.228Z",
        "complete": true,
        "opened_time": "2016-02-11T14:33:01.442Z",
        "open": true,
        "allow_revisions": true,
        "allow_comments": true,
        "order": 0,
        "role": "signer",
        "id": "eric@pactsafe.com"
      },
    ],
    "contracts": [
      {
        "id": "56c5db601b2b0712628ec420",
        "account": 2,
        "site": 2,
        "contract": 48,
        "version": "565350aec33484a90a13d811",
        "created_by": 6,
        "created_time": "2016-02-11T13:43:20.591Z",
        "updated_by": 6,
        "updated_time": "2016-02-11T14:29:10.118Z",
        "title": "Terms of Service",
        "body": "&lt;div&gt;&lt;span style=&quot;font-size: 18px; color: rgb(102, 163, 224);&quot;&gt;THIS IS A CONTRACT&lt;/span&gt;&lt;/div&gt;",
        "customized": true,
        "locked": true,
        "suggestions": [
          "foo",
          "foo",
          "foo",
        ],
        "comments": [
          "foo",
          "foo",
          "foo",
        ]
      }

Path Params

request_id
string
required

id of the Signature Request to retrieve. Has example value.

 

Note: You can also pass a query string parameter expand=signers.signer,contracts to expand the details of each Signer and Contract within the response.

Suggest Edits

Delete Request

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
deletehttps://api.pactsafe.com/v1.1/requests/request_id
curl --request DELETE \
  --url https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "id": "56bc8b14ecd32bc82c4c227a"
  }

Path Params

request_id
string
required

id of the Signature Request to retrieve. Has example value..

 
Suggest Edits

Upsert a Signer to a Request

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
patchhttps://api.pactsafe.com/v1.1/requests/request_id/signers/signer_id
curl --request PATCH \
  --url https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/signers/john%40pactsafe.com
var request = require("request");

var options = { method: 'PATCH',
  url: 'https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/signers/john%40pactsafe.com' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/signers/john%40pactsafe.com")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/signers/john%40pactsafe.com");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/signers/john%40pactsafe.com"

response = requests.request("PATCH", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "signer_id": "eric@pactsafe.com",
    "signer": "55e0820564a5846a5a0387c4",
    "completed_time": "foo",
    "complete": false,
    "opened_time": "foo",
    "open": false,
    "allow_revisions": true,
    "allow_comments": true,
    "order": 0,
    "role": "signer",
    "id": "eric@pactsafe.com"
  }

Path Params

request_id
string
required

id of the Signature Request. Has example value.

signer_id
string
required

string signer_id of the Signer to add or update. Has example value.

 
Suggest Edits

Send a Request to Signers

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.pactsafe.com/v1.1/requests/request_id/send
curl --request POST \
  --url https://api.pactsafe.com/v1.1/requests/request_id/send
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.pactsafe.com/v1.1/requests/request_id/send' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/requests/request_id/send")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.pactsafe.com/v1.1/requests/request_id/send");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/requests/request_id/send"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "id": "56bc8b14ecd32bc82c4c227a",
    "created_by": 6,
    "updated_by": 6,
    "account": 2,
    "site": 2,
    "name": "Purchase Order",
    "description": "Purchase Order for iLawNow",
    "subject": "Please sign these contracts",
    "message": "Here are the contracts we discussed.",
    "status": "sent",
    "sent_by": 6,
    "sent_time": "2016-02-11T14:29:10.118Z",
    "completed_time": "foo",
    "complete": false,
    "updated_time": "2016-02-11T13:45:30.221Z",
    "created_time": "2016-02-11T13:22:28.349Z",
    "signing_order": true,
    "invite_only": true,
    "signers": [
      {
        "signer_id": "eric@pactsafe.com",
        "signer": "55e0820564a5846a5a0387c4",
        "completed_time": "foo",
        "complete": false,
        "opened_time": "foo",
        "open": false,
        "allow_revisions": true,
        "allow_comments": true,
        "order": 0,
        "role": "signer",
        "id": "eric@pactsafe.com"
      },
    ],
    "contracts": [
      {
        "id": "56c5db601b2b0712628ec420",
        "account": 2,
        "site": 2,
        "contract": 48,
        "version": "565350aec33484a90a13d811",
        "created_by": 6,
        "created_time": "2016-02-11T13:43:20.591Z",
        "updated_by": 6,
        "updated_time": "2016-02-11T14:29:10.118Z",
        "title": "Terms of Service",
        "body": "&lt;div&gt;&lt;span style=&quot;font-size: 18px; color: rgb(102, 163, 224);&quot;&gt;THIS IS A CONTRACT&lt;/span&gt;&lt;/div&gt;",
        "customized": true,
        "locked": true,
        "suggestions": [
          "foo",
          "foo",
          "foo",
        ],
        "comments": [
          "foo",
          "foo",
          "foo",
       ]
      }

Path Params

request_id
string
required

id of the Signature Request to send. Has example value.

 
Suggest Edits

Remove a Signer from a Request

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
deletehttps://api.pactsafe.com/v1.1/requests/request_id/signers/signer_id
curl --request DELETE \
  --url https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/signers/john%40pactsafe.com
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/signers/john%40pactsafe.com' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/signers/john%40pactsafe.com")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/signers/john%40pactsafe.com");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/signers/john%40pactsafe.com"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "signer_id": "eric@pactsafe.com",
    "signer": "55e0820564a5846a5a0387c4",
    "completed_time": "foo",
    "complete": false,
    "opened_time": "foo",
    "open": false,
    "allow_revisions": true,
    "allow_comments": true,
    "order": 0,
    "role": "signer",
    "id": "eric@pactsafe.com"
  }

Path Params

request_id
string
required

id of the Signature Request. Has example value.

signer_id
string
required

string signer_id of the Signer to add or update. Has example value.

 
Suggest Edits

Add a Contract to a Request

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.pactsafe.com/v1.1/requests/request_id/contracts/contract_id
curl --request POST \
  --url https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/contracts/48
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/contracts/48' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/contracts/48")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/contracts/48");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/contracts/48"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "published_by": 49,
    "processing": false,
    "location": "https://dev-vault.pactsafe.io/s/9cd23889-723f-4b9d-909c-6db4da5a16c4/versions/588132d1852224f01f200753.pdf",
    "major_version": "foo",
    "full_version_number": "1.0",
    "created_by": 49,
    "updated_by": 49,
    "account": 29,
    "site": 38,
    "contract": 208,
    "version_number": 1,
    "title": "Sample contract pdf processing agreement",
    "tokens": [
      "foo",
      "foo",
      "foo",
    ],
    "fields": [
      "foo",
      "foo",
      "foo",
   ],
    "notify_signers": false,
    "change_summary": "foo",
    "status": "published",
    "dynamic": false,
    "type": "pdf",
    "protected": false,
    "body": "foo",
    "deprecated_time": "foo",
    "published_time": "2017-01-19T21:42:41.787Z",
    "published": true,
    "updated_time": "2017-01-19T21:42:41.788Z",
    "created_time": "2017-01-19T21:42:41.190Z",
    "is_major_version": true,
    "minor_version_number": 0,
    "download_endpoint": "versions/588132d1852224f01f200753.pdf",
    "id": "588132d1852224f01f200753"
  }

Path Params

request_id
string
required

id of the Signature Request. Has example value.

contract_id
string
required

numeric id of the Contract to add. Has example value.

 
Suggest Edits

Remove a Contract from a Request

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
deletehttps://api.pactsafe.com/v1.1/requests/request_id/contracts/contract_id
curl --request DELETE \
  --url https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/contracts/48
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/contracts/48' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/contracts/48")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/contracts/48");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/requests/56bc8b14ecd32bc82c4c227a/contracts/48"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "id": "56c5db601b2b0712628ec420"
  }

Path Params

request_id
string
required

id of the Signature Request. Has example value.

contract_id
string
required

numeric id of the Contract to add. Has example value.

 
Suggest Edits

Get Request URL for a specified Signer

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/requests/request_id/url?signer_id=signer_id
curl --request GET \
  --url 'https://api.pactsafe.com/v1.1/requests/5834b590729ae8ea62de040b/url?signer_id=signer_id'
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/requests/5834b590729ae8ea62de040b/url',
  qs: { signer_id: 'signer_id' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/requests/5834b590729ae8ea62de040b/url?signer_id=signer_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/requests/5834b590729ae8ea62de040b/url?signer_id=signer_id");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/requests/5834b590729ae8ea62de040b/url"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "location": "https://app.pactsafe.com/sign?r=5834b590729ae8ea62de040b&s=57aa529de42154185feebd54&signature=ShcUtiwYxY-SYLMrxDtbAVBUbftKscQYSHOIBPjiFN6IehCJc6pilanNm6n-toNzmSLaxBCcUezjRwUPf3~fAIzUCqoS2xzWMVdGcvXdQMX2vzduMM7cRe7HOC3FDr4sbt2IW0pZ0ZFxObfkKp350ONIBc7b2cvpKMCMcar5gOoWS9BDltPQc-~DSqyeZWQskQnTmaKwKIQ2RgyrG2QGyemn4FAN3UCgL7rHwO~xrsSNQvoYR-nuG29hfE5-5mYJSq~C-PYp8qb4yqApcvSZNxpcN8uIL1Tu6HXWTroxnMlnJuVwS1Q8~kuuMo7GsMYj~T7-2x9qATupGS3M7F84PA__",
    "token": "YOUR_ACCESS_TOKEN"
  }

Path Params

request_id
string
required

ID of the request.

Query Params

signer_id
string

Email address of your signer.

 
Suggest Edits

List all Signers for Contracts

What can you do with this Endpoint?

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/sites/site_id/activity/aggregate/signers?group=grouping_type&filter=filter
curl --request GET \
  --url 'https://api.pactsafe.com/v1.1/sites/1/activity/aggregate/signers?filter=contract%3D%3D11&group=contract'
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/sites/1/activity/aggregate/signers',
  qs: 
   { filter: 'contract==11',
     group: 'contract' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/sites/1/activity/aggregate/signers?filter=contract%3D%3D11&group=contract")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/sites/1/activity/aggregate/signers?filter=contract%3D%3D11&group=contract");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/sites/1/activity/aggregate/signers"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "page": 1,
  "per_page": 3,
  "count": 1129,
  "data": [
    {
      "account": 2,
      "site": 2,
      "additional_attributes": "foo",
      "signer_id": "BoomDiggity@pactsafe.com",
      "last_action": "56054c0d643cf1bd55f1ddf5",
      "email": "boomdiggity@pactsafe.com",
      "email_hash": "9cb8869a2b9e86e3577a992c42c0335e",
      "source": "api",
      "updated_time": "2015-09-25T13:28:45.273Z",
      "created_time": "2015-09-25T13:28:45.272Z",
      "sendable": true,
      "name": "boomdiggity@pactsafe.com",
      "uuid": "56054c0d643cf1bd55f1ddf2",
      "action_count": 2
    }
  ]
}

Path Params

site_id
int32
required

Numeric id of the Site to perform action with. Has example value.

grouping_type
string
required

How you want to aggregate the request. Can be contract, version, group, or request.

filter
string
required

Specify the filter criteria by which to sort and aggregate your results. Can be contract=={contract_id}, version=={version_id} or group=={group_id}

sort
string
required

Sort the results of your call by a field in the Request

page
int32
required

Page number to offset results for pagination. Defaults to 1.

 
Suggest Edits

List all Signers

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/sites/site_id/signers
curl --request GET \
  --url https://api.pactsafe.com/v1.1/sites/site_id/signers
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/sites/site_id/signers' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/sites/site_id/signers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/sites/site_id/signers");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/sites/site_id/signers"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{{
  "page": 1,
  "per_page": 3,
  "count": 1129,
  "data": [
    {
      "account": 2,
      "site": 2,
      "additional_attributes": "foo",
      "signer_id": "BoomDiggity@pactsafe.com",
      "last_action": "56054c0d643cf1bd55f1ddf5",
      "email": "boomdiggity@pactsafe.com",
      "email_hash": "9cb8869a2b9e86e3577a992c42c0335e",
      "source": "api",
      "updated_time": "2015-09-25T13:28:45.273Z",
      "created_time": "2015-09-25T13:28:45.272Z",
      "sendable": true,
      "name": "boomdiggity@pactsafe.com",
      "uuid": "56054c0d643cf1bd55f1ddf2",
      "action_count": 2
    }
  ]
}}

Path Params

site_id
string
required

Numeric id of the Site to perform action with. Has example value.

Query Params

expand
string

Expands objects that only return an ID. Works up to 2 levels deep.

sort
string

Sort the results of your call by a field in the Request.

filter
string

Filter requests by the various fields.

page
int32

Page number to offset results for pagination. Defaults to 1.

per_page
int32

How many results per page you'd like to return.

 
Suggest Edits

Upsert a Signer

You can pass either a single Signer JSON object or an array of Signer objects with additional_attributes that will be attached to the Signer record in your account. Your response will be an Array of JSON objects corresponding to the data passed.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.pactsafe.com/v1.1/sites/site_id/signers
curl --request POST \
  --url https://api.pactsafe.com/v1.1/sites/site_id/signers
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.pactsafe.com/v1.1/sites/site_id/signers' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/sites/site_id/signers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.pactsafe.com/v1.1/sites/site_id/signers");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/sites/site_id/signers"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "page": 1,
  "per_page": 25,
  "count": 2,
  "data": [
    {
      "account": 2,
      "site": 2,
      "test_mode": false,
      "signer_id": "eric@pactsafe.com",
      "last_action": "58b8db7e379e242c5b189d7d",
      "email": "eric@pactsafe.com",
      "email_hash": "20a9d8f9c7d8415b58ece4621a6517ca",
      "additional_attributes": {
        "city": "Indianapolis",
        "mobile_number": "(317) 403-7298",
        "email": "eric@pactsafe.com",
        "first_name": "Eric",
        "last_name": "Prugh",
        "title": "Person",
        "company": "PactSafe"
      },
      "mobile_number": "+13174037298",
      "notify": true,
      "source": "api",
      "latest_activity_time": "2017-03-03T02:57:02.530Z",
      "updated_time": "2017-03-06T17:34:17.409Z",
      "created_time": "2015-08-28T15:45:09.585Z",
      "sendable": true,
      "name": "Eric Prugh",
      "uuid": "55e0820564a5846a5a0387c4"
    }
  ]
}

Path Params

site_id
string
required

ID of your site. Located here: https://app.pactsafe.com/settings/account

 
Suggest Edits

Get All Activity

Will return all activity for the context of the user (across sites and accounts)

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/activity
curl --request GET \
  --url https://api.pactsafe.com/v1.1/activity
var request = require("request");

var options = { method: 'GET', url: 'https://api.pactsafe.com/v1.1/activity' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/activity")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/activity");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/activity"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "page": 1,
  "per_page": 25,
  "count": 218
}

Query Params

expand
string

Expands objects that only return an activity. Works for up to 2 levels deep

sort
string

Sort the results of your call by a field in the Activity

filter
string

Filter activities by the various fields.

page
int32

Page number to offset results for pagination. Defaults to 1.

per_page
int32

How many responses per page you'd like

 
Suggest Edits

Get Activity events by ID

Get a specific activity event from PactSafe

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/activity/activity_id
curl --request GET \
  --url https://api.pactsafe.com/v1.1/activity/activity_id
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/activity/activity_id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/activity/activity_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/activity/activity_id");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/activity/activity_id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "uuid": "55e0820564a5846a5a0387c4",
    "version": "55dccf164e10cbd8454d7951",
    "custom_data": "foo",
    "connection_data": {
      "page_title": "Responsive website template for products",
      "page_url": "http://localhost/demos/ilawnow/signup.html?__ps-agreements=false",
      "page_domain": "localhost:8888",
      "page_path": "/demos/ilawnow/signup.html",
      "page_query": "foo",
      "hostname": "response.pactsafe.com",
      "referrer": "http://localhost:8888/demos/ilawnow/signup.html?__ps-agreements=false",
      "browser_timezone": "4",
      "browser_locale": "en-us",
      "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36",
      "device_fingerprint": "foo",
      "operating_system": "MacOS",
      "environment": "desktop",
      "screen_color_depth": "24-bit",
      "screen_resolution": "1680x1050",
      "cookies": "foo",
      "remote_address": "172.31.43.73",
      "headers": {
        "host": "response.pactsafe.com",
        "accept": "*/*",
        "accept-encoding": "gzip, deflate",
        "accept-language": "en-US,en;q=0.8",
        "cache-control": "max-age=0",
        "content-type": "text/plain;charset=UTF-8",
        "cookie": "optimizelyEndUserId=oeu1433296317101r0.382926139049232; _hp2_id.2423994111=4391618351370158.1813506391.3204171902; pt_t_53c95246=; pt_s_53c95246=vt=1435609724072&cad=; pt_53c95246=uid=lsqnGTphcTECCE-nqUbNXg&nid=0&vid=r2TNvQmEbE4JxUGHxLDbUw&vn=98&pvn=7&sact=1435609756712&to_flag=1&pl=Tueqa8csuCTUZM9i80R20g*pt*1435609724072; mp_d446a72c79710c1ff563ce3bc715de7f_mixpanel=%7B%22distinct_id%22%3A%20%2214e70807fac4fb-0cfe9f5bb-33607801-fa000-14e70807fad502%22%2C%22%24initial_referrer%22%3A%20%22https%3A%2F%2Fwww.pactsafe.com%2Fwp-admin%2Fadmin.php%3Fpage%3Dhubspot_activate%22%2C%22%24initial_referring_domain%22%3A%20%22www.pactsafe.com%22%7D; hsfirstvisit=https%3A%2F%2Fwww.pactsafe.com%2F|https%3A%2F%2Fwww.pactsafe.com%2Fwp-admin%2Fadmin.php%3Fpage%3Dhubspot_settings|1436406614415; _hp2_id.3407116132=1204811672927428.0882961494.0819404556; optimizelySegments=%7B%222348350439%22%3A%22gc%22%2C%222358480613%22%3A%22referral%22%2C%222360270655%22%3A%22gc%22%2C%222365500299%22%3A%22false%22%2C%222377630339%22%3A%22false%22%2C%222381220090%22%3A%22search%22%7D; optimizelyBuckets=%7B%222765500755%22%3A%222803090039%22%2C%223183320248%22%3A%223185140711%22%7D; __hstc=111610267.698490ece4ce451484142f6f93da26dc.1436406614419.1441998817897.1442241945595.135; __hssrc=1; hubspotutk=698490ece4ce451484142f6f93da26dc; ajs_anonymous_id=%22c7fda6c9-0856-4267-8a81-6926d37b9e6e%22; _gat=1; ajs_group_id=null; ajs_user_id=%22eric%40pactsafe.com%22; _ga=GA1.2.350350235.1433296334; _hp2_ses.1649780267=*; _hp2_id.1649780267=8518489000103054.3630610990.2614759269",
        "origin": "http://localhost:8888",
        "referer": "http://localhost:8888/demos/ilawnow/signup.html?__ps-agreements=false",
        "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36",
        "x-forwarded-for": "104.137.190.15",
        "x-forwarded-port": "80",
        "x-forwarded-proto": "http",
        "content-length": "597",
        "connection": "keep-alive"
      }
    },
    "site": 2,
    "account": 2,
    "signer_id": "eric@pactsafe.com",
    "group": 8,
    "contract": 4,
    "event_type": "agreed",
    "batch": "1442324122234",
    "created_time": "2015-09-15T13:35:22.234Z",
    "download_url": "https://public.pactsafe.com/v1.1/download/activity/55f81e9a949601b976734da9?expires=1483713167826&signature=Jwn5J-tKqcFdd6laixf-spTDo~wsSO-lHrMKnZSFJCiIzPL3Jji7NqGTf0LoFb9fd6E8POtHkJYEQU9RQ9vfOXshgpILXeG5f1LEkQUtb8-n~xhW1D93oCGlpMZ-pjgzHWvWQYAPLq63lWt~ETXVfKNIfz90q4ejtwOzfK-B1-cQQZdiM35tO0J8Rww~ZmZjXCg6fmin5gndcnweaTK2ZCySZGUm4yb330Lg~qfDwx~uS0EfBDkCYg-R72QCmaeeLOkJgs0Lkf-qfSg7fxvgplAgUQOqy28Ep-O9W8-FE22WGLt-CljKIdSWboZLg3NfeHeLdhFHccvcX5OXVosepQ__",
    "id": "55f81e9a949601b976734da9"
  }

Path Params

activity_id
string
required

ID of the Activity you want to return

Query Params

expand
string

Expands objects that only return and ID. Works up to 2 levels deep.

sort
string

Sort the results of your call by a field in the Request.

filter
string

Filter requests by the various fields.

page
int32

Page number to offset results for pagination. Defaults to 1.

per_page
int32

how many results per page you'd like to return.

 
Suggest Edits

Get your Contracts

Note: You can also pass a query string parameter expand=latest_version to return the latest version for each Contract within your response.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/sites/site_id/contracts
curl --request GET \
  --url https://api.pactsafe.com/v1.1/sites/4/contracts
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/sites/4/contracts' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/sites/4/contracts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/sites/4/contracts");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/sites/4/contracts"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "page": 1,
  "per_page": 25,
  "count": 3,
  "data": [
    {
      "description": "voluptatem rem minus veritatis",
      "title": "Privacy Policy",
      "created_by": 1,
      "updated_by": 1,
      "account": 1,
      "site": 1,
      "latest_version": "5581ab8041bdfff40094974f",
      "tags": [
        "foo",
        "foo",
        "foo"
      ],
      "classification": "privacy_policy",
      "updated_time": "2015-06-17T17:24:35.913Z",
      "created_time": "2015-06-17T17:16:48.081Z",
      "id": 1
    }
  ]
}

Path Params

site_id
int32
required

Numeric id of the Site under which your Agreement will be created. Has example value.

Query Params

expand
string

Expands objects that only return an ID. Works up to 2 levels deep.

sort
string

Sort the results of your call by a field in the Request.

filter
string

Filter requests by the various fields.

page
int32

Page number to offset results for pagination. Defaults to 1.

per_page
int32

How many results per page you'd like to return.

 
Suggest Edits

Create a Contract

When creating a Contract, you must specify which Site that Contract will be created within.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.pactsafe.com/v1.1/sites/site_id/contracts
curl --request POST \
  --url https://api.pactsafe.com/v1.1/sites/1/contracts
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.pactsafe.com/v1.1/sites/1/contracts' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/sites/1/contracts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.pactsafe.com/v1.1/sites/1/contracts");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/sites/1/contracts"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "latest_version": {
      "body": "this is the contract body",
      "title": "New Contract",
      "created_by": 1,
      "updated_by": 1,
      "account": 1,
      "site": 1,
      "contract": 6,
      "version_number": 1,
      "notify_respondents": false,
      "status": "draft",
      "published_time": "foo",
      "published": false,
      "updated_time": "2015-06-22T17:44:43.245Z",
      "created_time": "2015-06-22T17:44:43.240Z",
      "id": "5588498b7acfed2d03ac6f9f"
    },
    "title": "New Contract",
    "description": "This is a description of the contract",
    "created_by": 1,
    "updated_by": 1,
    "account": 1,
    "site": 1,
    "tags": [
      "foo",
      "foo",
      "foo",
    ],
    "classification": "other",
    "updated_time": "2015-06-22T17:44:43.271Z",
    "created_time": "2015-06-22T17:44:43.174Z",
    "id": 6
  }

Path Params

site_id
int32
required

Numeric id of the Site under which your Agreement will be created. Has example value.

Body Params

name
string
description
string
signers
array
title
string
body
string
 
Suggest Edits

Create AND Publish a Contract

Note: Only supported for HTML contracts at this time.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.pactsafe.com/v1.1/contracts/publish
curl --request POST \
  --url https://api.pactsafe.com/v1.1/contracts/publish
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.pactsafe.com/v1.1/contracts/publish' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/contracts/publish")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.pactsafe.com/v1.1/contracts/publish");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/contracts/publish"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "latest_version": {
      "body": "this is the contract body",
      "title": "New Contract",
      "created_by": 1,
      "updated_by": 1,
      "account": 1,
      "site": 1,
      "contract": 6,
      "version_number": 1,
      "notify_respondents": false,
      "status": "draft",
      "published_time": "foo",
      "published": false,
      "updated_time": "2015-06-22T17:44:43.245Z",
      "created_time": "2015-06-22T17:44:43.240Z",
      "id": "5588498b7acfed2d03ac6f9f"
    },
    "title": "New Contract",
    "description": "This is a description of the contract",
    "created_by": 1,
    "updated_by": 1,
    "account": 1,
    "site": 1,
    "tags": [
      "foo",
      "foo",
      "foo",
    ],
    "classification": "other",
    "updated_time": "2015-06-22T17:44:43.271Z",
    "created_time": "2015-06-22T17:44:43.174Z",
    "id": 6
  }
}

Body Params

title
string

Title of the contract.

body
string

HTML Contract body to be published.

public
boolean

Optional. Whether or not the Contract should be available on a Legal Center.

tags
array of strings

Optional. Use an array of tags to categorize the contract.

classification
string
 

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

$.get('http://yoursite.com/test/' + id, function(data) {
    console.log(data);
});
Suggest Edits

Get your Contracts

What can you do with this Endpoint?

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/contracts
curl --request GET \
  --url https://api.pactsafe.com/v1.1/contracts
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/contracts' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/contracts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/contracts");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/contracts"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "page": 1,
  "per_page": 25,
  "count": 6,
  "data": [
    {
      "description": "voluptatem rem minus veritatis",
      "title": "Privacy Policy",
      "created_by": 1,
      "updated_by": 1,
      "account": 1,
      "site": 1,
      "latest_version": "5581ab8041bdfff40094974f",
      "tags": [
        "foo",
        "foo",
        "foo"
      ],
      "classification": "privacy_policy",
      "updated_time": "2015-06-17T17:24:35.913Z",
      "created_time": "2015-06-17T17:16:48.081Z",
      "id": 1
    }
  ]
}

Query Params

expand
string

Expands objects that only return and ID. Works up to 2 levels deep

sort
string

Sort the results of your call by a field in the Requests

filter
string

Filter requests by the various fields

page
int32

Page number to offset results for pagination. Defaults to 1.

per_page
int32

How many results per page you'd like to return

 
Suggest Edits

Get a Contract

Note: You can also pass a query string parameter expand=latest_version to return the latest version for each Agreement within your response. Returning the latest version contains an extra property with the Version object containing the latest Version:

{
    "data": {
        "title": "Portal Terms of Use",
        "created_by": 1,
        "updated_by": 1,
        "account": 1,
        "site": 1,
        "latest_version": {
            "body": "Lorem ipsum",
            "title": "Portal Terms of Use",
            "created_by": 1,
            "updated_by": 1,
            "account": 1,
            "site": 1,
            "contract": 4,
            "version_number": 1,
            "notify_respondents": false,
            "status": "draft",
            "published_time": null,
            "published": false,
            "updated_time": "2015-06-17T17:30:45.612Z",
            "created_time": "2015-06-17T17:30:45.609Z",
            "id": "5581aec541bdfff400949754"
        },
        "description": "This is an updated description of the agreement",
        "tags": [
            "privacy",
            "site1",
            "new-tag"
        ],
        "classification": "other",
        "updated_time": "2015-06-23T18:03:37.503Z",
        "created_time": "2015-06-17T17:30:45.587Z",
        "id": 4
    }
}
 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/contracts/contract_id
curl --request GET \
  --url https://api.pactsafe.com/v1.1/contracts/4
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/contracts/4' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/contracts/4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/contracts/4");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/contracts/4"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "title": "Portal Terms of Use",
    "created_by": 1,
    "updated_by": 1,
    "account": 1,
    "site": 1,
    "latest_version": "5581aec541bdfff400949754",
    "tags": [
      "foo",
      "foo",
      "foo"
    ],
    "classification": "other",
    "updated_time": "2015-06-17T17:30:45.621Z",
    "created_time": "2015-06-17T17:30:45.587Z",
    "id": 4
  }
}

Path Params

contract_id
int32
required

Numeric id of the Contract. Has example value.

Query Params

expand
string

Expands objects that only return an ID. Works for up to 2 levels deep.

sort
string

Sort your results of your call by a field in the Request.

page
string

Page number to offset results for pagination. Defaults to 1.

per_page
string

How many results per page you'd like to return.

 
Suggest Edits

Deactivate a Contract

No Contracts in PactSafe are hard deleted. You can deactivate and reactivate a Contract using a DELETE HTTP method and a resource mentioned below, [POST] /v1.1/contracts/{contract_id}/reactivate.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
deletehttps://api.pactsafe.com/v1.1/contracts/contract_id
curl --request DELETE \
  --url https://api.pactsafe.com/v1.1/contracts/4
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.pactsafe.com/v1.1/contracts/4' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/contracts/4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.pactsafe.com/v1.1/contracts/4");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/contracts/4"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Path Params

contract_id
int32
required

Numeric id of the Contract. Has example value.

 
Suggest Edits

Reactivate a Contract

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.pactsafe.com/v1.1/contracts/contract_id/reactivate
curl --request POST \
  --url https://api.pactsafe.com/v1.1/contracts/4/reactivate
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.pactsafe.com/v1.1/contracts/4/reactivate' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/contracts/4/reactivate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.pactsafe.com/v1.1/contracts/4/reactivate");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/contracts/4/reactivate"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "title": "New Contract 2",
    "created_by": 1,
    "updated_by": 1,
    "account": 1,
    "site": 1,
    "latest_version": "5581aec541bdfff400949754",
    "description": "This is an updated description of the agreement",
    "tags": [
      "privacy",
      "privacy",
      "privacy"
    ],
    "classification": "other",
    "updated_time": "2015-06-23T18:03:37.503Z",
    "created_time": "2015-06-17T17:30:45.587Z",
    "id": 4
  }
}

Path Params

contract_id
int32
required

Numeric ID of the Contract. Has example value.

 
Suggest Edits

Create a new Version

There are a couple of important things to note when creating a new Version for a Contract:

  • The latest Version must be published before creating a new Version using the publish endpoint.

  • There is a separate publish endpoint to use when publishing a Version: /v1.1/contracts/{contract_id}/versions/{id}/publish or /v1.1/contracts/{contract_id}/versions/@latest/publish

  • To get the latest Version or which Version is published, simply tack on @latest or @published to your GET call to /v1.1/contracts/{contract_id}/versions/.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.pactsafe.com/v1.1/contracts/contract_id/versions
curl --request POST \
  --url https://api.pactsafe.com/v1.1/contracts/4/versions
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.pactsafe.com/v1.1/contracts/4/versions' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/contracts/4/versions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.pactsafe.com/v1.1/contracts/4/versions");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/contracts/4/versions"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "page": 1,
  "per_page": 25,
  "count": 3,
  "data": [
    {
      "description": "voluptatem rem minus veritatis",
      "title": "Privacy Policy",
      "created_by": 1,
      "updated_by": 1,
      "account": 1,
      "site": 1,
      "latest_version": "5581ab8041bdfff40094974f",
      "tags": [
        "foo",
        "foo",
        "foo"
      ],
      "classification": "privacy_policy",
      "updated_time": "2015-06-17T17:24:35.913Z",
      "created_time": "2015-06-17T17:16:48.081Z",
      "id": 1
    }
  ]
}

Path Params

contract_id
int32
required

Numeric id of the Contract. Has example value.

Body Params

title
string
body
string
notify_respondents
boolean
 
Suggest Edits

Get all Versions for a Contract

There are a couple of important things to note when creating a new Version for a Contract:

  • The latest Version must be published before creating a new Version using the publish endpoint.

  • There is a separate publish endpoint to use when publishing a Version: /v1.1/contracts/{contract_id}/versions/{id}/publish or /v1.1/contracts/{contract_id}/versions/@latest/publish

  • To get the latest Version or which Version is published, simply tack on @latest or @published to your GET call to /v1.1/contracts/{contract_id}/versions/.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/contracts/contract_id/versions
curl --request GET \
  --url https://api.pactsafe.com/v1.1/contracts/4/versions
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/contracts/4/versions' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/contracts/4/versions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/contracts/4/versions");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/contracts/4/versions"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "page": 1,
  "per_page": 25,
  "count": 2,
  "data": [
    {
      "body": "<h1>Updated Terms of Use</h1><p>Agreement Content</p>",
      "title": "Portal Terms of Use - 2015",
      "created_by": 1,
      "updated_by": 1,
      "account": 1,
      "site": 1,
      "contract": 4,
      "version_number": 2,
      "notify_respondents": true,
      "status": "draft",
      "published_time": "foo",
      "published": false,
      "updated_time": "2015-06-23T18:16:36.284Z",
      "created_time": "2015-06-23T18:16:36.280Z",
      "id": "5589a2847acfed2d03ac6fa2"
    },
  ]
}

Path Params

contract_id
int32
required

Numeric id of the Contract. Has example value.

Query Params

page
int32

Page number to offset results for pagination. Defaults to 1.

per_page
int32

How many results per page you'd like to return.

version_number
int32

Version of the contract you are calling

sort
string

Filter request by the various fields.

 
Suggest Edits

Get a Version by Number

Note: This is not by the id of the Version. To publish a Version by id, call /v1.1/versions/{version_id}/publish.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/contracts/contract_id/versions/version_number
curl --request GET \
  --url https://api.pactsafe.com/v1.1/contracts/4/versions/4
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/contracts/4/versions/4' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/contracts/4/versions/4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/contracts/4/versions/4");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/contracts/4/versions/4"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "body": "<h1>Updated Terms of Use</h1><p>Agreement Content</p>",
    "title": "Portal Terms of Use - 2015",
    "created_by": 1,
    "updated_by": 1,
    "account": 1,
    "site": 1,
    "contract": 4,
    "version_number": 2,
    "notify_respondents": true,
    "status": "draft",
    "published_time": "foo",
    "published": false,
    "updated_time": "2015-06-23T18:16:36.284Z",
    "created_time": "2015-06-23T18:16:36.280Z",
    "id": "5589a2847acfed2d03ac6fa2"
  }
}

Path Params

contract_id
int32
required

Numeric id of the Contract. Has example value.

version_number
int32
required

Numeric number of the Version (e.g., version 1 of Agreement with id 1).

 
Suggest Edits

Update a Version by Number

You can update title, body, and notify_respondents.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
patchhttps://api.pactsafe.com/v1.1/contracts/contract_id/versions/version_number
curl --request PATCH \
  --url https://api.pactsafe.com/v1.1/contracts/1/versions/version_number
var request = require("request");

var options = { method: 'PATCH',
  url: 'https://api.pactsafe.com/v1.1/contracts/1/versions/version_number' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/contracts/1/versions/version_number")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://api.pactsafe.com/v1.1/contracts/1/versions/version_number");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/contracts/1/versions/version_number"

response = requests.request("PATCH", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "body": "<h1>Updated Terms of Use</h1><p>Agreement Content UPDATED</p>",
    "title": "Portal Terms of Use - May 2015",
    "created_by": 1,
    "updated_by": 1,
    "account": 1,
    "site": 1,
    "contract": 4,
    "version_number": 2,
    "notify_respondents": false,
    "status": "draft",
    "published_time": "foo",
    "published": false,
    "updated_time": "2015-06-23T18:16:36.284Z",
    "created_time": "2015-06-23T18:16:36.280Z",
    "id": "5589a2847acfed2d03ac6fa2"
  }

Path Params

contract_id
int32
required

Numeric id of the Contract. Has example value.

Query Params

version_number
int32

Numeric number of the Version (e.g., version 1 of Agreement with id 1).

Body Params

title
string
body
string
notify_responses
boolean
 
Suggest Edits

Update a Contract

What can you do with this Endpoint?

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
patchhttps://api.pactsafe.com/v1.1/contracts/contract_id
curl --request PATCH \
  --url https://api.pactsafe.com/v1.1/contracts/4
var request = require("request");

var options = { method: 'PATCH',
  url: 'https://api.pactsafe.com/v1.1/contracts/4' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/contracts/4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://api.pactsafe.com/v1.1/contracts/4");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/contracts/4"

response = requests.request("PATCH", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "description": "This is an updated description of the agreement",
    "title": "New Agreement 2",
    "created_by": 1,
    "updated_by": 1,
    "account": 1,
    "site": 1,
    "latest_version": "5581aec541bdfff400949754",
    "tags": [
      "privacy",
      "privacy",
      "privacy"
    ],
    "classification": "other",
    "updated_time": "2015-06-23T17:57:43.737Z",
    "created_time": "2015-06-17T17:30:45.587Z",
    "id": 4
  }
}

Path Params

contract_id
int32
required

Numeric id of the Contract. Has example value.

Body Params

title
string
description
string
classification
string
tags
string
 
Suggest Edits

Publish a Version

To simplify the publishing of Versions via API, we've added a very simple route to call instead of including {version_number}. Simply POST to /v1.1/contracts/{contract_id}/versions/@latest/publish.

Note: This is not publishing by the id of the Version. To publish a Version by id, call /v1.1/versions/{version_id}/publish.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.pactsafe.com/v1.1/contracts/contract_id/versions/version_number/publish
curl --request POST \
  --url https://api.pactsafe.com/v1.1/contracts/4/versions/4/publish
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.pactsafe.com/v1.1/contracts/4/versions/4/publish' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/contracts/4/versions/4/publish")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.pactsafe.com/v1.1/contracts/4/versions/4/publish");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/contracts/4/versions/4/publish"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Path Params

contract_id
int32
required

Numeric id of the Agreement. Has example value.

version_number
string
required

Numeric number of the Version (e.g., version 1 of Agreement with id 1).

 
Suggest Edits

Get a Version by ID

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/versions/version_id
curl --request GET \
  --url https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "body": "<h1>Updated Terms of Use</h1><p>Agreement Content</p>",
    "title": "Portal Terms of Use - 2015",
    "created_by": 1,
    "updated_by": 1,
    "account": 1,
    "site": 1,
    "contract": 4,
    "version_number": 2,
    "notify_respondents": true,
    "status": "draft",
    "published_time": "foo",
    "published": false,
    "updated_time": "2015-06-23T18:16:36.284Z",
    "created_time": "2015-06-23T18:16:36.280Z",
    "id": "5589a2847acfed2d03ac6fa2"
  }
}

Path Params

version_id
string
required

Varchar id of the Agreement. Has example value.

Query Params

sort
string

Sort the results of your call by a field in the Request.

page
int32

Page number to offset results for pagination. Defaults to 1.

per_page
int32

How many results per page you'd like to return.

 
Suggest Edits

Update a Version by ID

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
patchhttps://api.pactsafe.com/v1.1/versions/version_id
curl --request PATCH \
  --url https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2
var request = require("request");

var options = { method: 'PATCH',
  url: 'https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2"

response = requests.request("PATCH", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "body": "<h1>Updated Terms of Use</h1><p>Agreement Content UPDATED</p>",
    "title": "Portal Terms of Use - May 2015",
    "created_by": 1,
    "updated_by": 1,
    "account": 1,
    "site": 1,
    "contract": 4,
    "version_number": 2,
    "notify_respondents": true,
    "status": "draft",
    "published_time": "foo",
    "published": false,
    "updated_time": "2015-06-23T18:16:36.284Z",
    "created_time": "2015-06-23T18:16:36.280Z",
    "id": "5589a2847acfed2d03ac6fa2"
  }
}

Path Params

version_id
string
required

Varchar id of the Agreement. Has example value.

version_id
int32
required

Varchar id of the Agreement. Has example value.

 
Suggest Edits

Publish a Version by ID

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.pactsafe.com/v1.1/versions/version_id/publish
curl --request POST \
  --url https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2/publish
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2/publish' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2/publish")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2/publish");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/versions/5589a2847acfed2d03ac6fa2/publish"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Path Params

version_id
string
required

Varchar id of the Agreement. Has example value.

 
Suggest Edits

Get your Account Details

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/accounts/account_id
curl --request GET \
  --url https://api.pactsafe.com/v1.1/accounts/1
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/accounts/1' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/accounts/1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/accounts/1");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/accounts/1"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "id": 1,
    "email_reply_address": "team@ilawnow.com",
    "name": "iLawNow",
    "created_by": 1,
    "updated_by": 1,
    "email_display_name": "iLawNow, Inc.",
    "subscription": {
      "payment_interval": "monthly",
      "payment_method": "none",
      "payment_verified_time": "foo",
      "payment_verified": false,
      "expiration_time": "2015-07-12T21:28:39.000Z",
      "expired": false,
      "edition": "trial"
    },
    "reseller": false,
    "updated_time": "2015-06-12T21:28:39.993Z",
    "created_time": "2015-06-12T21:28:39.982Z"
  }
}

Path Params

account_id
int32
required

Numeric id of the Account to perform action with. Has example value.

Query Params

sort
string

Sort your results of your call by a field in the Request

filter
string

Filter requests by the various fields

page
int32

Page number to offset results for pagination. Defaults to 1

per_page
int32

How many results per page you'd like to return

 
Suggest Edits

Update your Account Details

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
patchhttps://api.pactsafe.com/v1.1/accounts/account_id
curl --request PATCH \
  --url https://api.pactsafe.com/v1.1/accounts/1
var request = require("request");

var options = { method: 'PATCH',
  url: 'https://api.pactsafe.com/v1.1/accounts/1' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/accounts/1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://api.pactsafe.com/v1.1/accounts/1");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/accounts/1"

response = requests.request("PATCH", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "id": 1,
    "email_reply_address": "team_new@ilawnow.com",
    "name": "iLawNow, Inc.",
    "created_by": 1,
    "updated_by": 1,
    "email_display_name": "iLawNow, Inc.",
    "subscription": {
      "payment_interval": "monthly",
      "payment_method": "none",
      "payment_verified_time": "foo",
      "payment_verified": false,
      "expiration_time": "2015-07-12T21:28:39.000Z",
      "expired": false,
      "edition": "trial"
    },
    "reseller": false,
    "updated_time": "2015-06-12T21:28:39.993Z",
    "created_time": "2015-06-12T21:28:39.982Z"
  }
}

Path Params

account_id
int32
required

Numeric id of the Account to perform action with. Has example value.

Body Params

company name
string
email
string
last_name
string
first_name
string
phone
string
name
string
address
object
 
 

Request Body

Name
Type
Required

payload

Object

Optional

{
  "email_reply_address": "team_new@ilawnow.com",
  "name": "iLawNow, Inc.",
  "email_display_name": "iLawNow, Inc."
}
Suggest Edits

Retrieve User memberships for an Account

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/accounts/account_id/members
curl --request GET \
  --url https://api.pactsafe.com/v1.1/accounts/1/members
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/accounts/1/members' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/accounts/1/members")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/accounts/1/members");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/accounts/1/members"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{{
  "page": 1,
  "per_page": 25,
  "count": 1,
  "data": [
    {
      "user": {
        "name": "Eric",
        "email": "eric@pactsafe.com",
        "profiles": [
          {
            "id": "eric@pactsafe.com",
            "displayName": "Eric",
            "updated_time": "2015-06-12T21:28:14.680Z",
            "created_time": "2015-06-12T21:28:14.680Z",
            "photos": [
              "foo",
              "foo",
              "foo"
            ],
            "emails": [
              "foo",
              "foo",
              "foo"
            ],
            "provider": "local"
          }
        ],
        "time_zone": "EDT",
        "locale": "en-US",
        "verified_time": "2015-06-12T21:29:46.955Z",
        "verified": true,
        "id": 1
      },
      "account": 1,
      "membership_type": "account",
      "updated_time": "2015-06-12T21:28:40.038Z",
      "created_time": "2015-06-12T21:28:40.036Z",
      "role": "owner",
      "id": "557b4f08e1f61b9484f2296b"
    }
  ]
}}

Path Params

account_id
int32
required

Numeric id of the Account to perform action with. Has example value.

Query Params

sort
string

Sort the results of your call by a field in the Request

filter
string

Filter requests by the various fields.

page
int32

Page number to offset results for pagination. Defaults to 1.

per_page
int32

How many results per page you'd like to return

 
Suggest Edits

Get a Group

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/groups/group_id
curl --request GET \
  --url https://api.pactsafe.com/v1.1/groups/1
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/groups/1' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/groups/1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/groups/1");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/groups/1"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "key": "agreement-group",
    "description": "Agreement group in my site",
    "name": "Agreement Group",
    "created_by": 1,
    "updated_by": 1,
    "account": 1,
    "site": 1,
    "contracts": [
      "foo",
      "foo",
      "foo"
    ],
    "alert_message": "You must agree to our legal terms before proceeding. My bad!",
    "block_submission": true,
    "style": "link",
    "type": "clickwrap",
    "paused": false,
    "published_time": "foo",
    "published": false,
    "updated_time": "2015-06-22T14:12:39.513Z",
    "created_time": "2015-06-22T14:12:39.511Z",
    "id": 6
  }
}

Path Params

group_id
int32
required

Numeric id of the AgreementGroup to perform action with. Has example value.

Query Params

expand
string

Expands objects that only return an ID. Works up to 2 levels deep.

sort
string

Sort the results of your call by a field in the Request.

filter
string

Filter requests by the various fields

page
int32

Page number to offset results for pagination. Defaults to 1.

per_page
int32

How many results per page you'd like to return.

 
Suggest Edits

Create a new Group

AgreementGroups can be shown in either an Account context or a Site context — depending on what you're interested in updating or retrieving. By doing a POST call to /v1.1/agreementGroups

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.pactsafe.com/v1.1/groups
curl --request POST \
  --url https://api.pactsafe.com/v1.1/groups
var request = require("request");

var options = { method: 'POST', url: 'https://api.pactsafe.com/v1.1/groups' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/groups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.pactsafe.com/v1.1/groups");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/groups"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "data": {
    "description": "Displays contracts if there's a new version when user logs in.",
    "key": "login-clickwrap",
    "name": "App Login",
    "created_by": 2,
    "updated_by": 45,
    "account": 2,
    "site": 2,
    "published_by": 45,
    "container_selector": "agreements",
    "form_selector": "form1",
    "inline_styles": true,
    "signer_id_selector": "login-email",
    "acceptance_language": "foo",
    "fields": [
      "foo",
      "foo",
      "foo"
    ],
    "dynamic": false,
    "contracts": [
      316,
      316,
      316
    ],
    "always_visible": false,
    "open_legal_center": true,
    "position": "auto",
    "confirmation_email": false,
    "alert_message": "Before you can submit this form, you must accept all of our legal agreements.",
    "display_all": false,
    "auto_run": true,
    "force_scroll": false,
    "block_submission": true,
    "style": "checkbox",
    "type": "clickwrap",
    "tags": [
      "foo",
      "foo",
      "foo"
    ],
    "paused": false,
    "published_time": "2016-09-29T14:09:51.754Z",
    "published": true,
    "updated_time": "2016-09-29T14:09:51.754Z",
    "created_time": "2015-08-18T13:55:02.831Z",
    "published_endpoint": "groups/login-clickwrap/group.js",
    "id": 4
  }
}
 
Suggest Edits

Update a Group

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
patchhttps://api.pactsafe.com/v1.1/groups/group_id
curl --request PATCH \
  --url https://api.pactsafe.com/v1.1/groups/1
var request = require("request");

var options = { method: 'PATCH',
  url: 'https://api.pactsafe.com/v1.1/groups/1' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/groups/1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://api.pactsafe.com/v1.1/groups/1");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/groups/1"

response = requests.request("PATCH", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Path Params

group_id
int32
required

Numeric id of the AgreementGroup to perform action with. Has example value.

group_id
int32
required

Numeric id of the AgreementGroup to perform action with. Has example value.

 
Suggest Edits

Get Groups for your Account

AgreementGroups can be shown in either an Account context or a Site context — depending on what you're interested in updating or retrieving. By doing a POST call to /v1.1/agreementGroups

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/groups
curl --request GET \
  --url https://api.pactsafe.com/v1.1/groups
var request = require("request");

var options = { method: 'GET', url: 'https://api.pactsafe.com/v1.1/groups' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/groups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/groups");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/groups"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "page": 1,
  "per_page": 3,
  "count": 48,
  "data": [
    {
      "description": "foo",
      "key": "ps-signup-clickwrap",
      "name": "App Signup Clickwrap",
      "created_by": 2,
      "updated_by": 6,
      "account": 1,
      "site": 1,
      "container_selector": "ps-agreements-container",
      "form_selector": "ps-register-form",
      "published_by": 6,
      "inline_styles": true,
      "signer_id_selector": "ps-register-email",
      "contracts": [
        1,
        1,
        1
      ],
      "always_visible": false,
      "open_legal_center": true,
      "position": "auto",
      "alert_message": "Please accept our legal agreements before continuing.",
      "display_all": true,
      "auto_run": true,
      "block_submission": true,
      "style": "combined",
      "type": "clickwrap",
      "paused": false,
      "published_time": "2016-02-03T21:38:57.597Z",
      "published": true,
      "updated_time": "2016-02-03T21:38:57.597Z",
      "created_time": "2015-08-17T19:45:34.851Z",
      "published_endpoint": "groups/ps-signup-clickwrap/group.js",
      "id": 1
    }
  ]
}

Path Params

expand
string
required

Expands objects that only return an ID. Works for up to 2 levels deep.

sort
string
required

Sort your results of your call by a field in the Request.

filter
string
required

Filter requests by the various fields.

page
string
required

Page number to offset results for pagination. Defaults to 1.

per_page
int32
required

How many results per page you'd like to return.

 
Suggest Edits

Get Groups for your Site

By adding the Site id in the endpoint you're calling, we will automatically return all Groups within that Site.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.pactsafe.com/v1.1/sites/site_id/groups
curl --request GET \
  --url https://api.pactsafe.com/v1.1/sites/1/groups
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.pactsafe.com/v1.1/sites/1/groups' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.pactsafe.com/v1.1/sites/1/groups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.pactsafe.com/v1.1/sites/1/groups");

xhr.send(data);
import requests

url = "https://api.pactsafe.com/v1.1/sites/1/groups"

response = requests.request("GET", url)