NAV Navbar
Ruby Python Curl PHP Java Node Go

Crew Public API v1.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

To get your application setup and your first access token, contact developers@crewapp.com, providing the phone number of a registered user on Crew you intend to use as the actor. We can also assist you in registering a no-login user.

Base URLs:

Email: Support

Authentication

Scope Scope Description
write:crew modify organization information
read:crew read organization information

OAuth

Authenticate with our system

To renew a users access token

Code samples

POST /oauth/access-tokens

Authenicate with Crew

Body parameter

{
  "accessToken": "string",
  "secret": "string",
  "clientId": "string",
  "expirationTime": 0
}

Parameters

Parameter In Type Required Description
body body Access true none

Example responses

200 Response

[
  {
    "accessToken": "string",
    "expiresAt": 0,
    "acessTokenId": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline
405 Method Not Allowed Invalid input None

Response Schema

Status Code 200

Name Type Required Restrictions Description
» accessToken string false none Access token used to allow access to Crew's APIs
» expiresAt integer false none Epoch seconds of expiration date
» acessTokenId string false none Unique identifier

Shifts

Create & Updating Shifts

Creates calendar item with the specified parameters

Code samples

POST /connect/calendar-items

Body parameter

{
  "organizationId": "string",
  "start": 0,
  "end": 0,
  "timeZoneName": "string",
  "type": "TIME_OFF",
  "notes": "string",
  "muteAssignmentNotifications": true,
  "members": {
    "type": "USER",
    "userId": "string"
  },
  "name": "string"
}

Parameters

Parameter In Type Required Description
body body CalendarItems true none

Responses

Status Meaning Description Schema
200 OK Successful operation None
405 Method Not Allowed Invalid input None

To fetch calendar items for given time range

Code samples

GET /connect/organizations/{organizationId}/calendar-items

Parameters

Parameter In Type Required Description
organizationId path integer(int64) true Id of organization
startsAtOrAfter query string false Epoch time in milliseconds that calendar item starts after
startsAtOrBefore query string false Epoch time in milliseconds that calendar item starts before

Responses

Status Meaning Description Schema
200 OK Successful operation None
405 Method Not Allowed Invalid input None

To fetch calendar item by passed ID

Code samples

GET /connect/calendar-items/{calendarItemId}

Parameters

Parameter In Type Required Description
calendarItemId path integer true Id of calendar item

Responses

Status Meaning Description Schema
200 OK Successful operation None
405 Method Not Allowed Invalid input None

Updates calendar item with passed parameters

Code samples

PATCH /connect/calendar-items/{calendarItemId}

Any explicit JSON null values or empty strings will be interpreted as an unset

Body parameter

{
  "notes": "string",
  "start": "string",
  "end": "string",
  "status": "string",
  "muteAssignmentNotifications": true,
  "name": "string"
}

Parameters

Parameter In Type Required Description
calendarItemId path integer(int64) true Id of calendar item
body body PatchCalendarItems true none

Responses

Status Meaning Description Schema
200 OK Successful operation None
405 Method Not Allowed Invalid input None

Mark the calendar item with the given id deleted

Code samples

DELETE /connect/calendar-items/{calendarItemId}

Parameters

Parameter In Type Required Description
calendarItemId path integer(int64) true Id of calendar item

Responses

Status Meaning Description Schema
200 OK Successful operation None
405 Method Not Allowed Invalid input None

Shift Members

Assigning/Removing Users to Existing Shifts

To add new assignees

Code samples

POST /connect/calendar-items/{calendarItemId}/members

Body parameter

{
  "newCalendarItemStatus": "OPEN",
  "shouldReplaceMemberStatuses": true,
  "members": {
    "type": "INVITE",
    "userId": "string",
    "groupId": "string",
    "fullName": "string",
    "countryCode": "string",
    "phone": "string",
    "initialStatus": "ACCEPTED"
  }
}

Parameters

Parameter In Type Required Description
calendarItemId path integer(int64) true Id of calendar item
body body CalendarItemsMembers true none

Responses

Status Meaning Description Schema
200 OK Successful operation None
405 Method Not Allowed Invalid input None

For a user to request a shift if you aren’t part of it already

Code samples

POST /connect/calendar-items/{calendarItemId}/members/{userId}

Body parameter

{
  "status": "ADDITION_REQUESTED"
}

Parameters

Parameter In Type Required Description
calendarItemId path integer(int64) true Id of calendar item
userId path integer(int64) true Id of user
body body AdditionRequested true order placed for purchasing the pet

Responses

Status Meaning Description Schema
200 OK Successful operation None
405 Method Not Allowed Invalid input None

To approve a cover

Code samples

PATCH /connect/calendar-items/{calendarItemId}/members/{userId}

Body parameter

{
  "status": "ACCEPTED"
}

Parameters

Parameter In Type Required Description
calendarItemId path integer(int64) true Id of calendar item
userId path integer(int64) true Id of user
body body Status true order placed for purchasing the pet

Responses

Status Meaning Description Schema
200 OK Successful operation None
405 Method Not Allowed Invalid input None

To remove a user from a shift

Code samples

DELETE /connect/calendar-items/{calendarItemId}/members/{userId}

Parameters

Parameter In Type Required Description
calendarItemId path integer(int64) true Id of calendar item
userId path integer(int64) true Id of the user

Responses

Status Meaning Description Schema
200 OK Successful operation None
405 Method Not Allowed Invalid input None

Organization

List Users in an Organization

To fetch organization members

Code samples

GET /connect/organizations/{organizationId}/members

Parameters

Parameter In Type Required Description
organizationId path integer(int64) true Id of organization

Example responses

200 Response

[
  {
    "userId": {
      "id": "string",
      "updatedAt": 0,
      "entityType": "string"
    },
    "organizationId": {
      "id": "string",
      "updatedAt": 0,
      "entityType": "string"
    },
    "createdAt": 0,
    "updatedAt": 0,
    "permissions": {
      "admin": true
    },
    "profile": {
      "title": "string"
    }
  }
]

Responses

Status Meaning Description Schema
200 OK successful operation Inline
405 Method Not Allowed Invalid input None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [OrganizationResp] false none none
» userId UserId false none none
»» id string false none Unique identifier for user
»» updatedAt integer false none Epoch milliseconds that the user was last updated
»» entityType string false none USER
» organizationId OrganizationId false none none
»» id string false none Unique identifier for user
»» updatedAt integer false none Epoch milliseconds that the user was last updated
»» entityType string false none USER
» createdAt integer false none Epoch milliseconds that the membership was created at
» updatedAt integer false none Epoch milliseconds that the membership was last updated at
» permissions Permissions false none none
»» admin boolean false none whether user is an organization admin or not
» profile Profile false none none
»» title string false none Employees title

Users

User Information

To fetch user information

Code samples

GET /connect/users/{userId}

Parameters

Parameter In Type Required Description
userId path integer(int64) true Id of user

Example responses

200 Response

[
  {
    "id": "string",
    "profile": {
      "fullName": "string",
      "avatarPublicId": "string"
    }
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline
405 Method Not Allowed Invalid input None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [UserResp] false none none
» id string false none Unique identifier for user
» profile UserProfile false none none
»» fullName string false none Users full name
»» avatarPublicId string false none Unique identifier for users profile picture

Assets

User Assets

to fetch image assets corresponding to users profile picture

Code samples

GET /assets/{publicId}

Parameters

Parameter In Type Required Description
publicId path integer(int64) true Public Id

Responses

Status Meaning Description Schema
200 OK Successful operation None
405 Method Not Allowed Invalid input None

Schemas

Access

{
  "accessToken": "string",
  "secret": "string",
  "clientId": "string",
  "expirationTime": 0
}

Properties

Name Type Required Restrictions Description
accessToken string true none Existing access token that can be exchanged for another as long as token is still valid
secret string true none Application secret provided by Crew
clientId string true none Application Client Id
expirationTime integer false none Epoch time in seconds that token is desired to expire at. If not passed the token will default to being good for 30 days. Tokens cannot have an expiration more than 90 days in the future

AdditionRequested

{
  "status": "ADDITION_REQUESTED"
}

Properties

Name Type Required Restrictions Description
status string false none ADDITION_REQUESTED

Status

{
  "status": "ACCEPTED"
}

Properties

Name Type Required Restrictions Description
status string false none ACCEPTED, DECLINED

Enumerated Values

Property Value
status ACCEPTED
status DECLINED

PatchCalendarItems

{
  "notes": "string",
  "start": "string",
  "end": "string",
  "status": "string",
  "muteAssignmentNotifications": true,
  "name": "string"
}

Properties

Name Type Required Restrictions Description
notes string false none Text description for the calendar item
start string false none Time in millis since epoch for start of shift
end string false none Time in millis since epoch for end of shift
status string false none Status for the calendar item
muteAssignmentNotifications boolean false none Specifies whether notification for assignment should be muted or not
name string false none Name of associated with the calendar item

CalendarItems

{
  "organizationId": "string",
  "start": 0,
  "end": 0,
  "timeZoneName": "string",
  "type": "TIME_OFF",
  "notes": "string",
  "muteAssignmentNotifications": true,
  "members": {
    "type": "USER",
    "userId": "string"
  },
  "name": "string"
}

Properties

Name Type Required Restrictions Description
organizationId string true none Organization that calendar item belongs to
start integer true none Time in millis since epoch for start of shift
end integer true none Time in millis since epoch for end of shift
timeZoneName string true none Time zone where shift was created
type string true none Possible values: TIME_OFF, MEETING, MULTI_ASSIGNEE_SHIFT
notes string false none Text description for the calendar item
muteAssignmentNotifications boolean false none specifies whether notification for assignment should be muted or not
members Members false none none
name string false none Display name for the calendar item

Enumerated Values

Property Value
type TIME_OFF
type MEETING
type MULTI_ASSIGNEE_SHIFT

CalendarItemsMembers

{
  "newCalendarItemStatus": "OPEN",
  "shouldReplaceMemberStatuses": true,
  "members": {
    "type": "INVITE",
    "userId": "string",
    "groupId": "string",
    "fullName": "string",
    "countryCode": "string",
    "phone": "string",
    "initialStatus": "ACCEPTED"
  }
}

Properties

Name Type Required Restrictions Description
newCalendarItemStatus string true none OPEN, ASSIGNED (or any other CalendarItemStatus)
shouldReplaceMemberStatuses boolean true none If true, member statuses will be replaced. Otherwise, existing member statuses will not be replaced
members CalendarMembers true none none

Enumerated Values

Property Value
newCalendarItemStatus OPEN
newCalendarItemStatus ASSIGNED

CalendarMembers

{
  "type": "INVITE",
  "userId": "string",
  "groupId": "string",
  "fullName": "string",
  "countryCode": "string",
  "phone": "string",
  "initialStatus": "ACCEPTED"
}

Properties

Name Type Required Restrictions Description
type string true none ENUM - INVITE, USER, GROUP
userId string false none Unique id for user
groupId string false none Unique id for group
fullName string false none Name for user if invite
countryCode string false none Numeric country code for phone number
phone string false none Phone number
initialStatus string true none ACCEPTED, ASSIGNED, PENDING_RESPONSE, DECLINED, DELETED, ADDITION_REQUESTED, REPLACEMENT_REQUESTED, DENIED

Enumerated Values

Property Value
type INVITE
type USER
type GROUP
initialStatus ACCEPTED
initialStatus ASSIGNED
initialStatus PENDING_RESPONSE
initialStatus DECLINED
initialStatus DELETED
initialStatus ADDITION_REQUESTED
initialStatus REPLACEMENT_REQUESTED
initialStatus DENIED

Members

{
  "type": "USER",
  "userId": "string"
}

Properties

Name Type Required Restrictions Description
type string false none ENUM - USER
userId string false none Unique id for user

Enumerated Values

Property Value
type USER

AccessResp

{
  "accessToken": "string",
  "expiresAt": 0,
  "acessTokenId": "string"
}

Properties

Name Type Required Restrictions Description
accessToken string false none Access token used to allow access to Crew's APIs
expiresAt integer false none Epoch seconds of expiration date
acessTokenId string false none Unique identifier

OrganizationResp

{
  "userId": {
    "id": "string",
    "updatedAt": 0,
    "entityType": "string"
  },
  "organizationId": {
    "id": "string",
    "updatedAt": 0,
    "entityType": "string"
  },
  "createdAt": 0,
  "updatedAt": 0,
  "permissions": {
    "admin": true
  },
  "profile": {
    "title": "string"
  }
}

Properties

Name Type Required Restrictions Description
userId UserId false none none
organizationId OrganizationId false none none
createdAt integer false none Epoch milliseconds that the membership was created at
updatedAt integer false none Epoch milliseconds that the membership was last updated at
permissions Permissions false none none
profile Profile false none none

UserId

{
  "id": "string",
  "updatedAt": 0,
  "entityType": "string"
}

Properties

Name Type Required Restrictions Description
id string false none Unique identifier for user
updatedAt integer false none Epoch milliseconds that the user was last updated
entityType string false none USER

OrganizationId

{
  "id": "string",
  "updatedAt": 0,
  "entityType": "string"
}

Properties

Name Type Required Restrictions Description
id string false none Unique identifier for user
updatedAt integer false none Epoch milliseconds that the user was last updated
entityType string false none USER

Permissions

{
  "admin": true
}

Properties

Name Type Required Restrictions Description
admin boolean false none whether user is an organization admin or not

Profile

{
  "title": "string"
}

Properties

Name Type Required Restrictions Description
title string false none Employees title

UserResp

{
  "id": "string",
  "profile": {
    "fullName": "string",
    "avatarPublicId": "string"
  }
}

Properties

Name Type Required Restrictions Description
id string false none Unique identifier for user
profile UserProfile false none none

UserProfile

{
  "fullName": "string",
  "avatarPublicId": "string"
}

Properties

Name Type Required Restrictions Description
fullName string false none Users full name
avatarPublicId string false none Unique identifier for users profile picture