API Documentation (Sample)
The Meiosis Api provides full access to read, create, and manage your team’s data and configuration. This document serves as an example of interacting with our API.
The full API Documentation is available to all registered users at https://app.petrisuite.com/support/docs
Customers ¶
Collections ¶
When not dealing with a specified customer, you’ll want to use the customer collection endpoint.
Fetch CollectionGET/customers/{?per_page,page,email,custom_attribute_key}
Returns an array of customers (up to all customers) based on the filters passed in. If per_page
is provided, paginated set will be returned, including metadata about the current page selected and total pages available.
Example URI
string
(optional)Search terms for filtering result set. While
email
is the example used here, you can also usefirst
,middle
,last
, ororganization_id
- custom_attribute_key
string
(optional)Search terms for filtering result set based on custom attributes that your team has created. Any custom attribute key can be used.
- per_page
number
(optional) Default: 25How many results you want per page. If omitted, all matching data will be returned
- page
number
(optional) Default: 1
Without Pagination
Headers
Content-Type: application/json
200
Headers
Content-Type: application/json
Body
[
{
"id": "xxxxxx",
"email": "[email protected]",
"first": "John",
"middle": "Stephen",
"last": "Doe",
"organization_id": "sdf34g3",
"assigned_user": 562,
"created_at": "2016-09-12 18:45:29",
"updated_at": "2016-09-12 18:45:29"
},
{
"id": "xxxxxx",
"email": "[email protected]",
"first": "John",
"middle": "Stephen",
"last": "Doe",
"organization_id": "sdf34g3",
"assigned_user": 562,
"created_at": "2016-09-12 18:45:29",
"updated_at": "2016-09-12 18:45:29"
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
With Pagination
Headers
Content-Type: application/json
200
Headers
Content-Type: application/json
Body
{
"meta": {
"total": 250297,
"current_page": 1,
"total_pages": 50060
},
"customers": [
{
"id": "xxxxxx",
"email": "[email protected]",
"first": "John",
"middle": "Stephen",
"last": "Doe",
"organization_id": "sdf34g3",
"assigned_user": 562,
"created_at": "2016-09-12 18:45:29",
"updated_at": "2016-09-12 18:45:29"
},
{
"id": "xxxxxx",
"email": "[email protected]",
"first": "John",
"middle": "Stephen",
"last": "Doe",
"organization_id": "sdf34g3",
"assigned_user": 562,
"created_at": "2016-09-12 18:45:29",
"updated_at": "2016-09-12 18:45:29"
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"meta": {
"type": "object",
"properties": {
"total": {
"type": "number",
"description": "Total number of records that match your parameters"
},
"current_page": {
"type": "number",
"description": "Current page of results being sent"
},
"total_pages": {
"type": "number",
"description": "Total number of pages in result set"
}
}
},
"customers": {
"type": "array"
}
}
}
Create a New CustomerPOST/customers
Create a new customer record for your team
Example URI
Headers
Content-Type: application/json
Body
{
"email": "[email protected]",
"first": "John",
"middle": "James",
"last": "Doe",
"assignedUser": 1,
"organizationId": "o2iu37908f72"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"email": {
"type": "string",
"description": "Email Address for the customer"
},
"first": {
"type": "string",
"description": "First name"
},
"middle": {
"type": "string",
"description": "Middle name"
},
"last": {
"type": "string",
"description": "Last name"
},
"assignedUser": {
"type": "number",
"description": "Assigned User / Owner ID"
},
"organizationId": {
"type": "string",
"description": "Organization ID that customer is a member of"
}
},
"required": [
"email"
]
}
200
Headers
Content-Type: application/json
Body
{
"success": "Success message",
"id": "sdf34g3"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"success": {
"type": "string",
"description": "A Success Message"
},
"id": {
"type": "string",
"description": "The ID of the customer that was updated"
}
}
}
Customer Fields ¶
List FieldsGET/customers/fields
Fetches all fields available / required for creation of a new record
Example URI
200
Headers
Content-Type: application/json
Body
{
"email": {
"name": "Email Address",
"required": true,
"type": "email"
},
"attr-source": {
"name": "Source",
"required": false,
"type": "list",
"options": [
"Option",
"Option",
"Option"
]
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"email": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Friendly name of attribute"
},
"required": {
"type": "boolean",
"description": "If the attribute is required to create a record"
},
"type": {
"type": "string",
"description": "Type information of the field"
}
},
"description": "Attribute Key"
},
"attr-source": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Friendly name of attribute"
},
"required": {
"type": "boolean",
"description": "If the attribute is required to create a record"
},
"type": {
"type": "string",
"description": "Type information of the field"
},
"options": {
"type": "array",
"description": "Array of custom options for list-type attributes"
}
},
"description": "A custom attribute Key"
}
}
}
Single Customer ¶
For customer creation, see the POST method of Customer Collections.
Update a CustomerPOST/customers/{id}
Updates an existing customer record
Example URI
- id
string
(required) Example: xxxxxxCustomer ID to Update
Headers
Content-Type: application/json
Body
{
"email": "[email protected]",
"first": "John",
"middle": "James",
"last": "Doe",
"assignedUser": 1,
"organizationId": "xxxxxx"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"email": {
"type": "string",
"description": "Email Address for the customer"
},
"first": {
"type": "string",
"description": "First name"
},
"middle": {
"type": "string",
"description": "Middle name"
},
"last": {
"type": "string",
"description": "Last name"
},
"assignedUser": {
"type": "number",
"description": "Assigned User / Owner ID"
},
"organizationId": {
"type": "string",
"description": "Organization ID that customer is a member of"
}
}
}
200
Headers
Content-Type: application/json
Body
{
"success": "Success message",
"id": "sdf34g3"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"success": {
"type": "string",
"description": "A Success Message"
},
"id": {
"type": "string",
"description": "The ID of the customer that was updated"
}
}
}
Fetch a CustomerGET/customers/{id}
Fetches all information about a customer
Example URI
- id
string
(required) Example: xxxxxxCustomer ID
200
Headers
Content-Type: application/json
Body
{
"id": "xxxxxx",
"email": "[email protected]",
"first": "John",
"middle": "Stephen",
"last": "Doe",
"organization_id": "sdf34g3",
"assigned_user": 562,
"created_at": "2016-09-12 18:45:29",
"updated_at": "2016-09-12 18:45:29",
"interactions": [
{
"customer_id": "xxxxxx",
"description": "Filled out lead gen form",
"source": "Website",
"created_at": "2016-09-12 18:45:29"
},
{
"customer_id": "xxxxxx",
"description": "Filled out lead gen form",
"source": "Website",
"created_at": "2016-09-12 18:45:29"
}
],
"organization": {
"id": "xxxxxx",
"name": "Company Co Inc",
"address": "123 Anystreet",
"city": "Townsville",
"state": "OH",
"zip": "45342",
"created_at": "2016-09-12 18:45:29",
"updated_at": "2016-09-12 18:45:29"
},
"tags": [
"Tag",
"Tag",
"Tag"
],
"notes": []
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"first": {
"type": "string"
},
"middle": {
"type": "string"
},
"last": {
"type": "string"
},
"organization_id": {
"type": [
"string",
"null"
],
"description": "The customer's organization ID"
},
"assigned_user": {
"type": [
"number",
"null"
],
"description": "ID of the assigned user / owner"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"interactions": {
"type": "array"
},
"organization": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"address": {
"type": "string"
},
"city": {
"type": "string"
},
"state": {
"type": "string"
},
"zip": {
"type": "string"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"required": [
"name"
]
},
"tags": {
"type": "array"
},
"notes": {}
},
"required": [
"email"
]
}
Delete a CustomerDELETE/customers/{id}
Deletes a customer record
Example URI
- id
string
(required) Example: xxxxxxCustomer ID
200
Headers
Content-Type: application/json
Body
{
"success": "Customer Deleted"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"success": {
"type": "string",
"description": "Success Message"
}
}
}
Single Customer Avatar ¶
Used to update a customer’s avatar (photo).
Update AvatarPOST/customers/{id}/avatar
Updates the customer’s photo. Accepts Image File Types (jpg, png).
Example URI
- id
string
(required) Example: xxxxxxCustomer ID
Headers
Content-Type: multipart/form-data
Body
{
"file": "USE <INPUT TYPE=FILE />"
}
Schema
{
"type": "object",
"properties": {
"file": {
"type": "string",
"description": "A file Input"
}
},
"$schema": "http://json-schema.org/draft-04/schema#"
}
200
Headers
Content-Type: application/json
Body
{
"success": "File Uploaded",
"url": "Hello, world!"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"success": {
"type": "string",
"description": "A success message"
},
"url": {
"type": "string",
"description": "The url of the uploaded file."
}
}
}
Latest Customers ¶
Recently Updated CustomersGET/customers/latest{?limit}
Returns a list of customers that have recently been updated
Example URI
- limit
number
(optional) Example: 20How many records to return
200
Headers
Content-Type: application/json
Body
[
{
"id": "xxxxxx",
"email": "[email protected]",
"first": "John",
"middle": "Stephen",
"last": "Doe",
"organization_id": "sdf34g3",
"assigned_user": 562,
"created_at": "2016-09-12 18:45:29",
"updated_at": "2016-09-12 18:45:29"
},
{
"id": "xxxxxx",
"email": "[email protected]",
"first": "John",
"middle": "Stephen",
"last": "Doe",
"organization_id": "sdf34g3",
"assigned_user": 562,
"created_at": "2016-09-12 18:45:29",
"updated_at": "2016-09-12 18:45:29"
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
Customer Activity ¶
Recent Customer ActivityGET/customers/activity
Fetches recent customer activity for your team
Example URI
200
Headers
Content-Type: application/json
Body
[
{
"id": "xxxxxx",
"email": "[email protected]",
"name": "John Doe",
"description": "Filled out a form",
"source": "Website",
"date": {
"date": "2016-05-23 16:30:49.000000",
"timezone": "UTC"
},
"avatar": "//meiosis.io/filepath.jpg"
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}