Core API Documentation
Person
Resource model for a business-scoped
Front —
GET /api/v2/front/people/:id
and
GET /api/v2/front/people/me
return a root
Desk —
GET /api/v2/desk/people
emits
Front
GET /api/v2/front/people/:id
GET /api/v2/front/people/me
Returns a single-element
Parameters
| with_dependents | boolean | Return dependent information |
|---|
REQUEST
$ curl https://mybiz.pike13.com/api/v2/front/people/me \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"people": [
{
"id": 1,
"name": "John Staff",
"pronoun": null,
"first_name": "John",
"middle_name": null,
"last_name": "Staff",
"is_schedulable": true,
"email": "johnstaff@example.com",
"address": "400 Broad St, Seattle, WA 98109",
"secondary_info_field": "Unlimited Membership",
"birthdate": "1980-01-01",
"profile_photo": {
"x50": "https://d1nqv8xdwxria6.cloudfront.net/uploads/profile_photo/image/f1150c38-5e62-4c4b-a701-473e3f586e1e/image_profile_x50.jpg",
"x100": "https://d1nqv8xdwxria6.cloudfront.net/uploads/profile_photo/image/f1150c38-5e62-4c4b-a701-473e3f586e1e/image_profile_x100.jpg",
"x200": "https://d1nqv8xdwxria6.cloudfront.net/uploads/profile_photo/image/f1150c38-5e62-4c4b-a701-473e3f586e1e/image_profile_x200.jpg",
"x400": "https://d1nqv8xdwxria6.cloudfront.net/uploads/profile_photo/image/f1150c38-5e62-4c4b-a701-473e3f586e1e/image_profile_x400.jpg"
},
"custom_fields": [
{
"id": 1,
"custom_field_id": 5,
"name": "Favorite Color",
"value": "blue"
}
],
"balances": [
{
"id": 2,
"balance_cents": 6000,
"currency_code": "USD",
"type": "credit"
}
]
}
]
}
Desk
GET /api/v2/desk/people
Paginated collection of client-scoped people (
Parameters
| created_since | timestamp | Filter to people created since the given timestamp. |
|---|---|---|
| updated_since | timestamp | Filter to people updated since the given timestamp. |
| is_member | boolean | Filter to people with a current membership |
| include_relationships | boolean | Include providers and dependents for each person. |
| include_balances | boolean | Include balances for each person. |
| include_last_note_timestamp | boolean | Include the timestamp of the most recent note for each person. |
| sort | string | Sort results by the given attributes and directions. Attributes can be |
REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/people \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"people": [
{
"id": 3,
"name": "John Client",
"pronoun": null,
"first_name": "John",
"middle_name": null,
"last_name": "Client",
"is_schedulable": true,
"membership": null,
"email": "johnclient@example.com",
"secondary_info_field": "No Membership",
"hidden_at": null,
"business_id": 1,
"updated_at": "2014-09-16T14:25:10-07:00",
"birthdate": null,
"location_id": null,
"custom_fields": []
},
{
"id": 48,
"name": "Jane Client",
"pronoun": null,
"first_name": "Jane",
"middle_name": null,
"last_name": "Client",
"is_schedulable": true,
"membership": null,
"email": "janeclient@example.com",
"secondary_info_field": "No Membership",
"hidden_at": null,
"business_id": 1,
"updated_at": "2014-09-17T14:19:12-07:00",
"birthdate": null,
"location_id": 1,
"profile_photo": {
"x50": "https://d1nqv8xdwxria6.cloudfront.net/uploads/profile_photo/image/f1150c38-5e62-4c4b-a701-473e3f586e1e/image_profile_x50.jpg",
"x100": "https://d1nqv8xdwxria6.cloudfront.net/uploads/profile_photo/image/f1150c38-5e62-4c4b-a701-473e3f586e1e/image_profile_x100.jpg",
"x200": "https://d1nqv8xdwxria6.cloudfront.net/uploads/profile_photo/image/f1150c38-5e62-4c4b-a701-473e3f586e1e/image_profile_x200.jpg",
"x400": "https://d1nqv8xdwxria6.cloudfront.net/uploads/profile_photo/image/f1150c38-5e62-4c4b-a701-473e3f586e1e/image_profile_x400.jpg"
},
"custom_fields": [
{
"id": 3,
"custom_field_id": 5,
"name": "Favorite Color",
"value": ""
}
]
}
],
"total_count": 2
}
GET /api/v2/desk/people/:id
GET /api/v2/desk/people/me
Single-resource read: one
REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/people/48 \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"people": [
{
"id": 48,
"pronoun": null,
"first_name": "Jane",
"middle_name": null,
"last_name": "Client",
"is_schedulable": true,
"name": "Jane Client",
"membership": "No Membership",
"is_member": false,
"joined_at": "2014-12-10T19:34:16Z",
"phone": "206-555-1212",
"email": "janeclient@example.com",
"address": "123 Pike Street\nSuite 456\nSeattle, WA 98101, United States of America",
"street_address": "123 Pike Street",
"street_address2": "Suite 456",
"city": "Seattle",
"state_code": "WA",
"postal_code": "98101",
"secondary_info_field": "No Membership",
"timezone": "America/Los_Angeles",
"business_id": 1,
"updated_at": "2014-12-10T19:34:16Z",
"deleted_at": null,
"hidden_at": null,
"birthdate": null,
"location_id": 1,
"profile_photo": {
"x50": "https://d1nqv8xdwxria6.cloudfront.net/uploads/profile_photo/image/f1150c38-5e62-4c4b-a701-473e3f586e1e/image_profile_x50.jpg",
"x100": "https://d1nqv8xdwxria6.cloudfront.net/uploads/profile_photo/image/f1150c38-5e62-4c4b-a701-473e3f586e1e/image_profile_x100.jpg",
"x200": "https://d1nqv8xdwxria6.cloudfront.net/uploads/profile_photo/image/f1150c38-5e62-4c4b-a701-473e3f586e1e/image_profile_x200.jpg",
"x400": "https://d1nqv8xdwxria6.cloudfront.net/uploads/profile_photo/image/f1150c38-5e62-4c4b-a701-473e3f586e1e/image_profile_x400.jpg"
},
"custom_fields": [
{
"id": 9,
"value": "blue",
"name": "Shirt color"
},
{
"id": 10,
"value": "L",
"name": "Shirt size"
}
],
"dependents": [],
"providers": [
{
"id": 47,
"pronoun": null,
"first_name": "Momma",
"middle_name": null,
"last_name": "Client",
"is_schedulable": true,
"guardian_name": null,
"name": "Momma Client",
"membership": "No Membership",
"is_member": false,
"joined_at": "2014-12-10T19:34:16Z",
"phone": null,
"email": "mommaclient@example.com",
"address": null,
"secondary_info_field": "No Membership",
"guardian_email": null,
"timezone": "America/Los_Angeles",
"business_id": 2,
"updated_at": "2014-12-10T19:34:16Z",
"deleted_at": null,
"hidden_at": null,
"birthdate": null,
"location_id": 1000,
"custom_fields": []
}
],
"location": {
"id": 1,
"name": "West Location",
"slug": "west-location"
},
"balances": [
{
"id": 2,
"balance_cents": 6000,
"currency_code": "USD",
"type": "credit"
}
]
}
]
}
GET /api/v2/desk/people/search?q=:query
Client-scoped search (same
| q | string | Search query. Required. When you search by phone number, only digits are allowed. See the below example. |
|---|---|---|
| fields | comma delimited string | Fields to be searched. Can be any of the following: |
REQUEST
$ curl https://myzbiz.pike13.com/api/v2/desk/people/search?q=jane \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"results": [
{
"score": 1.3977994,
"person": {
"id": 56,
"pronoun": null,
"first_name": "Jane",
"middle_name": null,
"last_name": "Client",
"is_schedulable": true,
"name": "Jane Client",
"membership": "No Membership",
"is_member": false,
"joined_at": "2014-12-10T00:29:46Z",
"email": "janeclient@example.com",
"secondary_info_field": "No Membership",
"timezone": "Asia/Yerevan",
"business_id": 1,
"updated_at": "2014-12-10T00:31:58Z",
"deleted_at": null,
"hidden_at": null,
"birthdate": null,
"location_id": 1,
"custom_fields": [
{
"id": 5,
"value": "blue",
"name": "Favorite Color"
}
]
}
}
],
"total_count": 1
}
REQUEST
$ curl "https://myzbiz.pike13.com/api/v2/desk/people/search?q=1234567890&fields=phone" \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"results": [
{
"score": 1.3977994,
"person": {
"id": 56,
"pronoun": null,
"first_name": "Jane",
"middle_name": null,
"last_name": "Client",
"is_schedulable": true,
"name": "Jane Client",
"membership": "No Membership",
"is_member": false,
"joined_at": "2014-12-10T00:29:46Z",
"phone": "123-456-7890",
"email": "janeclient@example.com",
"secondary_info_field": "No Membership",
"timezone": "Asia/Yerevan",
"business_id": 1,
"updated_at": "2014-12-10T00:31:58Z",
"deleted_at": null,
"hidden_at": null,
"birthdate": null,
"location_id": 1,
"custom_fields": [
{
"id": 5,
"value": "blue",
"name": "Favorite Color"
}
]
}
}
],
"total_count": 1
}
POST /api/v2/desk/people
Create a Person. If dependent information is included, will also create the dependents. Dependents have the same attributes available.
Note: The single 'address' field is deprecated. Please use the separate address fields (street_address, city, etc) instead.
Note: Country code is optional and inherits from primary business by default. If you provide one you must use the alpha-2 country code from the ISO 3166-1 standard. Reference here.
Attributes
| pronoun | string | Client's preferred pronouns. | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| first_name | string | Required. Client's first name. | ||||||||||||||||||||||||
| middle_name | string | Client's middle name. | ||||||||||||||||||||||||
| last_name | string | Required. Client's last name. | ||||||||||||||||||||||||
| is_schedulable | boolean | Optional. On create, if the key is omitted or | ||||||||||||||||||||||||
| is_client | boolean | Optional. Boolean; controls membership in client-only scopes (e.g. Desk index/search). Same create/update rules as | ||||||||||||||||||||||||
| string | Client's email address. Email address formatting is enforced. | |||||||||||||||||||||||||
| street_address | string | First line of client's physical address. | ||||||||||||||||||||||||
| street_address2 | string | Second line of client's physical address (apt, suite, etc). | ||||||||||||||||||||||||
| city | string | City portion of client's address. | ||||||||||||||||||||||||
| state_code | string | State/province code (e.g. 'WA', 'BC'). | ||||||||||||||||||||||||
| postal_code | string | Postal/ZIP code. | ||||||||||||||||||||||||
| country_code | string | Two-letter country code (e.g. 'us', 'ca'). Defaults to business country. | ||||||||||||||||||||||||
| address | string | DEPRECATED: Legacy combined address field. Use separate address fields instead. | ||||||||||||||||||||||||
| phone | string | Client's phone number. | ||||||||||||||||||||||||
| birthdate | date | Client's date of birth. | ||||||||||||||||||||||||
| guardian_name | string | Full name of client's guardian. | ||||||||||||||||||||||||
| guardian_email | string | Email address of client's guardian. | ||||||||||||||||||||||||
| location_id | integer | Location ID for client's home location. | ||||||||||||||||||||||||
| joined_at | timestamp | Timestamp for when the client joined the business. Default to current time. | ||||||||||||||||||||||||
| send_invite | boolean | Send the client a welcome email from Pike13 | ||||||||||||||||||||||||
| skip_complimentary_passes | boolean | Do not issue any complimentary passes to the client. | ||||||||||||||||||||||||
| custom_fields | collection | Collection of custom field IDs and values.
| ||||||||||||||||||||||||
| dependents | collection | Collection of dependents. All of the same fields for a person are available for a dependent.
|
REQUEST
$ curl -X POST https://myzbiz.pike13.com/api/v2/desk/people \
-H "Authorization: Bearer XXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"person": {
"first_name": "Jane",
"last_name": "Client",
"is_schedulable": true,
"phone": "206-555-1212",
"email": "janeclient@example.com",
"street_address": "123 Pike Street",
"street_address2": "Suite 456",
"city": "Seattle",
"state_code": "WA",
"postal_code": "98101",
"country_code": "us",
"custom_fields": [ {"id": 9, "value": "blue"}, {"id": 10, "value": "L"}],
"dependents": [
{
"first_name": "Child1",
"last_name": "Client",
"is_schedulable": true,
"birthdate": "2008-01-21"
},
{
"first_name": "Child2",
"last_name": "Client",
"is_schedulable": false,
"birthdate": "Jan 23, 2010"
}
]
}
}'
RESPONSE
{
"people": [
{
"id": 27,
"pronoun": null,
"first_name": "Jane",
"middle_name": null,
"last_name": "Client",
"is_schedulable": true,
"name": "Jane Client",
"membership": "No Membership",
"is_member": false,
"joined_at": "2014-12-10T19:34:16Z",
"phone": "206-555-1212",
"email": "janeclient@example.com",
"address": "123 Pike Street\nSuite 456\nSeattle, WA 98101, United States of America",
"street_address": "123 Pike Street",
"street_address2": "Suite 456",
"city": "Seattle",
"state_code": "WA",
"postal_code": "98101",
"secondary_info_field": "No Membership",
"timezone": "America/Los_Angeles",
"business_id": 1,
"updated_at": "2014-12-10T19:34:16Z",
"deleted_at": null,
"hidden_at": null,
"birthdate": null,
"location_id": 1,
"custom_fields": [
{
"id": 9,
"value": "blue",
"name": "Shirt color"
},
{
"id": 10,
"value": "L",
"name": "Shirt size"
}
],
"dependents": [
{
"id": 28,
"pronoun": null,
"first_name": "Child1",
"middle_name": null,
"last_name": "Client",
"is_schedulable": true,
"name": "Child1 Client",
"membership": "No Membership",
"is_member": false,
"joined_at": "2014-12-10T19:34:16Z",
"phone": null,
"email": null,
"secondary_info_field": "No Membership",
"timezone": "America/Los_Angeles",
"business_id": 1,
"updated_at": "2014-12-10T19:34:16Z",
"deleted_at": null,
"hidden_at": null,
"birthdate": "2008-01-21",
"location_id": 1,
"custom_fields": []
},
{
"id": 29,
"pronoun": null,
"first_name": "Child2",
"middle_name": null,
"last_name": "Client",
"is_schedulable": false,
"name": "Child2 Client",
"membership": "No Membership",
"is_member": false,
"joined_at": "2014-12-10T19:34:16Z",
"phone": null,
"email": null,
"secondary_info_field": "No Membership",
"timezone": "America/Los_Angeles",
"business_id": 1,
"updated_at": "2014-12-10T19:34:16Z",
"deleted_at": null,
"hidden_at": null,
"birthdate": "2010-01-23",
"location_id": 1,
"custom_fields": []
}
],
"providers": [],
"location": {
"id": 1,
"name": "West Location",
"slug": "west-location"
}
}
]
}
PUT /api/v2/desk/people/:id
Updates a Person. Dependents can be added to the Person using the
Partial update via strong parameters: only keys present under
Partial update — representative keys
| is_schedulable | boolean | Optional. If omitted or |
|---|---|---|
| is_client | boolean | Optional. Same update rules as |
Note: PUT requests only allow attaching or detaching existing Persons as dependents. You cannot edit the attributes of a dependent in a PUT request.
Note: The single 'address' field is deprecated. Please use the separate address fields (street_address, city, etc) instead.
Note: Country code is optional and inherits from primary business by default. If you provide one you must use the alpha-2 country code from the ISO 3166-1 standard. Reference here.
REQUEST
$ curl -X PUT https://myzbiz.pike13.com/api/v2/desk/people/27 \
-H "Authorization: Bearer XXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{"person":{"middle_name": "May", "custom_fields": [ {"id": 9, "value": "blue"}, {"id": 10, "value": "L"}]}, "dependent_ids": "53,33"}'
RESPONSE
{
"people": [
{
"id": 27,
"pronoun": null,
"first_name": "Jane",
"middle_name": "May",
"last_name": "Client",
"is_schedulable": true,
"name": "Jane Client",
"membership": "No Membership",
"is_member": false,
"joined_at": "2014-12-10T19:34:16Z",
"email": "janeclient@example.com",
"address": "123 Pike Street\nSuite 456\nSeattle, WA 98101, United States of America",
"street_address": "123 Pike Street",
"street_address2": "Suite 456",
"city": "Seattle",
"state_code": "WA",
"postal_code": "98101",
"secondary_info_field": "No Membership",
"timezone": "America/Los_Angeles",
"business_id": 1,
"updated_at": "2014-12-10T19:34:16Z",
"deleted_at": null,
"hidden_at": null,
"birthdate": null,
"location_id": 1,
"custom_fields": [
{
"id": 9,
"value": "blue",
"name": "Shirt color"
},
{
"id": 10,
"value": "L",
"name": "Shirt size"
}
],
"dependents": [
{
"id": 53,
"pronoun": null,
"first_name": "Johnny",
"middle_name": null,
"last_name": "Depedendent",
"is_schedulable": true,
"guardian_name": null,
"name": "Johnny Dependent",
"membership": "No Membership",
"is_member": false,
"joined_at": "2018-04-30T23:08:09Z",
"phone": "049.460.9886 x010",
"email": "johnny.dependent@pike13.com",
"address": "456 Kid Street\nApt 789\nSeattle, WA 98101, United States of America",
"street_address": "456 Kid Street",
"street_address2": "Apt 789",
"city": "Seattle",
"state_code": "WA",
"postal_code": "98101",
"secondary_info_field": "No Membership",
"guardian_email": null,
"timezone": "America/Los_Angeles",
"business_id": 1,
"updated_at": "2018-12-12T17:53:47Z",
"deleted_at": null,
"hidden_at": null,
"birthdate": null,
"location_id": null,
"custom_fields": []
},
{
"id": 33,
"pronoun": null,
"first_name": "Susie",
"middle_name": null,
"last_name": "Dependent",
"is_schedulable": true,
"guardian_name": null,
"name": "Susie Dependent",
"membership": "No Membership",
"is_member": false,
"joined_at": "2018-04-30T23:08:04Z",
"phone": "1-708-587-6630 x22009",
"email": "susiedependent@pike13.com",
"address": "456 Kid Street\nApt 790\nSeattle, WA 98101, United States of America",
"street_address": "456 Kid Street",
"street_address2": "Apt 790",
"city": "Seattle",
"state_code": "WA",
"postal_code": "98101",
"secondary_info_field": "No Membership",
"guardian_email": null,
"timezone": "America/Los_Angeles",
"business_id": 1,
"updated_at": "2018-12-12T18:02:10Z",
"deleted_at": null,
"hidden_at": null,
"birthdate": null,
"location_id": null,
"custom_fields": []
}
],
"providers": [],
"location": {
"id": 1,
"name": "West Location",
"slug": "west-location"
}
}
]
}
DELETE /api/v2/desk/people/:id
Deletes a Person. In certain circumstances deleting a Person is not valid. In such cases, the server will return a 422 response and corresponding error messages. Such cases include but are not limited to:
- Clients that have open invoices
- Clients that have future visits
- Clients that have active plans
REQUEST
$ curl -X DELETE https://mybiz.pike13.com/api/v2/desk/people/1 \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE