{"__v":15,"_id":"56fa046648e69f0e00a77431","api":{"auth":"required","params":[],"results":{"codes":[]},"settings":"","url":""},"body":"The Staffjoy API controls access to all data within the application. Staffjoy's applications use this API for all functionality, and we invite developers to build their own API integrations with our system. \n\nThe Staffjoy API uses [REST](https://en.wikipedia.org/wiki/Representational_state_transfer), and data is encoded in [JSON](http://www.json.org/). Resources are logically structured, and IDs are integers.\n\n\nOur team supports developers using our API. Please email us at [help@staffjoy.com](mailto:help@staffjoy.com) with any questions. We can help with design questions, debugging, and setting up sandbox accounts.\n\n## Mailing List\n\nIf you develop on the Staffjoy API, please join the [Staffjoy API Mailing List](https://groups.google.com/forum/#!forum/staffjoy-api-updates) for important news about changes or deprecations. \n\n## Envelope\n\n`GET` endpoints return information in an envelope with the key `\"data\"`. This allows us to package metadata in certain circumstances with responses, such as pagination. \n\n## Allowed Methods\n\nThe Staffjoy API uses standard `GET`, `POST`, `PATCH`, and `DELETE` methods to modify endpoints. Note that we support `PATCH` in favor of `PUT`.\n\n## Errors\n\nStaffjoy uses standard HTTP status codes to communicate errors. The response body is JSON-encoded, and may include a `\"message\"` key with further information about the failure.\n\nCommon codes used by our API include:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"HTTP Status Code\",\n    \"h-1\": \"Status\",\n    \"0-0\": \"200 - OK\",\n    \"0-1\": \"API call successful\",\n    \"1-0\": \"201 - Created\",\n    \"1-1\": \"The resource was created\",\n    \"2-0\": \"204 - Success No Content\",\n    \"2-1\": \"The request succeeded and there is no response data. Often used for DELETE endpoints.\",\n    \"3-0\": \"400 - Bad Request\",\n    \"3-1\": \"The request failed, likely due to invalid or missing parameters. Check for a `\\\"message\\\"` value in the response with further details.\",\n    \"4-0\": \"401 - Unauthorized\",\n    \"4-1\": \"The API key did not have permission to complete this action. In some cases, an alternative endpoint may exist for security purposes - please contact support if you have questions.\",\n    \"5-0\": \"404 - Not Found\",\n    \"5-1\": \"The resource does not exist\",\n    \"6-0\": \"429 - Too Many Request\",\n    \"6-1\": \"The API Key was rate-limited due to too many requests. See below for rate limit information.\",\n    \"7-0\": \"500- Server Error\",\n    \"7-1\": \"Staffjoy's API encountered an unexpected error. Please email support for help\",\n    \"8-0\": \"502, 503 - Service Error\",\n    \"8-1\": \"Staffjoy's API encountered an intermittent error -please try again.\"\n  },\n  \"cols\": 2,\n  \"rows\": 9\n}\n[/block]\n## Client Libraries\n\nStaffjoy currently has one official client library in Python. [Learn more on Github](https://github.com/Staffjoy/client_python) or install it via `pip install staffjoy`.\n\n## Datetime Handling\n\nAll datetime objects in Staffjoy use [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) formatting. For datetime objects without a specified offset, [UTC (Coordinated Universal Time)])https://en.wikipedia.org/wiki/Coordinated_Universal_Time) is assumed.\n\n## Rate Limiting\n\nStaffjoy's API limits each IP address and each API key to **300 requests per minute***. Exceeding this limit will result in a `429 - Too Many Requests` error. If you require a higher limit, please contact support.\n\n## Pagination\n\nFor some group endpoints, we use a `limit` and `offset` variables to handle pagination. Lists are sorted by ID, ascending. The `limit` controls how many items are returned, and the `offset` specifies the beginning of the search window. \n\nSo, to search a 75-item list, you may query an endpoint 3 times, each with `limit` of 25, and with `offset` of 0, 25, and 50.","category":"56fa046648e69f0e00a77430","createdAt":"2016-03-29T04:01:48.523Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"getting-started","sync_unique":"","title":"Staffjoy Suite API Basics","type":"basic","updates":[],"user":"561aed1a30e7490d0022d6ae","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

Staffjoy Suite API Basics


The Staffjoy API controls access to all data within the application. Staffjoy's applications use this API for all functionality, and we invite developers to build their own API integrations with our system.

The Staffjoy API uses REST, and data is encoded in JSON. Resources are logically structured, and IDs are integers.

Our team supports developers using our API. Please email us at help@staffjoy.com with any questions. We can help with design questions, debugging, and setting up sandbox accounts.

Mailing List

If you develop on the Staffjoy API, please join the Staffjoy API Mailing List for important news about changes or deprecations.

Envelope

GET endpoints return information in an envelope with the key "data". This allows us to package metadata in certain circumstances with responses, such as pagination.

Allowed Methods

The Staffjoy API uses standard GET, POST, PATCH, and DELETE methods to modify endpoints. Note that we support PATCH in favor of PUT.

Errors

Staffjoy uses standard HTTP status codes to communicate errors. The response body is JSON-encoded, and may include a "message" key with further information about the failure.

Common codes used by our API include:

HTTP Status Code
Status

200 - OK

API call successful

201 - Created

The resource was created

204 - Success No Content

The request succeeded and there is no response data. Often used for DELETE endpoints.

400 - Bad Request

The request failed, likely due to invalid or missing parameters. Check for a "message" value in the response with further details.

401 - Unauthorized

The API key did not have permission to complete this action. In some cases, an alternative endpoint may exist for security purposes - please contact support if you have questions.

404 - Not Found

The resource does not exist

429 - Too Many Request

The API Key was rate-limited due to too many requests. See below for rate limit information.

500- Server Error

Staffjoy's API encountered an unexpected error. Please email support for help

502, 503 - Service Error

Staffjoy's API encountered an intermittent error -please try again.

Client Libraries

Staffjoy currently has one official client library in Python. Learn more on Github or install it via pip install staffjoy.

Datetime Handling

All datetime objects in Staffjoy use ISO 8601 formatting. For datetime objects without a specified offset, [UTC (Coordinated Universal Time)])https://en.wikipedia.org/wiki/Coordinated_Universal_Time) is assumed.

Rate Limiting

Staffjoy's API limits each IP address and each API key to 300 requests per minute*. Exceeding this limit will result in a 429 - Too Many Requests error. If you require a higher limit, please contact support.

Pagination

For some group endpoints, we use a limit and offset variables to handle pagination. Lists are sorted by ID, ascending. The limit controls how many items are returned, and the offset specifies the beginning of the search window.

So, to search a 75-item list, you may query an endpoint 3 times, each with limit of 25, and with offset of 0, 25, and 50.

View all 80 endpoints
{"__v":2,"_id":"56fa18ee4e00c80e000f275d","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"API authentication in Staffjoy are currently tied to a user account. \n\nWe offer both permanent api keys and time-based tokens. \n\n## API Keys\n\nIssue an API key while logged in through [API Keys on the My Account page](https://www.staffjoy.com/auth/api-keys). \n\nAssign a label while issuing the token in order to keep track of what it is being used for. The key will be shown once, after which it will never be shown again. You will receive an email that the key has been issued. \n\nThrough this page, you may also view issued keys, see the last time they were used, and revoke them. \n\nAPI keys do not expire. API keys may be revoked. The API key has the permissions of the associated user, and actions appear as if they were that user. If the associated user has its permissions changed, such as being removed from an organization, then the functionality of the key will change. \n\nWe recommend that different systems have different API keys for security purposes. \n\n## Time-Based Tokens\n\nStaffjoy supports time-based tokens that expire after a set amount of time. These tokens are tied to the user session, and used primarily in our applications. If you require access to this method of authentication, please contact support.","category":"56fa046648e69f0e00a77430","createdAt":"2016-03-29T05:55:58.424Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"authentication","sync_unique":"","title":"Authentication","type":"basic","updates":[],"user":"561aed1a30e7490d0022d6ae","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

Authentication


API authentication in Staffjoy are currently tied to a user account.

We offer both permanent api keys and time-based tokens.

API Keys

Issue an API key while logged in through API Keys on the My Account page.

Assign a label while issuing the token in order to keep track of what it is being used for. The key will be shown once, after which it will never be shown again. You will receive an email that the key has been issued.

Through this page, you may also view issued keys, see the last time they were used, and revoke them.

API keys do not expire. API keys may be revoked. The API key has the permissions of the associated user, and actions appear as if they were that user. If the associated user has its permissions changed, such as being removed from an organization, then the functionality of the key will change.

We recommend that different systems have different API keys for security purposes.

Time-Based Tokens

Staffjoy supports time-based tokens that expire after a set amount of time. These tokens are tied to the user session, and used primarily in our applications. If you require access to this method of authentication, please contact support.

{"__v":7,"_id":"57195b39ac1e2e0e001834f5","api":{"auth":"required","examples":{"codes":[]},"method":"get","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"access\": {\n        \"sudo\": true,\n        \"worker\": [\n            {\n                \"organization_id\": 1,\n                \"user_id\": 2718,\n                \"location_id\": 6,\n                \"role_id\": 656\n            }\n        ],\n        \"location_manager\": [\n            {\n                \"organization_id\": 1,\n              \t\"location_id\": 6,\n            }\n        ],\n        \"organization_admin\": [\n            {\n                \"organization_id\": 1\n            }\n        ]\n    },\n    \"data\": {\n        \"username\": \"leonhard\",\n        \"confirmed\": true,\n        \"name\": \"Leonhard Euler\",\n        \"active\": true,\n        \"member_since\": \"2015-02-14T20:53:31\",\n        \"last_seen\": \"2016-05-06T19:38:06.951111\",\n        \"sudo\": false,\n        \"email\": \"leonhard@staffjoy.com\",\n        \"id\": 2718,\n      \t\"phone_number\": \"+14435783359\",\n    },\n    \"resources\": [\n        \"users\",\n        \"organizations\"\n    ]\n}","name":""}]},"settings":"","url":"/"},"body":"[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nThis endpoint shows information about the current session and the accounts that are able to be accessed.\n\nThe `access` parameter denotes the different permissions that the current user has access to. It also provides the necessary IDs to access the relevant data. For example, each worker option includes `organization_id`, `location_id`, `role_id`, and `user_id`. These IDs can then be used to complete the route for the Worker API:\n`organizations/<organization_id>/locations/<location_id>/roles/<role_id>/users/<user_id>/`","category":"56fa15143130030e0081ba0a","createdAt":"2016-04-21T22:59:05.627Z","excerpt":"Current Session","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"page","sync_unique":"","title":"Current Session and Access","type":"get","updates":[],"user":"561aed1a30e7490d0022d6ae","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getCurrent Session and Access

Current Session

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/

This endpoint shows information about the current session and the accounts that are able to be accessed.

The access parameter denotes the different permissions that the current user has access to. It also provides the necessary IDs to access the relevant data. For example, each worker option includes organization_id, location_id, role_id, and user_id. These IDs can then be used to complete the route for the Worker API:
organizations/<organization_id>/locations/<location_id>/roles/<role_id>/users/<user_id>/


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format

{
    "access": {
        "sudo": true,
        "worker": [
            {
                "organization_id": 1,
                "user_id": 2718,
                "location_id": 6,
                "role_id": 656
            }
        ],
        "location_manager": [
            {
                "organization_id": 1,
              	"location_id": 6,
            }
        ],
        "organization_admin": [
            {
                "organization_id": 1
            }
        ]
    },
    "data": {
        "username": "leonhard",
        "confirmed": true,
        "name": "Leonhard Euler",
        "active": true,
        "member_since": "2015-02-14T20:53:31",
        "last_seen": "2016-05-06T19:38:06.951111",
        "sudo": false,
        "email": "leonhard@staffjoy.com",
        "id": 2718,
      	"phone_number": "+14435783359",
    },
    "resources": [
        "users",
        "organizations"
    ]
}


{"__v":1,"_id":"571e5ff1fa79a4190004edf2","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/\n"}]},"method":"get","params":[{"_id":"56fa13063130030e0081ba09","ref":"","required":false,"desc":"Returns items (offset) to (offset + limit) - inclusive to exclusive - based on the sorted organization id.","default":"0","type":"int","name":"offset","in":"query"},{"_id":"56fa13063130030e0081ba08","ref":"","required":false,"desc":"Number of results to return","default":"25","type":"int","name":"limit","in":"query"},{"_id":"571e608efa79a4190004edf5","ref":"","required":false,"desc":"Returns results that are similar to the given username","default":"","type":"string","name":"filterByUsername","in":"query"},{"_id":"571e608efa79a4190004edf4","ref":"","required":false,"desc":"Returns results that are similar to the given email address","default":"","type":"string","name":"filterByEmail","in":"query"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": [\n        {\n            \"username\": \"tesla\",\n            \"confirmed\": true,\n            \"name\": \"Nikola Tesla\",\n            \"active\": true,\n            \"member_since\": \"2015-02-14T20:53:31\",\n            \"last_seen\": \"2016-04-25T18:23:00\",\n            \"sudo\": true,\n            \"email\": \"tesla@staffjoy.com\",\n            \"id\": 1,\n            \"phone_number\": \"\"\n        },\n        {\n            \"username\": \"rosalind\",\n            \"confirmed\": true,\n            \"name\": \"Rosalind Franklin\",\n            \"active\": true,\n            \"member_since\": \"2015-02-14T20:53:31\",\n            \"last_seen\": \"2016-04-25T18:23:38.704586\",\n            \"sudo\": true,\n            \"email\": \"rosalind@staffjoy.com\",\n            \"id\": 2,\n            \"phone_number\": \"+14435783359\"\n        },\n    ],\n    \"limit\": 25,\n    \"filters\": {\n        \"filterByUsername\": null,\n        \"filterByEmail\": null\n    },\n    \"offset\": 0\n}","language":"json","status":200}]},"settings":"","url":"/users/"},"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Only Staffjoy support may access this endpoint\",\n  \"body\": \"\"\n}\n[/block]\nTo get your User ID, visit the [Base Endpoint](doc:page)","category":"56fbf8c44c3cea190015da0f","createdAt":"2016-04-25T18:20:33.992Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-users","sync_unique":"","title":"All Users","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Users


Query Params

offset:
integer0
Returns items (offset) to (offset + limit) - inclusive to exclusive - based on the sorted organization id.
limit:
integer25
Number of results to return
filterByUsername:
string
Returns results that are similar to the given username
filterByEmail:
string
Returns results that are similar to the given email address

Only Staffjoy support may access this endpoint

To get your User ID, visit the Base Endpoint


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/

Result Format

{
    "data": [
        {
            "username": "tesla",
            "confirmed": true,
            "name": "Nikola Tesla",
            "active": true,
            "member_since": "2015-02-14T20:53:31",
            "last_seen": "2016-04-25T18:23:00",
            "sudo": true,
            "email": "tesla@staffjoy.com",
            "id": 1,
            "phone_number": ""
        },
        {
            "username": "rosalind",
            "confirmed": true,
            "name": "Rosalind Franklin",
            "active": true,
            "member_since": "2015-02-14T20:53:31",
            "last_seen": "2016-04-25T18:23:38.704586",
            "sudo": true,
            "email": "rosalind@staffjoy.com",
            "id": 2,
            "phone_number": "+14435783359"
        },
    ],
    "limit": 25,
    "filters": {
        "filterByUsername": null,
        "filterByEmail": null
    },
    "offset": 0
}


{"__v":1,"_id":"571e60106597412b008b593e","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/ -X POST -d \"email=leonhard@staffjoy.com\"","language":"curl"}]},"method":"post","params":[{"_id":"56fa17c675bb290e001e68b9","ref":"","required":true,"desc":"The email address of the person being created","default":"","type":"string","name":"email","in":"body"},{"_id":"56fa17c675bb290e001e68ba","ref":"","required":false,"desc":"The name of the person being created","default":"","type":"string","name":"name","in":"body"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"username\": null,\n    \"confirmed\": false,\n    \"name\": null,\n    \"active\": false,\n    \"member_since\": \"2016-04-25T18:39:08\",\n    \"last_seen\": \"2016-04-25T18:39:08\",\n    \"sudo\": false,\n    \"email\": \"leonhard@staffjoy.com\",\n    \"id\": 1335\n}","name":""}]},"settings":"","url":"/users/"},"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Only Staffjoy support may access this endpoint\",\n  \"body\": \"New users can also be created through the Admins or Role Workers endpoints.\"\n}\n[/block]","category":"56fbf8c44c3cea190015da0f","createdAt":"2016-04-25T18:21:04.480Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"create-user","sync_unique":"","title":"Create User","type":"post","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

postCreate User


Body Params

email:
required
string
The email address of the person being created
name:
string
The name of the person being created

Only Staffjoy support may access this endpoint

New users can also be created through the Admins or Role Workers endpoints.


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/ -X POST -d "email=leonhard@staffjoy.com"

Result Format

{
    "username": null,
    "confirmed": false,
    "name": null,
    "active": false,
    "member_since": "2016-04-25T18:39:08",
    "last_seen": "2016-04-25T18:39:08",
    "sudo": false,
    "email": "leonhard@staffjoy.com",
    "id": 1335
}


{"__v":1,"_id":"571e601e92d3701900706eca","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2","language":"curl"}]},"method":"get","params":[{"_id":"56fbfb9e587e43170081eb61","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"571e6c2e6597412b008b5955","default":"","desc":"filter the role_members response by whether the worker's archived property","name":"archived","ref":"","required":false,"type":"boolean","in":"query"}],"results":{"codes":[{"name":"","code":"{\n    \"role_member\": [\n        {\n            \"max_hours_per_workday\": 8,\n            \"archived\": false,\n            \"enable_timeclock\": true,\n            \"name\": \"Hackers\",\n            \"max_consecutive_workdays\": 6,\n            \"min_hours_between_shifts\": 12,\n            \"enable_time_off_requests\": false,\n            \"location_id\": 250,\n            \"id\": 478,\n            \"min_hours_per_workday\": 4,\n            \"location\": {\n                \"organization_id\": 180,\n                \"timezone\": \"America/Los_Angeles\",\n                \"archived\": false,\n                \"id\": 250,\n                \"name\": \"San Francisco\"\n            },\n            \"organization\": {\n                \"workers_can_claim_shifts_in_excess_of_max\": false,\n                \"paid\": true,\n                \"trial_days\": 30,\n                \"enable_time_off_requests_default\": false,\n                \"plan\": \"boss-v2\",\n                \"active\": true,\n                \"early_access\": false,\n                \"id\": 180,\n                \"shifts_assigned_days_before_start\": 4,\n                \"name\": \"Staffjoy Example 1\",\n                \"day_week_starts\": \"monday\",\n                \"created_at\": \"2015-06-15T03:00:32\",\n                \"paid_until\": \"2030-06-15T00:00:00\",\n                \"enable_timeclock_default\": true,\n                \"enable_shiftplanning_export\": false\n            }\n        }\n    ],\n    \"data\": {\n        \"username\": null,\n        \"confirmed\": true,\n        \"name\": \"Nikola Tesla\",\n        \"active\": true,\n        \"member_since\": \"2015-11-08T23:05:26\",\n        \"last_seen\": \"2016-04-25T18:44:02\",\n        \"sudo\": false,\n        \"email\": \"tesla@staffjoy.com\",\n        \"id\": 1,\n        \"phone_number\": \"+14435783359\"\n    },\n    \"resources\": [\n    \t\t\"apikeys\",\n      \t\"sessions\",\n    ],\n    \"organization_admin\": [\n        {\n            \"workers_can_claim_shifts_in_excess_of_max\": false,\n            \"paid\": true,\n            \"trial_days\": 30,\n            \"enable_time_off_requests_default\": false,\n            \"plan\": \"boss-v2\",\n            \"active\": true,\n            \"early_access\": false,\n            \"id\": 180,\n            \"shifts_assigned_days_before_start\": 4,\n            \"name\": \"Staffjoy Example 1\",\n            \"day_week_starts\": \"monday\",\n            \"created_at\": \"2015-06-15T03:00:32\",\n            \"paid_until\": \"2030-06-15T00:00:00\",\n            \"enable_timeclock_default\": true,\n            \"enable_shiftplanning_export\": false\n        }\n    ],\n \t\t\"location_manager\": [],\n}","language":"json","status":200}]},"settings":"","url":"/users/:user_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Self\"\n}\n[/block]","category":"56fbf8c44c3cea190015da0f","createdAt":"2016-04-25T18:21:18.128Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"user","sync_unique":"","title":"User","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getUser


Path Params

user_id:
required
integer
ID of the user

Query Params

archived:
boolean
filter the role_members response by whether the worker's archived property

Permission Required: Self


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2

Result Format

{
    "role_member": [
        {
            "max_hours_per_workday": 8,
            "archived": false,
            "enable_timeclock": true,
            "name": "Hackers",
            "max_consecutive_workdays": 6,
            "min_hours_between_shifts": 12,
            "enable_time_off_requests": false,
            "location_id": 250,
            "id": 478,
            "min_hours_per_workday": 4,
            "location": {
                "organization_id": 180,
                "timezone": "America/Los_Angeles",
                "archived": false,
                "id": 250,
                "name": "San Francisco"
            },
            "organization": {
                "workers_can_claim_shifts_in_excess_of_max": false,
                "paid": true,
                "trial_days": 30,
                "enable_time_off_requests_default": false,
                "plan": "boss-v2",
                "active": true,
                "early_access": false,
                "id": 180,
                "shifts_assigned_days_before_start": 4,
                "name": "Staffjoy Example 1",
                "day_week_starts": "monday",
                "created_at": "2015-06-15T03:00:32",
                "paid_until": "2030-06-15T00:00:00",
                "enable_timeclock_default": true,
                "enable_shiftplanning_export": false
            }
        }
    ],
    "data": {
        "username": null,
        "confirmed": true,
        "name": "Nikola Tesla",
        "active": true,
        "member_since": "2015-11-08T23:05:26",
        "last_seen": "2016-04-25T18:44:02",
        "sudo": false,
        "email": "tesla@staffjoy.com",
        "id": 1,
        "phone_number": "+14435783359"
    },
    "resources": [
    		"apikeys",
      	"sessions",
    ],
    "organization_admin": [
        {
            "workers_can_claim_shifts_in_excess_of_max": false,
            "paid": true,
            "trial_days": 30,
            "enable_time_off_requests_default": false,
            "plan": "boss-v2",
            "active": true,
            "early_access": false,
            "id": 180,
            "shifts_assigned_days_before_start": 4,
            "name": "Staffjoy Example 1",
            "day_week_starts": "monday",
            "created_at": "2015-06-15T03:00:32",
            "paid_until": "2030-06-15T00:00:00",
            "enable_timeclock_default": true,
            "enable_shiftplanning_export": false
        }
    ],
 		"location_manager": [],
}


{"__v":1,"_id":"571e602a3c34141700f231c8","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2 -X PATCH -d \"name=Testing\"","language":"curl"}]},"method":"patch","params":[{"_id":"56fbfbb14c3cea190015da19","ref":"","required":false,"desc":"","default":"","type":"string","name":"username","in":"body"},{"_id":"56fa17c675bb290e001e68ba","ref":"","required":false,"desc":"","default":"","type":"string","name":"name","in":"body"},{"_id":"56fa17c675bb290e001e68b9","ref":"","required":false,"desc":"","default":"","type":"string","name":"email","in":"body"},{"_id":"56fa17c675bb290e001e68b8","ref":"","required":false,"desc":"used to turn off emails and reminders","default":"","type":"boolean","name":"active","in":"body"},{"_id":"571e6dba92d3701900706eea","ref":"","required":false,"desc":"will have an email sent to remind the user to sign up","default":"","type":"boolean","name":"activateReminder","in":"body"}],"results":{"codes":[{"status":200,"language":"text","code":"{\n \"name\": \"Testing\" \n}"}]},"settings":"","url":"/organizations/:organization_id"},"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Only Staffjoy support may access this endpoint\"\n}\n[/block]","category":"56fbf8c44c3cea190015da0f","createdAt":"2016-04-25T18:21:30.249Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"modify-a-user","sync_unique":"","title":"Modify a User","type":"patch","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

patchModify a User


Body Params

username:
string
name:
string
email:
string
active:
boolean
used to turn off emails and reminders
activateReminder:
boolean
will have an email sent to remind the user to sign up

Only Staffjoy support may access this endpoint


User Information

Try It Out

patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2 -X PATCH -d "name=Testing"

Result Format

{
 "name": "Testing" 
}


{"__v":1,"_id":"571ea920ebc88a0e008d4ff1","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2/sessions/","language":"curl"}]},"method":"get","params":[{"_id":"56fbfb9e587e43170081eb61","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": [\n        {\n            \"last_used\": \"2016-04-22T06:24:14.800156\",\n            \"key\": \"0a681a\",\n            \"remote_ip\": \"24.23.242.250\"\n        },\n    ]\n}","name":""}]},"settings":"","url":"/users/:user_id/sessions/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Self\"\n}\n[/block]","category":"571ea8fe4a14580e00760218","createdAt":"2016-04-25T23:32:48.433Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-sessions","sync_unique":"","title":"All Sessions","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Sessions


Path Params

user_id:
required
integer
ID of the user

Permission Required: Self


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2/sessions/

Result Format

{
    "data": [
        {
            "last_used": "2016-04-22T06:24:14.800156",
            "key": "0a681a",
            "remote_ip": "24.23.242.250"
        },
    ]
}


{"__v":0,"_id":"571eaa1be2b7000e0091c3cf","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://www.staffjoy.com/api/v2/users/2/sessions/ -X DELETE"}]},"method":"delete","params":[{"_id":"56fbfb9e587e43170081eb61","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"}],"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""}]},"settings":"","url":"/users/:user_id/sessions/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Self\"\n}\n[/block]\nThis will log you out too!","category":"571ea8fe4a14580e00760218","createdAt":"2016-04-25T23:36:59.113Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-sessions-1","sync_unique":"","title":"Delete All Sessions","type":"delete","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

deleteDelete All Sessions


Path Params

user_id:
required
integer
ID of the user

Permission Required: Self

This will log you out too!


User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://www.staffjoy.com/api/v2/users/2/sessions/ -X DELETE

Result Format



{"__v":1,"_id":"571eabeb4a14580e00760223","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://www.staffjoy.com/api/v2/users/2/sessions/0a681a"}]},"method":"get","params":[{"_id":"56fbfb9e587e43170081eb61","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"571eac36d8667f0e00a3c361","ref":"","required":true,"desc":"The key of the session","default":"","type":"string","name":"session_id","in":"path"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": {\n        \"last_used\": \"2016-04-22T06:24:14.800156\",\n        \"key\": \"0a681a\",\n        \"remote_ip\": \"24.23.242.250\"\n    }\n}","language":"json","status":200}]},"settings":"","url":"/users/:user_id/sessions/:session_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Self\"\n}\n[/block]","category":"571ea8fe4a14580e00760218","createdAt":"2016-04-25T23:44:43.039Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"session","sync_unique":"","title":"Session","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getSession


Path Params

user_id:
required
integer
ID of the user
session_id:
required
string
The key of the session

Permission Required: Self


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://www.staffjoy.com/api/v2/users/2/sessions/0a681a

Result Format

{
    "data": {
        "last_used": "2016-04-22T06:24:14.800156",
        "key": "0a681a",
        "remote_ip": "24.23.242.250"
    }
}


{"__v":1,"_id":"571eabf1d8667f0e00a3c360","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://www.staffjoy.com/api/v2/users/2/sessions/0a681a -X DELETE"}]},"method":"delete","params":[{"_id":"56fbfb9e587e43170081eb61","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"571eac1d4a14580e00760225","default":"","desc":"The key of the session","name":"session_id","ref":"","required":true,"type":"string","in":"path"}],"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""}]},"settings":"","url":"/users/:user_id/sessions/:session_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Self\"\n}\n[/block]","category":"571ea8fe4a14580e00760218","createdAt":"2016-04-25T23:44:49.178Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"delete-a-session","sync_unique":"","title":"Delete a Session","type":"delete","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

deleteDelete a Session


Path Params

user_id:
required
integer
ID of the user
session_id:
required
string
The key of the session

Permission Required: Self


User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://www.staffjoy.com/api/v2/users/2/sessions/0a681a -X DELETE

Result Format



{"__v":0,"_id":"571ead31ac2a080e0014c4c5","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2/apikeys/","language":"curl"}]},"method":"get","params":[{"_id":"56fbfb9e587e43170081eb61","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": [\n        {\n            \"last_used\": \"2016-04-25T23:51:38\",\n            \"created_at\": \"2016-04-20T19:23:56\",\n            \"id\": 20,\n            \"name\": \"example-key\"\n        }\n    ]\n}","name":""}]},"settings":"","url":"/users/:user_id/apikeys/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Self\"\n}\n[/block]","category":"571ea906d8667f0e00a3c356","createdAt":"2016-04-25T23:50:09.005Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-api-keys","sync_unique":"","title":"All API Keys","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll API Keys


Path Params

user_id:
required
integer
ID of the user

Permission Required: Self


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2/apikeys/

Result Format

{
    "data": [
        {
            "last_used": "2016-04-25T23:51:38",
            "created_at": "2016-04-20T19:23:56",
            "id": 20,
            "name": "example-key"
        }
    ]
}


{"__v":1,"_id":"571eadb9e2b7000e0091c3d5","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2/apikeys/ -X POST -d \"name=example\"","language":"curl"}]},"method":"post","params":[{"_id":"56fbfb9e587e43170081eb61","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"571eade9d8667f0e00a3c366","ref":"","required":false,"desc":"A name for the key","default":"","type":"string","name":"name","in":"body"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"key\": \"be-sure-to-save-your-key-you-will-never-be-able-to-read-it-again-also-know-that-this-is-an-example-and-not-a-valid-key\"\n}","name":""}]},"settings":"","url":"/users/:user_id/apikeys/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Self\"\n}\n[/block]","category":"571ea906d8667f0e00a3c356","createdAt":"2016-04-25T23:52:25.368Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"create-an-api-key","sync_unique":"","title":"Create an API Key","type":"post","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

postCreate an API Key


Path Params

user_id:
required
integer
ID of the user

Body Params

name:
string
A name for the key

Permission Required: Self


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2/apikeys/ -X POST -d "name=example"

Result Format

{
    "key": "be-sure-to-save-your-key-you-will-never-be-able-to-read-it-again-also-know-that-this-is-an-example-and-not-a-valid-key"
}


{"__v":0,"_id":"571ead43ebc88a0e008d4ff4","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2/apikeys/20"}]},"method":"get","params":[{"_id":"56fbfb9e587e43170081eb61","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"571eac36d8667f0e00a3c361","default":"","desc":"The key of the session","name":"key_id","ref":"","required":true,"type":"string","in":"path"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": {\n        \"last_used\": \"2016-04-25T23:56:39\",\n        \"created_at\": \"2016-04-20T19:23:56\",\n        \"id\": 20,\n        \"name\": \"example-key\"\n    }\n}","language":"json","status":200}]},"settings":"","url":"/users/:user_id/apikeys/:key_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Self\"\n}\n[/block]","category":"571ea906d8667f0e00a3c356","createdAt":"2016-04-25T23:50:27.929Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"api-key","sync_unique":"","title":"API Key","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAPI Key


Path Params

user_id:
required
integer
ID of the user
key_id:
required
string
The key of the session

Permission Required: Self


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2/apikeys/20

Result Format

{
    "data": {
        "last_used": "2016-04-25T23:56:39",
        "created_at": "2016-04-20T19:23:56",
        "id": 20,
        "name": "example-key"
    }
}


{"__v":0,"_id":"571ead3b4a14580e00760227","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2/apikeys/20 -X DELETE","language":"curl"}]},"method":"delete","params":[{"_id":"56fbfb9e587e43170081eb61","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"571eac1d4a14580e00760225","default":"","desc":"The key of the session","name":"key_id","ref":"","required":true,"type":"string","in":"path"}],"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""}]},"settings":"","url":"/users/:user_id/apikeys/:key_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Self\"\n}\n[/block]","category":"571ea906d8667f0e00a3c356","createdAt":"2016-04-25T23:50:19.825Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"delete-an-api-key","sync_unique":"","title":"Delete an API Key","type":"delete","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

deleteDelete an API Key


Path Params

user_id:
required
integer
ID of the user
key_id:
required
string
The key of the session

Permission Required: Self


User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/users/2/apikeys/20 -X DELETE

Result Format



{"__v":0,"_id":"56fa1407f9102d0e00ca6273","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/\n"}]},"method":"get","params":[{"_id":"56fa13063130030e0081ba09","default":"0","desc":"Returns items (offset) to (offset + limit) - inclusive to exclusive - based on the sorted organization id.","name":"offset","ref":"","required":false,"type":"int","in":"query"},{"_id":"56fa13063130030e0081ba08","ref":"","required":false,"desc":"Number of results to return","default":"25","type":"int","name":"limit","in":"query"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n\tdata: [\n\t\t{\n\t\t\tworkers_can_claim_shifts_in_excess_of_max: false,\n\t\t\tpaid: true,\n\t\t\ttrial_days: 30,\n\t\t\tenable_time_off_requests_default: false,\n\t\t\tplan: \"per-seat-v1\",\n\t\t\tactive: true,\n\t\t\tearly_access: true,\n\t\t\tid: 1,\n\t\t\tshifts_assigned_days_before_start: 4,\n\t\t\tname: \"Staffjoy\",\n\t\t\tday_week_starts: \"monday\",\n\t\t\tcreated_at: \"2015-06-15T03:00:32\",\n\t\t\tpaid_until: \"2030-06-15T00:00:00\",\n\t\t\tenable_timeclock_default: true,\n\t\t\tenable_shiftplanning_export: false\n\t\t},\n    {\n\t\t\tworkers_can_claim_shifts_in_excess_of_max: false,\n\t\t\tpaid: true,\n\t\t\ttrial_days: 30,\n\t\t\tenable_time_off_requests_default: false,\n\t\t\tplan: \"per-seat-v1\",\n\t\t\tactive: true,\n\t\t\tearly_access: true,\n\t\t\tid: 1,\n\t\t\tshifts_assigned_days_before_start: 4,\n\t\t\tname: \"Staffjoy Number 2\",\n\t\t\tday_week_starts: \"sunday\",\n\t\t\tcreated_at: \"2015-06-15T03:00:32\",\n\t\t\tpaid_until: \"2030-06-15T00:00:00\",\n\t\t\tenable_timeclock_default: true,\n\t\t\tenable_shiftplanning_export: false\n\t\t}\n  ]\n}","name":""}]},"settings":"","url":"/organizations/"},"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Only Staffjoy support may access this endpoint\",\n  \"body\": \"For help in finding your organization's ID, please contact Staffjoy Support.\"\n}\n[/block]","category":"56fa141c75bb290e001e68b5","createdAt":"2016-03-29T05:35:03.305Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"get-all-organizations","sync_unique":"","title":"All Organizations","type":"get","updates":[],"user":"561aed1a30e7490d0022d6ae","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Organizations


Query Params

offset:
integer0
Returns items (offset) to (offset + limit) - inclusive to exclusive - based on the sorted organization id.
limit:
integer25
Number of results to return

Only Staffjoy support may access this endpoint

For help in finding your organization's ID, please contact Staffjoy Support.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/

Result Format

{
	data: [
		{
			workers_can_claim_shifts_in_excess_of_max: false,
			paid: true,
			trial_days: 30,
			enable_time_off_requests_default: false,
			plan: "per-seat-v1",
			active: true,
			early_access: true,
			id: 1,
			shifts_assigned_days_before_start: 4,
			name: "Staffjoy",
			day_week_starts: "monday",
			created_at: "2015-06-15T03:00:32",
			paid_until: "2030-06-15T00:00:00",
			enable_timeclock_default: true,
			enable_shiftplanning_export: false
		},
    {
			workers_can_claim_shifts_in_excess_of_max: false,
			paid: true,
			trial_days: 30,
			enable_time_off_requests_default: false,
			plan: "per-seat-v1",
			active: true,
			early_access: true,
			id: 1,
			shifts_assigned_days_before_start: 4,
			name: "Staffjoy Number 2",
			day_week_starts: "sunday",
			created_at: "2015-06-15T03:00:32",
			paid_until: "2030-06-15T00:00:00",
			enable_timeclock_default: true,
			enable_shiftplanning_export: false
		}
  ]
}


{"__v":2,"_id":"56fa0d4f75bb290e001e68af","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/ -X POST -d \"name=Staffjoy\"","language":"curl"}]},"method":"post","params":[{"_id":"56fa17c675bb290e001e68ba","ref":"","required":true,"desc":"Name the organization. Your workers will see this.","default":"","type":"string","name":"name","in":"body"},{"_id":"56fa17c675bb290e001e68b9","ref":"","required":false,"desc":"Pick the day of the week when your scheduling begins. This is universal for an organization and cannot be modified. The parameter is the lowercase name of the day.","default":"monday","type":"string","name":"day_week_starts","in":"body"},{"_id":"56fa17c675bb290e001e68b8","ref":"","required":false,"desc":"Plan that the organization uses.","default":"flex-v1","type":"string","name":"plan","in":"body"},{"_id":"56fa17c675bb290e001e68b7","ref":"","required":false,"desc":"Number of free trial days that a new organization receives","default":"14","type":"int","name":"trial_days","in":"body"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n  \"workers_can_claim_shifts_in_excess_of_max\": false,\n  \"paid\": false,\n  \"trial_days\": 14,\n  \"enable_time_off_requests_default\": false,\n  \"plan\": \"per-seat-v1\",\n  \"active\": false,\n  \"early_access\": false,\n  \"id\": 344,\n  \"shifts_assigned_days_before_start\": 4,\n  \"name\": \"Staffjoy\",\n  \"day_week_starts\": \"monday\",\n  \"created_at\": \"2016-03-29T05:52:35\",\n  \"paid_until\": null,\n  \"enable_timeclock_default\": false,\n  \"enable_shiftplanning_export\": false\n}","name":""}]},"settings":"","url":"/organizations/"},"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Only Staffjoy support may access this endpoint\",\n  \"body\": \"To create a new account, for testing or other purposes, please contact Staffjoy support.\"\n}\n[/block]","category":"56fa141c75bb290e001e68b5","createdAt":"2016-03-29T05:06:23.181Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"organizations","sync_unique":"","title":"Create Organization","type":"post","updates":[],"user":"561aed1a30e7490d0022d6ae","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

postCreate Organization


Body Params

name:
required
string
Name the organization. Your workers will see this.
day_week_starts:
stringmonday
Pick the day of the week when your scheduling begins. This is universal for an organization and cannot be modified. The parameter is the lowercase name of the day.
plan:
stringflex-v1
Plan that the organization uses.
trial_days:
integer14
Number of free trial days that a new organization receives

Only Staffjoy support may access this endpoint

To create a new account, for testing or other purposes, please contact Staffjoy support.


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/ -X POST -d "name=Staffjoy"

Result Format

{
  "workers_can_claim_shifts_in_excess_of_max": false,
  "paid": false,
  "trial_days": 14,
  "enable_time_off_requests_default": false,
  "plan": "per-seat-v1",
  "active": false,
  "early_access": false,
  "id": 344,
  "shifts_assigned_days_before_start": 4,
  "name": "Staffjoy",
  "day_week_starts": "monday",
  "created_at": "2016-03-29T05:52:35",
  "paid_until": null,
  "enable_timeclock_default": false,
  "enable_shiftplanning_export": false
}


{"__v":2,"_id":"56fbfa184c3cea190015da12","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1","language":"curl"}]},"method":"get","params":[{"_id":"56fbfb9e587e43170081eb61","default":"","desc":"ID of the organization","name":"organization_id","ref":"","required":true,"type":"int","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": {\n        \"workers_can_claim_shifts_in_excess_of_max\": false,\n        \"paid\": true,\n        \"trial_days\": 30,\n        \"enable_time_off_requests_default\": false,\n        \"plan\": \"per-seat-v1\",\n        \"active\": true,\n        \"early_access\": true,\n        \"id\": 1,\n        \"shifts_assigned_days_before_start\": 4,\n        \"name\": \"Staffjoy\",\n        \"day_week_starts\": \"monday\",\n        \"created_at\": \"2015-06-15T03:00:32\",\n        \"paid_until\": \"2030-06-15T00:00:00\",\n        \"enable_timeclock_default\": true,\n        \"enable_shiftplanning_export\": false\n    },\n    \"resources\": [\n        \"admins\",\n        \"locations\",\n        \"workers\"\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Organization Member\"\n}\n[/block]","category":"56fa141c75bb290e001e68b5","createdAt":"2016-03-30T16:08:56.055Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"get-an-organization","sync_unique":"","title":"Organization","type":"get","updates":[],"user":"561aed1a30e7490d0022d6ae","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getOrganization


Path Params

organization_id:
required
integer
ID of the organization

Permission Required: Organization Member


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1

Result Format

{
    "data": {
        "workers_can_claim_shifts_in_excess_of_max": false,
        "paid": true,
        "trial_days": 30,
        "enable_time_off_requests_default": false,
        "plan": "per-seat-v1",
        "active": true,
        "early_access": true,
        "id": 1,
        "shifts_assigned_days_before_start": 4,
        "name": "Staffjoy",
        "day_week_starts": "monday",
        "created_at": "2015-06-15T03:00:32",
        "paid_until": "2030-06-15T00:00:00",
        "enable_timeclock_default": true,
        "enable_shiftplanning_export": false
    },
    "resources": [
        "admins",
        "locations",
        "workers"
    ]
}


{"__v":2,"_id":"56fbf5a5587e43170081eb4f","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/ -X PATCH -d \"name=Staffjoy\"","language":"curl"}]},"method":"patch","params":[{"_id":"56fbfbb14c3cea190015da19","ref":"","required":true,"desc":"ID of the organization","default":"","type":"string","name":"organization_id","in":"path"},{"_id":"56fa17c675bb290e001e68ba","ref":"","required":false,"desc":"Name the organization. Workers see this.","default":"","type":"string","name":"name","in":"body"},{"_id":"56fa17c675bb290e001e68b9","ref":"","required":false,"desc":"Global \"enable\" of communication, scheduling, and more.","default":"","type":"boolean","name":"active","in":"body"},{"_id":"56fa17c675bb290e001e68b8","ref":"","required":false,"desc":"(Boss plan only) How many days prior to the start of a week that the system automatically computes schedules","default":"","type":"int","name":"shifts_assigned_days_before_start","in":"body"},{"_id":"56fa17c675bb290e001e68b7","ref":"","required":false,"desc":"Whether newly-created roles have the Timeclock feature enabled.","default":"","type":"boolean","name":"enable_timeclock_default","in":"body"},{"_id":"56fbf78c0256470e0052539c","ref":"","required":false,"desc":"Whether newly-created roles have the Time Off Requests feature enabled.","default":"","type":"boolean","name":"enable_time_off_requests_default","in":"body"},{"_id":"56fbf78c0256470e0052539b","ref":"","required":false,"desc":"(Boss plan only) Whether workers are allowed to claim extra shifts in excess of their compliance rules.","default":"","type":"boolean","name":"workers_can_claim_shifts_in_excess_of_max","in":"body"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"name\": \"Staffjoy\"\n}","name":""}]},"settings":"","url":"/organizations/:organization_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Organization Admin\"\n}\n[/block]","category":"56fa141c75bb290e001e68b5","createdAt":"2016-03-30T15:49:57.195Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"modify-an-organization-1","sync_unique":"","title":"Modify an Organization","type":"patch","updates":[],"user":"561aed1a30e7490d0022d6ae","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

patchModify an Organization


Path Params

organization_id:
required
string
ID of the organization

Body Params

name:
string
Name the organization. Workers see this.
active:
boolean
Global "enable" of communication, scheduling, and more.
shifts_assigned_days_before_start:
integer
(Boss plan only) How many days prior to the start of a week that the system automatically computes schedules
enable_timeclock_default:
boolean
Whether newly-created roles have the Timeclock feature enabled.
enable_time_off_requests_default:
boolean
Whether newly-created roles have the Time Off Requests feature enabled.
workers_can_claim_shifts_in_excess_of_max:
boolean
(Boss plan only) Whether workers are allowed to claim extra shifts in excess of their compliance rules.

Permission Required: Organization Admin


User Information

Try It Out

patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/ -X PATCH -d "name=Staffjoy"

Result Format

{
    "name": "Staffjoy"
}


{"__v":1,"_id":"571a9312ee0bfe1700373424","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/admins/"}]},"method":"get","params":[{"_id":"5717c29cab848c19009d10eb","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": [\n        {\n            \"username\": \"tesla\",\n            \"confirmed\": true,\n            \"name\": \"Nikola Tesla\",\n            \"active\": true,\n            \"member_since\": \"2015-02-14T20:53:31\",\n            \"last_seen\": \"2016-04-22T21:17:54\",\n            \"sudo\": true,\n            \"email\": \"tesla@staffjoy.com\",\n            \"id\": 1\n        },\n        {\n            \"username\": \"rosalind\",\n            \"confirmed\": true,\n            \"name\": \"Rosalind Franklin\",\n            \"active\": true,\n            \"member_since\": \"2015-02-14T20:53:31\",\n            \"last_seen\": \"2016-04-22T21:19:28.849251\",\n            \"sudo\": true,\n            \"email\": \"rosalind@staffjoy.com\",\n            \"id\": 2\n        },\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/admins/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Organization Admin\"\n}\n[/block]","category":"571a92fcd2ed1c17005a7955","createdAt":"2016-04-22T21:09:38.399Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-organization-admins","sync_unique":"","title":"All Organization Admins","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Organization Admins


Path Params

organization_id:
required
integer
ID of the organization

Permission Required: Organization Admin


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/admins/

Result Format

{
    "data": [
        {
            "username": "tesla",
            "confirmed": true,
            "name": "Nikola Tesla",
            "active": true,
            "member_since": "2015-02-14T20:53:31",
            "last_seen": "2016-04-22T21:17:54",
            "sudo": true,
            "email": "tesla@staffjoy.com",
            "id": 1
        },
        {
            "username": "rosalind",
            "confirmed": true,
            "name": "Rosalind Franklin",
            "active": true,
            "member_since": "2015-02-14T20:53:31",
            "last_seen": "2016-04-22T21:19:28.849251",
            "sudo": true,
            "email": "rosalind@staffjoy.com",
            "id": 2
        },
    ]
}


{"__v":3,"_id":"571a95daf504f81700e41f2d","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/admins/ -X POST -d \"email=leonhard@staffjoy.com\""}]},"method":"post","params":[{"_id":"57166b4cb5af590e00a0ffc7","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"571a960aee0bfe170037342a","ref":"","required":false,"desc":"If known, a User ID is the best way to add a user as an admin","default":"","type":"string","name":"id","in":"body"},{"_id":"571a960dd2ed1c17005a7962","ref":"","required":false,"desc":"f the User ID is not known, a user can be added as an admin via their email address. Use the email address if the worker does not currently have a Staffjoy account.","default":"","type":"string","name":"email","in":"body"},{"_id":"57166b4cb5af590e00a0ffc6","ref":"","required":false,"desc":"the user is being invited to sign up for Staffjoy, a name can optionally be given to the worker","default":"","type":"string","name":"name","in":"body"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"username\": null,\n    \"confirmed\": true,\n    \"name\": \"Leonhard Euler\",\n    \"active\": true,\n    \"member_since\": \"2015-11-08T23:05:26\",\n    \"last_seen\": \"2016-04-22T21:26:44\",\n    \"sudo\": false,\n    \"email\": \"leonhard@staffjoy.com\",\n    \"id\": 421\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/admins/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Organization Admin\"\n}\n[/block]","category":"571a92fcd2ed1c17005a7955","createdAt":"2016-04-22T21:21:30.735Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"create-organization-admin","sync_unique":"","title":"Create Organization Admin","type":"post","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

postCreate Organization Admin


Path Params

organization_id:
required
integer
ID of the organization

Body Params

id:
string
If known, a User ID is the best way to add a user as an admin
email:
string
f the User ID is not known, a user can be added as an admin via their email address. Use the email address if the worker does not currently have a Staffjoy account.
name:
string
the user is being invited to sign up for Staffjoy, a name can optionally be given to the worker

Permission Required: Organization Admin


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/admins/ -X POST -d "email=leonhard@staffjoy.com"

Result Format

{
    "username": null,
    "confirmed": true,
    "name": "Leonhard Euler",
    "active": true,
    "member_since": "2015-11-08T23:05:26",
    "last_seen": "2016-04-22T21:26:44",
    "sudo": false,
    "email": "leonhard@staffjoy.com",
    "id": 421
}


{"__v":1,"_id":"571a97c4f504f81700e41f31","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/admins/2"}]},"method":"get","params":[{"_id":"57167483b5af590e00a0fff0","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57167483b5af590e00a0ffef","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": {\n        \"username\": \"rosalind\",\n        \"confirmed\": true,\n        \"name\": \"Rosalind Franklin\",\n        \"active\": true,\n        \"member_since\": \"2015-02-14T20:53:31\",\n        \"last_seen\": \"2016-04-22T21:35:43.355940\",\n        \"sudo\": true,\n        \"email\": \"rosalind@staffjoy.com\",\n        \"id\": 2\n    },\n    \"resources\": []\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/admins/:user_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Organization Admin\"\n}\n[/block]","category":"571a92fcd2ed1c17005a7955","createdAt":"2016-04-22T21:29:40.881Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"admin","sync_unique":"","title":"Admin","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAdmin


Path Params

organization_id:
required
integer
ID of the organization
user_id:
required
integer
ID of the user

Permission Required: Organization Admin


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/admins/2

Result Format

{
    "data": {
        "username": "rosalind",
        "confirmed": true,
        "name": "Rosalind Franklin",
        "active": true,
        "member_since": "2015-02-14T20:53:31",
        "last_seen": "2016-04-22T21:35:43.355940",
        "sudo": true,
        "email": "rosalind@staffjoy.com",
        "id": 2
    },
    "resources": []
}


{"__v":0,"_id":"57279fac0fe9c40e005ba8ea","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/admins/2 -X PATCH -d \"activateReminder=true\""}]},"method":"patch","params":[{"_id":"57167483b5af590e00a0fff0","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57167483b5af590e00a0ffef","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"57279fac0fe9c40e005ba8eb","ref":"","required":false,"desc":"an email will be sent to remind the user to sign up for Staffjoy","default":"","type":"boolean","name":"activateReminder","in":"body"}],"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""}]},"settings":"","url":"/organizations/:organization_id/admins/:user_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Organization Admin\"\n}\n[/block]","category":"571a92fcd2ed1c17005a7955","createdAt":"2016-05-02T18:42:52.499Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"modify-an-admin","sync_unique":"","title":"Modify an Admin","type":"patch","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

patchModify an Admin


Path Params

organization_id:
required
integer
ID of the organization
user_id:
required
integer
ID of the user

Body Params

activateReminder:
boolean
an email will be sent to remind the user to sign up for Staffjoy

Permission Required: Organization Admin


User Information

Try It Out

patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/admins/2 -X PATCH -d "activateReminder=true"

Result Format



{"__v":0,"_id":"571a97dfeeb4160e002ce9d3","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/admins/2 -X DELETE"}]},"method":"delete","params":[{"_id":"57167815810df00e00cc7aae","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57167815810df00e00cc7aad","default":"","desc":"ID of the user being removed from admin permissions","name":"user_id","ref":"","required":true,"type":"boolean","in":"path"}],"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""}]},"settings":"","url":"/organizations/:organization_id/admins/:user_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Organization Admin\"\n}\n[/block]","category":"571a92fcd2ed1c17005a7955","createdAt":"2016-04-22T21:30:07.940Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"delete-an-admin","sync_unique":"","title":"Delete an Admin","type":"delete","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

deleteDelete an Admin


Path Params

organization_id:
required
integer
ID of the organization
user_id:
required
boolean
ID of the user being removed from admin permissions

Permission Required: Organization Admin


User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/admins/2 -X DELETE

Result Format



{"__v":4,"_id":"5717c29cab848c19009d10e8","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/workers/","language":"curl"}]},"method":"get","params":[{"_id":"5717c29cab848c19009d10eb","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"571a9464f504f81700e41f27","ref":"","required":false,"desc":"filter results by workers that have been archived or not","default":"","type":"boolean","name":"archived","in":"query"},{"_id":"571a9464f504f81700e41f26","ref":"","required":false,"desc":"filter results by the given email address","default":"","type":"string","name":"filter_by_email","in":"query"},{"_id":"571a9464f504f81700e41f24","ref":"","required":false,"desc":"filter results by the given location ID","default":"","type":"int","name":"filter_by_location_id","in":"query"},{"_id":"571a9464f504f81700e41f25","ref":"","required":false,"desc":"filter results by the given role ID","default":"","type":"int","name":"filter_by_role_id","in":"query"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": [\n        {\n            \"archived\": false,\n            \"role_name\": \"Hackers\",\n            \"location_name\": \"San Francisco\",\n            \"name\": \"Leonhard Euler\",\n            \"user_id\": 1,\n            \"location_id\": 6,\n            \"email\": \"leonhard@staffjoy.com\",\n            \"role_id\": 656\n        },\n        {\n            \"archived\": false,\n            \"role_name\": \"Hackers\",\n            \"location_name\": \"San Francisco\",\n            \"name\": \"Rosalind Franklin\",\n            \"user_id\": 2,\n            \"location_id\": 6,\n            \"email\": \"rosalind@staffjoy.com\",\n            \"role_id\": 656\n        },\n        {\n            \"archived\": false,\n            \"role_name\": \"Hackers\",\n            \"location_name\": \"San Francisco\",\n            \"name\": \"Nikola Tesla\",\n            \"user_id\": 706,\n            \"location_id\": 6,\n            \"email\": \"tesla@staffjoy.com\",\n            \"role_id\": 656\n        },\n        {\n            \"archived\": true,\n            \"role_name\": \"Hackers\",\n            \"location_name\": \"San Francisco\",\n            \"name\": \"George Dantzig\",\n            \"user_id\": 95,\n            \"location_id\": 6,\n            \"email\": \"dantzig@7bridg.es\",\n            \"role_id\": 656\n        },\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/workers/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Organization Member\"\n}\n[/block]\nThe response contains the essential information to access the main endpoint for a worker in the organization hierarchy.","category":"5717c1aa9c10132400d0ba6c","createdAt":"2016-04-20T17:55:40.622Z","editedParams":true,"editedParams2":true,"excerpt":"Makes it easy to access all workers in an organization and to find a worker's location within the organization hierarchy.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-organization-workers","sync_unique":"","title":"All Organization Workers","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Organization Workers

Makes it easy to access all workers in an organization and to find a worker's location within the organization hierarchy.

Path Params

organization_id:
required
integer
ID of the organization

Query Params

archived:
boolean
filter results by workers that have been archived or not
filter_by_email:
string
filter results by the given email address
filter_by_location_id:
integer
filter results by the given location ID
filter_by_role_id:
integer
filter results by the given role ID

Permission Required: Organization Member

The response contains the essential information to access the main endpoint for a worker in the organization hierarchy.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/workers/

Result Format

{
    "data": [
        {
            "archived": false,
            "role_name": "Hackers",
            "location_name": "San Francisco",
            "name": "Leonhard Euler",
            "user_id": 1,
            "location_id": 6,
            "email": "leonhard@staffjoy.com",
            "role_id": 656
        },
        {
            "archived": false,
            "role_name": "Hackers",
            "location_name": "San Francisco",
            "name": "Rosalind Franklin",
            "user_id": 2,
            "location_id": 6,
            "email": "rosalind@staffjoy.com",
            "role_id": 656
        },
        {
            "archived": false,
            "role_name": "Hackers",
            "location_name": "San Francisco",
            "name": "Nikola Tesla",
            "user_id": 706,
            "location_id": 6,
            "email": "tesla@staffjoy.com",
            "role_id": 656
        },
        {
            "archived": true,
            "role_name": "Hackers",
            "location_name": "San Francisco",
            "name": "George Dantzig",
            "user_id": 95,
            "location_id": 6,
            "email": "dantzig@7bridg.es",
            "role_id": 656
        },
    ]
}


{"__v":3,"_id":"5716635a5d90dc170060ef2f","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/"}]},"method":"get","params":[{"_id":"5716638f3389e81900a488ed","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57166508893cbe0e002d7675","default":"","desc":"If true, all corresponding roles will be returned with each result","name":"recurse","ref":"","required":false,"type":"boolean","in":"query"},{"_id":"57166508893cbe0e002d7674","default":"","desc":"filter results by the archived flag. Use false to return only current locations","name":"archived","ref":"","required":false,"type":"boolean","in":"query"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": [\n        {\n            \"organization_id\": 1,\n            \"timezone\": \"America/Los_Angeles\",\n            \"archived\": false,\n            \"id\": 6,\n            \"name\": \"San Francisco\"\n        },\n        {\n            \"organization_id\": 1,\n            \"timezone\": \"America/Los_Angeles\",\n            \"archived\": true,\n            \"id\": 425,\n            \"name\": \"A Deleted Location\"\n        },\n        {\n            \"organization_id\": 1,\n            \"timezone\": \"America/Los_Angeles\",\n            \"archived\": false,\n            \"id\": 542,\n            \"name\": \"Portland\"\n        }\n    ]\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Organization Member\"\n}\n[/block]","category":"56fbf8940256470e005253a0","createdAt":"2016-04-19T16:56:58.303Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"locations","sync_unique":"","title":"All Locations","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Locations


Path Params

organization_id:
required
integer
ID of the organization

Query Params

recurse:
boolean
If true, all corresponding roles will be returned with each result
archived:
boolean
filter results by the archived flag. Use false to return only current locations

Permission Required: Organization Member


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/

Result Format

{
    "data": [
        {
            "organization_id": 1,
            "timezone": "America/Los_Angeles",
            "archived": false,
            "id": 6,
            "name": "San Francisco"
        },
        {
            "organization_id": 1,
            "timezone": "America/Los_Angeles",
            "archived": true,
            "id": 425,
            "name": "A Deleted Location"
        },
        {
            "organization_id": 1,
            "timezone": "America/Los_Angeles",
            "archived": false,
            "id": 542,
            "name": "Portland"
        }
    ]
}


{"__v":1,"_id":"57166a9540ef9c2000caca0d","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/ -X POST -d \"name=Oakland\" -d \"timezone=America/Los_Angeles\""}]},"method":"post","params":[{"_id":"57166b4cb5af590e00a0ffc7","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57166b4cb5af590e00a0ffc6","ref":"","required":false,"desc":"The name of the location","default":"","type":"string","name":"name","in":"body"},{"_id":"57166b4cb5af590e00a0ffc5","ref":"","required":false,"desc":"The timezone that this location is situated in, will be UTC by default","default":"","type":"string","name":"timezone","in":"body"}],"results":{"codes":[{"name":"","code":"{\n  \"organization_id\": 1,\n  \"timezone\": \"America/Los_Angeles\",\n  \"archived\": false,\n  \"id\": 556,\n  \"name\": \"Oakland\"\n}","language":"json","status":201}]},"settings":"","url":"/organizations/:organization_id/locations/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Organization Admin\"\n}\n[/block]","category":"56fbf8940256470e005253a0","createdAt":"2016-04-19T17:27:49.860Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"create-location","sync_unique":"","title":"Create Location","type":"post","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

postCreate Location


Path Params

organization_id:
required
integer
ID of the organization

Body Params

name:
string
The name of the location
timezone:
string
The timezone that this location is situated in, will be UTC by default

Permission Required: Organization Admin


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/ -X POST -d "name=Oakland" -d "timezone=America/Los_Angeles"

Result Format

{
  "organization_id": 1,
  "timezone": "America/Los_Angeles",
  "archived": false,
  "id": 556,
  "name": "Oakland"
}


{"__v":1,"_id":"5716739b810df00e00cc7a95","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6"}]},"method":"get","params":[{"_id":"57167483b5af590e00a0fff0","default":"","desc":"ID of the organization","name":"organization_id","ref":"","required":true,"type":"int","in":"path"},{"_id":"57167483b5af590e00a0ffef","default":"","desc":"ID of the location","name":"location_id","ref":"","required":true,"type":"int","in":"path"},{"_id":"57167483b5af590e00a0ffee","default":"","desc":"If true, all corresponding roles will be returned with the response.","name":"recurse","ref":"","required":false,"type":"boolean","in":"query"},{"_id":"57167483b5af590e00a0ffed","default":"","desc":"If recurse is set to true, this parameter will filter roles by their archived property. Use false to return only active roles.","name":"archived","ref":"","required":false,"type":"boolean","in":"query"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": {\n        \"organization_id\": 1,\n        \"timezone\": \"America/Los_Angeles\",\n        \"archived\": false,\n        \"id\": 6,\n        \"name\": \"San Francisco\"\n    },\n    \"resources\": [\n        \"roles\",\n        \"attendance\"\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Organization Member\"\n}\n[/block]","category":"56fbf8940256470e005253a0","createdAt":"2016-04-19T18:06:19.498Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"location","sync_unique":"","title":"Location","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getLocation


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location

Query Params

recurse:
boolean
If true, all corresponding roles will be returned with the response.
archived:
boolean
If recurse is set to true, this parameter will filter roles by their archived property. Use false to return only active roles.

Permission Required: Organization Member


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6

Result Format

{
    "data": {
        "organization_id": 1,
        "timezone": "America/Los_Angeles",
        "archived": false,
        "id": 6,
        "name": "San Francisco"
    },
    "resources": [
        "roles",
        "attendance"
    ]
}


{"__v":2,"_id":"571673a43389e81900a48937","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6 -X PATCH -d \"name=San Mateo\""}]},"method":"patch","params":[{"_id":"5716790c893cbe0e002d76d0","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5716790c893cbe0e002d76cf","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5716790c893cbe0e002d76ce","ref":"","required":false,"desc":"The name of the location","default":"","type":"string","name":"name","in":"body"},{"_id":"5716790c893cbe0e002d76cd","default":"","desc":"Toggle the archived state of the location","name":"archived","ref":"","required":false,"type":"boolean","in":"body"}],"results":{"codes":[{"name":"","code":"{\n    \"name\": \"San Mateo\"\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Organization Admin\",\n  \"body\": \"However only Staffjoy support can use the archived parameter.\"\n}\n[/block]","category":"56fbf8940256470e005253a0","createdAt":"2016-04-19T18:06:28.525Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"modify-a-location","sync_unique":"","title":"Modify a Location","type":"patch","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

patchModify a Location


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location

Body Params

name:
string
The name of the location
archived:
boolean
Toggle the archived state of the location

Permission Required: Organization Admin

However only Staffjoy support can use the archived parameter.


User Information

Try It Out

patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6 -X PATCH -d "name=San Mateo"

Result Format

{
    "name": "San Mateo"
}


{"__v":1,"_id":"571673b85d90dc170060ef6f","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6 -X DELETE"}]},"method":"delete","params":[{"_id":"57167815810df00e00cc7aae","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57167815810df00e00cc7aad","ref":"","required":true,"desc":"ID of the location","default":"","type":"boolean","name":"location_id","in":"path"}],"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Organization Admin\"\n}\n[/block]","category":"56fbf8940256470e005253a0","createdAt":"2016-04-19T18:06:48.893Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"delete-location","sync_unique":"","title":"Delete Location","type":"delete","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

deleteDelete Location


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
boolean
ID of the location

Permission Required: Organization Admin


User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6 -X DELETE

Result Format



{"__v":1,"_id":"573bb26674d9f20e00c14f25","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/shifts/?start=2016-05-22&end=2016-05-25"}]},"method":"get","params":[{"_id":"5717c29cab848c19009d10eb","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5727a1af51a8c90e00bdb584","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"573bb30cf09c292200b39736","default":"","desc":"Searches for shifts that start after this time (Iso8601 datetime)","name":"start","ref":"","required":false,"type":"string","in":"query"},{"_id":"573bb30cf09c292200b39735","ref":"","required":false,"desc":"Searches for shifts that start before this time (Iso8601 datetime)","default":"","type":"string","name":"end","in":"query"},{"_id":"573bb30cf09c292200b39734","default":"","desc":"If true, will return all assigned shifts that are current","name":"active","ref":"","required":false,"type":"boolean","in":"query"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": [\n        {\n            \"user_id\": 1,\n            \"stop\": \"2016-05-24T00:00:00\",\n            \"role_id\": 656,\n            \"start\": \"2016-05-23T16:00:00\",\n            \"published\": false,\n            \"user_name\": \"Leonhard Euler\",\n            \"id\": 42376\n        },\n        {\n            \"user_id\": 1,\n            \"stop\": \"2016-05-25T00:00:00\",\n            \"role_id\": 656,\n            \"start\": \"2016-05-24T16:00:00\",\n            \"published\": false,\n            \"user_name\": \"Rosalind Franklin\",\n            \"id\": 42377\n        },\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/shifts/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"573bb2522cf9af3200d588b3","createdAt":"2016-05-18T00:08:06.994Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"location-shifts","sync_unique":"","title":"Location Shifts","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getLocation Shifts


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location

Query Params

start:
string
Searches for shifts that start after this time (Iso8601 datetime)
end:
string
Searches for shifts that start before this time (Iso8601 datetime)
active:
boolean
If true, will return all assigned shifts that are current

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/shifts/?start=2016-05-22&end=2016-05-25

Result Format

{
    "data": [
        {
            "user_id": 1,
            "stop": "2016-05-24T00:00:00",
            "role_id": 656,
            "start": "2016-05-23T16:00:00",
            "published": false,
            "user_name": "Leonhard Euler",
            "id": 42376
        },
        {
            "user_id": 1,
            "stop": "2016-05-25T00:00:00",
            "role_id": 656,
            "start": "2016-05-24T16:00:00",
            "published": false,
            "user_name": "Rosalind Franklin",
            "id": 42377
        },
    ]
}


{"__v":0,"_id":"573bb32eee2b3b2200422953","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/timeclocks/?active=true"}]},"method":"get","params":[{"_id":"5717c29cab848c19009d10eb","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5727a1af51a8c90e00bdb584","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"573bb30cf09c292200b39736","ref":"","required":false,"desc":"Searches for timeclocks that start after this time (Iso8601 datetime)","default":"","type":"string","name":"start","in":"query"},{"_id":"573bb30cf09c292200b39735","default":"","desc":"Searches for timeclocks that start before this time (Iso8601 datetime)","name":"end","ref":"","required":false,"type":"string","in":"query"},{"_id":"573bb30cf09c292200b39734","default":"","desc":"If true, will only search for active timeclocks","name":"active","ref":"","required":false,"type":"boolean","in":"query"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": [\n        {\n            \"id\": 114, \n            \"role_id\": 1, \n            \"start\": \"2016-05-18T01:38:31\", \n            \"stop\": null, \n            \"user_id\": 2\n        }\n    ]\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/timeclocks/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"573bb2522cf9af3200d588b3","createdAt":"2016-05-18T00:11:26.806Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"location-timeclocks","sync_unique":"","title":"Location Timeclocks","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getLocation Timeclocks


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location

Query Params

start:
string
Searches for timeclocks that start after this time (Iso8601 datetime)
end:
string
Searches for timeclocks that start before this time (Iso8601 datetime)
active:
boolean
If true, will only search for active timeclocks

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/timeclocks/?active=true

Result Format

{
    "data": [
        {
            "id": 114, 
            "role_id": 1, 
            "start": "2016-05-18T01:38:31", 
            "stop": null, 
            "user_id": 2
        }
    ]
}


{"__v":0,"_id":"573bb33aee2b3b2200422954","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/timeoffrequests/?start=2016-05-01&end=2016-05-31"}]},"method":"get","params":[{"_id":"5717c29cab848c19009d10eb","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5727a1af51a8c90e00bdb584","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"573bb30cf09c292200b39736","ref":"","required":false,"desc":"Searches for timeclocks that start after this time (Iso8601 datetime)","default":"","type":"string","name":"start","in":"query"},{"_id":"573bb30cf09c292200b39735","ref":"","required":false,"desc":"Searches for shifts that start before this time (Iso8601 datetime)","default":"","type":"string","name":"end","in":"query"},{"_id":"573bb30cf09c292200b39734","default":"","desc":"Filter results by a specific state","name":"state","ref":"","required":false,"type":"string","in":"query"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": [\n        {\n            \"start\": \"2016-05-26T07:00:00\",\n            \"state\": \"approved_paid\",\n            \"user_id\": 1,\n            \"approver_user_id\": 2,\n            \"minutes_paid\": 240,\n            \"stop\": \"2016-05-27T07:00:00\",\n            \"id\": 368,\n            \"role_id\": 656\n        },\n        {\n            \"start\": \"2016-05-11T07:00:00\",\n            \"state\": \"approved_unpaid\",\n            \"user_id\": 2,\n            \"approver_user_id\": 2,\n            \"minutes_paid\": 480,\n            \"stop\": \"2016-05-12T07:00:00\",\n            \"id\": 369,\n            \"role_id\": 656\n        },\n    ]\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/timeoffrequests/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"573bb2522cf9af3200d588b3","createdAt":"2016-05-18T00:11:38.394Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"location-time-off-requests","sync_unique":"","title":"Location Time Off Requests","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getLocation Time Off Requests


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location

Query Params

start:
string
Searches for timeclocks that start after this time (Iso8601 datetime)
end:
string
Searches for shifts that start before this time (Iso8601 datetime)
state:
string
Filter results by a specific state

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/timeoffrequests/?start=2016-05-01&end=2016-05-31

Result Format

{
    "data": [
        {
            "start": "2016-05-26T07:00:00",
            "state": "approved_paid",
            "user_id": 1,
            "approver_user_id": 2,
            "minutes_paid": 240,
            "stop": "2016-05-27T07:00:00",
            "id": 368,
            "role_id": 656
        },
        {
            "start": "2016-05-11T07:00:00",
            "state": "approved_unpaid",
            "user_id": 2,
            "approver_user_id": 2,
            "minutes_paid": 480,
            "stop": "2016-05-12T07:00:00",
            "id": 369,
            "role_id": 656
        },
    ]
}


{"__v":1,"_id":"5727a161872d4e0e000a9167","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/managers/"}]},"method":"get","params":[{"_id":"5717c29cab848c19009d10eb","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5727a1af51a8c90e00bdb584","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": [\n        {\n            \"username\": null,\n            \"confirmed\": true,\n            \"name\": \"Leonhard Euler\",\n            \"active\": true,\n            \"member_since\": \"2015-11-08T23:05:26\",\n            \"last_seen\": \"2016-04-22T21:26:44\",\n            \"sudo\": false,\n            \"email\": \"leonhard@staffjoy.com\",\n            \"id\": 421\n        }\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/managers/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"57279c1e90a5580e0041908b","createdAt":"2016-05-02T18:50:09.445Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-managers","sync_unique":"","title":"All Managers","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Managers


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/managers/

Result Format

{
    "data": [
        {
            "username": null,
            "confirmed": true,
            "name": "Leonhard Euler",
            "active": true,
            "member_since": "2015-11-08T23:05:26",
            "last_seen": "2016-04-22T21:26:44",
            "sudo": false,
            "email": "leonhard@staffjoy.com",
            "id": 421
        }
    ]
}


{"__v":1,"_id":"5727a16dbd0e510e00a888dc","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/managers/ -X POST -d \"email=leonhard@staffjoy.com\"","language":"curl"}]},"method":"post","params":[{"_id":"57166b4cb5af590e00a0ffc7","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5727a221872d4e0e000a916a","ref":"","required":true,"desc":"ID of the location","default":"","type":"string","name":"location_id","in":"path"},{"_id":"571a960aee0bfe170037342a","default":"","desc":"If known, a User ID is the best way to add a user as a manager","name":"id","ref":"","required":false,"type":"string","in":"body"},{"_id":"571a960dd2ed1c17005a7962","default":"","desc":"If the User ID is not known, a manager can be added as an admin via their email address. Use the email address if the user does not currently have a Staffjoy account.","name":"email","ref":"","required":false,"type":"string","in":"body"},{"_id":"57166b4cb5af590e00a0ffc6","default":"","desc":"If the user is being invited to sign up for Staffjoy, a name can optionally be given to the manager","name":"name","ref":"","required":false,"type":"string","in":"body"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"username\": null,\n    \"confirmed\": true,\n    \"name\": \"Leonhard Euler\",\n    \"active\": true,\n    \"member_since\": \"2015-11-08T23:05:26\",\n    \"last_seen\": \"2016-04-22T21:26:44\",\n    \"sudo\": false,\n    \"email\": \"leonhard@staffjoy.com\",\n    \"id\": 421\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/managers/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"57279c1e90a5580e0041908b","createdAt":"2016-05-02T18:50:21.517Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"create-a-manager","sync_unique":"","title":"Create a Manager","type":"post","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

postCreate a Manager


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
string
ID of the location

Body Params

id:
string
If known, a User ID is the best way to add a user as a manager
email:
string
If the User ID is not known, a manager can be added as an admin via their email address. Use the email address if the user does not currently have a Staffjoy account.
name:
string
If the user is being invited to sign up for Staffjoy, a name can optionally be given to the manager

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/managers/ -X POST -d "email=leonhard@staffjoy.com"

Result Format

{
    "username": null,
    "confirmed": true,
    "name": "Leonhard Euler",
    "active": true,
    "member_since": "2015-11-08T23:05:26",
    "last_seen": "2016-04-22T21:26:44",
    "sudo": false,
    "email": "leonhard@staffjoy.com",
    "id": 421
}


{"__v":1,"_id":"5727a17a51a8c90e00bdb583","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/managers/421"}]},"method":"get","params":[{"_id":"57167483b5af590e00a0fff0","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5727a9980fe9c40e005ba916","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57167483b5af590e00a0ffef","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": {\n        \"username\": null,\n        \"confirmed\": true,\n        \"name\": \"Leonhard Euler\",\n        \"active\": true,\n        \"member_since\": \"2015-11-08T23:05:26\",\n        \"last_seen\": \"2016-04-22T21:26:44\",\n        \"sudo\": false,\n        \"email\": \"leonhard@staffjoy.com\",\n        \"id\": 421\n    },\n    \"resources\": []\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/managers/:user_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"57279c1e90a5580e0041908b","createdAt":"2016-05-02T18:50:34.586Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"manager","sync_unique":"","title":"Manager","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getManager


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
user_id:
required
integer
ID of the user

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/managers/421

Result Format

{
    "data": {
        "username": null,
        "confirmed": true,
        "name": "Leonhard Euler",
        "active": true,
        "member_since": "2015-11-08T23:05:26",
        "last_seen": "2016-04-22T21:26:44",
        "sudo": false,
        "email": "leonhard@staffjoy.com",
        "id": 421
    },
    "resources": []
}


{"__v":1,"_id":"57279fb790a5580e0041909f","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/managers/2 -X PATCH -d \"activateReminder=true\""}]},"method":"patch","params":[{"_id":"57167483b5af590e00a0fff0","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5727a04651a8c90e00bdb57a","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57167483b5af590e00a0ffef","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"57279fac0fe9c40e005ba8eb","ref":"","required":false,"desc":"an email will be sent to remind the user to sign up for Staffjoy","default":"","type":"boolean","name":"activateReminder","in":"body"}],"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/managers/:user_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"57279c1e90a5580e0041908b","createdAt":"2016-05-02T18:43:03.659Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"modify-a-manager","sync_unique":"","title":"Modify a Manager","type":"patch","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

patchModify a Manager


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
user_id:
required
integer
ID of the user

Body Params

activateReminder:
boolean
an email will be sent to remind the user to sign up for Staffjoy

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/managers/2 -X PATCH -d "activateReminder=true"

Result Format



{"__v":0,"_id":"5727aa650fe9c40e005ba919","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/managers/421 -X DELETE"}]},"method":"delete","params":[{"_id":"57167483b5af590e00a0fff0","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5727a9980fe9c40e005ba916","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57167483b5af590e00a0ffef","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"}],"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/managers/:user_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"57279c1e90a5580e0041908b","createdAt":"2016-05-02T19:28:37.422Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"delete-a-manager","sync_unique":"","title":"Delete a Manager","type":"delete","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

deleteDelete a Manager


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
user_id:
required
integer
ID of the user

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/managers/421 -X DELETE

Result Format



{"__v":0,"_id":"57169f4eed1e5e2000bd684a","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/attendance/ -d \"startDate=2016-04-05\" -d \"endDate=2016-04-05\""}]},"method":"get","params":[{"_id":"57169f4eed1e5e2000bd684e","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57169f4eed1e5e2000bd684d","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57169f4eed1e5e2000bd684c","default":"","desc":"the start date of the query","name":"startDate","ref":"","required":true,"type":"yyyy-mm-dd","in":"query"},{"_id":"57169f4eed1e5e2000bd684b","default":"","desc":"the end date of the query","name":"endDate","ref":"","required":true,"type":"yyyy-mm-dd","in":"query"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": {\n        \"2016-04-05\": [\n            {\n                \"time_off_requests\": null,\n                \"user_id\": 1,\n                \"role_id\": 656,\n                \"timeclocks\": [\n                    {\n                        \"user_id\": 1,\n                        \"stop\": \"2016-04-06T15:57:57\",\n                        \"role_id\": 656,\n                        \"organization_id\": 1,\n                        \"start\": \"2016-04-05T23:43:32\",\n                        \"location_id\": 6,\n                        \"id\": 7140\n                    }\n                ],\n                \"shifts\": [],\n                \"logged_time\": 58465\n            },\n            {\n                \"time_off_requests\": null,\n                \"user_id\": 706,\n                \"role_id\": 656,\n                \"timeclocks\": [\n                    {\n                        \"user_id\": 706,\n                        \"stop\": \"2016-04-06T02:10:07\",\n                        \"role_id\": 656,\n                        \"organization_id\": 1,\n                        \"start\": \"2016-04-05T16:39:37\",\n                        \"location_id\": 6,\n                        \"id\": 7100\n                    }\n                ],\n                \"shifts\": [\n                    {\n                        \"user_id\": 706,\n                        \"stop\": \"2016-04-06T00:00:00\",\n                        \"role_id\": 656,\n                        \"start\": \"2016-04-05T16:00:00\",\n                        \"published\": true,\n                        \"user_name\": \"Marc Schechter\",\n                        \"id\": 41674\n                    }\n                ],\n                \"logged_time\": 34230\n            },\n            {\n                \"time_off_requests\": null,\n                \"user_id\": 674,\n                \"role_id\": 657,\n                \"timeclocks\": [\n                    {\n                        \"user_id\": 674,\n                        \"stop\": \"2016-04-06T05:09:14\",\n                        \"role_id\": 657,\n                        \"organization_id\": 1,\n                        \"start\": \"2016-04-06T03:17:33\",\n                        \"location_id\": 6,\n                        \"id\": 7144\n                    }\n                ],\n                \"shifts\": [],\n                \"logged_time\": 6701\n            }\n        ]\n    },\n    \"summary\": [\n        {\n            \"scheduled_time\": 0,\n            \"shift_count\": 0,\n            \"user_id\": 1,\n            \"timeclock_count\": 1,\n            \"time_off_request_count\": 0,\n            \"role_id\": 656,\n            \"logged_time\": 58465\n        },\n        {\n            \"scheduled_time\": 28800,\n            \"shift_count\": 1,\n            \"user_id\": 706,\n            \"timeclock_count\": 1,\n            \"time_off_request_count\": 0,\n            \"role_id\": 656,\n            \"logged_time\": 34230\n        },\n        {\n            \"scheduled_time\": 0,\n            \"shift_count\": 0,\n            \"user_id\": 674,\n            \"timeclock_count\": 1,\n            \"time_off_request_count\": 0,\n            \"role_id\": 657,\n            \"logged_time\": 6701\n        }\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/attendance/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]\n* The response gives all activity for each worker, grouped by each day.\n* Each day is recognized as midnight to midnight on the calendar date of the location's timezone.\n* All timestamps returned are in Iso8601 format and in UTC time.","category":"57169d0dbdc0fe2000fc4f5b","createdAt":"2016-04-19T21:12:46.695Z","editedParams":true,"editedParams2":true,"excerpt":"This is a read-only endpoint that collects and groups data for shifts, timeclocks, and time off requests.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"location-attendance","sync_unique":"","title":"Location Attendance","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getLocation Attendance

This is a read-only endpoint that collects and groups data for shifts, timeclocks, and time off requests.

Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location

Query Params

startDate:
required
yyyy-mm-dd
the start date of the query
endDate:
required
yyyy-mm-dd
the end date of the query

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.

  • The response gives all activity for each worker, grouped by each day.
  • Each day is recognized as midnight to midnight on the calendar date of the location's timezone.
  • All timestamps returned are in Iso8601 format and in UTC time.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/attendance/ -d "startDate=2016-04-05" -d "endDate=2016-04-05"

Result Format

{
    "data": {
        "2016-04-05": [
            {
                "time_off_requests": null,
                "user_id": 1,
                "role_id": 656,
                "timeclocks": [
                    {
                        "user_id": 1,
                        "stop": "2016-04-06T15:57:57",
                        "role_id": 656,
                        "organization_id": 1,
                        "start": "2016-04-05T23:43:32",
                        "location_id": 6,
                        "id": 7140
                    }
                ],
                "shifts": [],
                "logged_time": 58465
            },
            {
                "time_off_requests": null,
                "user_id": 706,
                "role_id": 656,
                "timeclocks": [
                    {
                        "user_id": 706,
                        "stop": "2016-04-06T02:10:07",
                        "role_id": 656,
                        "organization_id": 1,
                        "start": "2016-04-05T16:39:37",
                        "location_id": 6,
                        "id": 7100
                    }
                ],
                "shifts": [
                    {
                        "user_id": 706,
                        "stop": "2016-04-06T00:00:00",
                        "role_id": 656,
                        "start": "2016-04-05T16:00:00",
                        "published": true,
                        "user_name": "Marc Schechter",
                        "id": 41674
                    }
                ],
                "logged_time": 34230
            },
            {
                "time_off_requests": null,
                "user_id": 674,
                "role_id": 657,
                "timeclocks": [
                    {
                        "user_id": 674,
                        "stop": "2016-04-06T05:09:14",
                        "role_id": 657,
                        "organization_id": 1,
                        "start": "2016-04-06T03:17:33",
                        "location_id": 6,
                        "id": 7144
                    }
                ],
                "shifts": [],
                "logged_time": 6701
            }
        ]
    },
    "summary": [
        {
            "scheduled_time": 0,
            "shift_count": 0,
            "user_id": 1,
            "timeclock_count": 1,
            "time_off_request_count": 0,
            "role_id": 656,
            "logged_time": 58465
        },
        {
            "scheduled_time": 28800,
            "shift_count": 1,
            "user_id": 706,
            "timeclock_count": 1,
            "time_off_request_count": 0,
            "role_id": 656,
            "logged_time": 34230
        },
        {
            "scheduled_time": 0,
            "shift_count": 0,
            "user_id": 674,
            "timeclock_count": 1,
            "time_off_request_count": 0,
            "role_id": 657,
            "logged_time": 6701
        }
    ]
}


{"__v":1,"_id":"57167abfb5af590e00a1001b","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/"}]},"method":"get","params":[{"_id":"57167bd1893cbe0e002d76e3","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57167bd1893cbe0e002d76e2","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57167bd1893cbe0e002d76e1","ref":"","required":false,"desc":"If true, all corresponding workers will be returned with each result","default":"","type":"boolean","name":"recurse","in":"query"},{"_id":"57167bd1893cbe0e002d76e0","ref":"","required":false,"desc":"Filter results by the archived flag. Use false to return only current roles","default":"","type":"boolean","name":"archived","in":"query"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": [\n        {\n            \"max_hours_per_workday\": 8,\n            \"archived\": false,\n            \"enable_timeclock\": true,\n            \"name\": \"Hackers\",\n            \"max_consecutive_workdays\": 6,\n            \"min_hours_between_shifts\": 12,\n            \"enable_time_off_requests\": true,\n            \"location_id\": 6,\n            \"id\": 656,\n            \"min_hours_per_workday\": 4\n        },\n        {\n            \"max_hours_per_workday\": 8,\n            \"archived\": false,\n            \"enable_timeclock\": true,\n            \"name\": \"Contracting\",\n            \"max_consecutive_workdays\": 6,\n            \"min_hours_between_shifts\": 12,\n            \"enable_time_off_requests\": true,\n            \"location_id\": 6,\n            \"id\": 657,\n            \"min_hours_per_workday\": 4\n        }\n    ]\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Member\",\n  \"body\": \"Managers and workers within the location can access this in addition to organization administrators.\"\n}\n[/block]","category":"56fbf8960023171700b9614c","createdAt":"2016-04-19T18:36:47.025Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-roles","sync_unique":"","title":"All Roles","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Roles


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location

Query Params

recurse:
boolean
If true, all corresponding workers will be returned with each result
archived:
boolean
Filter results by the archived flag. Use false to return only current roles

Permission Required: Location Member

Managers and workers within the location can access this in addition to organization administrators.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/

Result Format

{
    "data": [
        {
            "max_hours_per_workday": 8,
            "archived": false,
            "enable_timeclock": true,
            "name": "Hackers",
            "max_consecutive_workdays": 6,
            "min_hours_between_shifts": 12,
            "enable_time_off_requests": true,
            "location_id": 6,
            "id": 656,
            "min_hours_per_workday": 4
        },
        {
            "max_hours_per_workday": 8,
            "archived": false,
            "enable_timeclock": true,
            "name": "Contracting",
            "max_consecutive_workdays": 6,
            "min_hours_between_shifts": 12,
            "enable_time_off_requests": true,
            "location_id": 6,
            "id": 657,
            "min_hours_per_workday": 4
        }
    ]
}


{"__v":2,"_id":"57167ac5810df00e00cc7ac1","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/ -X POST -d \"name=Dispatchers\"","language":"curl"}]},"method":"post","params":[{"_id":"571681b95d90dc170060efb4","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"571681b95d90dc170060efb3","default":"","desc":"ID of the location","name":"location_id","ref":"","required":true,"type":"int","in":"path"},{"_id":"571681b95d90dc170060efb2","ref":"","required":false,"desc":"The name of the role","default":"","type":"string","name":"name","in":"body"},{"_id":"571681b95d90dc170060efb1","ref":"","required":false,"desc":"The minimum amount of hours each worker of the role can be scheduled for on a given workday","default":"","type":"int","name":"min_hours_per_workday","in":"body"},{"_id":"571681b95d90dc170060efb0","ref":"","required":false,"desc":"The maximum amount of hours each worker of the role can be scheduled for on a given workday","default":"","type":"int","name":"max_hours_per_workday","in":"body"},{"_id":"571681b95d90dc170060efaf","ref":"","required":false,"desc":"The maximum amount of consecutive workdays that a worker is allowed to work","default":"","type":"int","name":"max_consecutive_workdays","in":"body"},{"_id":"571681b95d90dc170060efae","ref":"","required":false,"desc":"Define the minimum amount of time workers will be given between each shift","default":"","type":"int","name":"min_hours_between_shifts","in":"body"},{"_id":"571681b95d90dc170060efad","ref":"","required":false,"desc":"Allow workers to use the timeclock in My Schedules. If undefined, inherits from the organization default.","default":"","type":"boolean","name":"enable_timeclock","in":"body"},{"_id":"571681b95d90dc170060efac","ref":"","required":false,"desc":"Allow workers to make time off requests in My Schedules. If undefined, inherits from the organization default.","default":"","type":"boolean","name":"enable_time_off_requests","in":"body"}],"results":{"codes":[{"name":"","code":"{\n    \"max_hours_per_workday\": 8,\n    \"archived\": false,\n    \"enable_timeclock\": true,\n    \"name\": \"Dispatchers\",\n    \"max_consecutive_workdays\": 6,\n    \"min_hours_between_shifts\": 12,\n    \"enable_time_off_requests\": false,\n    \"location_id\": 6,\n    \"id\": 1042,\n    \"min_hours_per_workday\": 4\n}","language":"json","status":201}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"56fbf8960023171700b9614c","createdAt":"2016-04-19T18:36:53.233Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"create-role","sync_unique":"","title":"Create Role","type":"post","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

postCreate Role


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location

Body Params

name:
string
The name of the role
min_hours_per_workday:
integer
The minimum amount of hours each worker of the role can be scheduled for on a given workday
max_hours_per_workday:
integer
The maximum amount of hours each worker of the role can be scheduled for on a given workday
max_consecutive_workdays:
integer
The maximum amount of consecutive workdays that a worker is allowed to work
min_hours_between_shifts:
integer
Define the minimum amount of time workers will be given between each shift
enable_timeclock:
boolean
Allow workers to use the timeclock in My Schedules. If undefined, inherits from the organization default.
enable_time_off_requests:
boolean
Allow workers to make time off requests in My Schedules. If undefined, inherits from the organization default.

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/ -X POST -d "name=Dispatchers"

Result Format

{
    "max_hours_per_workday": 8,
    "archived": false,
    "enable_timeclock": true,
    "name": "Dispatchers",
    "max_consecutive_workdays": 6,
    "min_hours_between_shifts": 12,
    "enable_time_off_requests": false,
    "location_id": 6,
    "id": 1042,
    "min_hours_per_workday": 4
}


{"__v":1,"_id":"57167ad8b5af590e00a1001f","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656"}]},"method":"get","params":[{"_id":"571686df8d31b1190098dde7","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"571686df8d31b1190098dde6","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"571686df8d31b1190098dde5","ref":"","required":true,"desc":"Id of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"571686df8d31b1190098dde4","ref":"","required":false,"desc":"f true, all corresponding workers will be returned with the response.","default":"","type":"boolean","name":"recurse","in":"query"},{"_id":"571686df8d31b1190098dde3","ref":"","required":false,"desc":"If recurse is set to true, this parameter will filter workers by their archived property. Use false to return only active workers.","default":"","type":"string","name":"archived","in":"query"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": {\n        \"max_hours_per_workday\": 8,\n        \"archived\": false,\n        \"enable_timeclock\": true,\n        \"name\": \"Hackers\",\n        \"max_consecutive_workdays\": 6,\n        \"min_hours_between_shifts\": 12,\n        \"enable_time_off_requests\": true,\n        \"location_id\": 6,\n        \"id\": 656,\n        \"min_hours_per_workday\": 4\n    },\n    \"resources\": [\n        \"recurringshifts\",\n        \"schedules\",\n        \"shifts\",\n        \"users\"\n    ]\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Member\",\n  \"body\": \"Managers and workers within the location can access this in addition to organization administrators\"\n}\n[/block]","category":"56fbf8960023171700b9614c","createdAt":"2016-04-19T18:37:12.451Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"role","sync_unique":"","title":"Role","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getRole


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
Id of the role

Query Params

recurse:
boolean
f true, all corresponding workers will be returned with the response.
archived:
string
If recurse is set to true, this parameter will filter workers by their archived property. Use false to return only active workers.

Permission Required: Location Member

Managers and workers within the location can access this in addition to organization administrators


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656

Result Format

{
    "data": {
        "max_hours_per_workday": 8,
        "archived": false,
        "enable_timeclock": true,
        "name": "Hackers",
        "max_consecutive_workdays": 6,
        "min_hours_between_shifts": 12,
        "enable_time_off_requests": true,
        "location_id": 6,
        "id": 656,
        "min_hours_per_workday": 4
    },
    "resources": [
        "recurringshifts",
        "schedules",
        "shifts",
        "users"
    ]
}


{"__v":2,"_id":"57167ae43389e81900a48967","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656 -X PATCH -d \"name=Agents\""}]},"method":"patch","params":[{"_id":"5716930bec324f0e00b58044","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5716930bec324f0e00b58043","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5716930bec324f0e00b58042","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5716953da2892f0e0014bdfb","ref":"","required":false,"desc":"The name of the role","default":"","type":"string","name":"name","in":"body"},{"_id":"5716930bec324f0e00b58041","ref":"","required":false,"desc":"The minimum amount of hours each worker of the role can be scheduled for on a given workday","default":"","type":"int","name":"min_hours_per_workday","in":"body"},{"_id":"5716930bec324f0e00b58040","ref":"","required":false,"desc":"The maximum amount of hours each worker of the role can be scheduled for on a given workday","default":"","type":"int","name":"max_hours_per_workday","in":"body"},{"_id":"5716930bec324f0e00b5803f","ref":"","required":false,"desc":"The maximum amount of consecutive workdays that a worker is allowed to work","default":"","type":"int","name":"max_consecutive_workdays","in":"body"},{"_id":"5716930bec324f0e00b5803e","ref":"","required":false,"desc":"Define the minimum amount of time workers will be given between each shift","default":"","type":"int","name":"min_hours_between_shifts","in":"body"},{"_id":"5716930bec324f0e00b5803d","ref":"","required":false,"desc":"Toggle whether workers can use the timeclock from My Schedules","default":"","type":"boolean","name":"enable_timeclocks","in":"body"},{"_id":"5716930bec324f0e00b5803c","ref":"","required":false,"desc":"Toggle whether workers can make time off requests from My Schedules","default":"","type":"boolean","name":"enable_time_off_requests","in":"body"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"name\": \"Agents\"\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\\n\\nOnly Staffjoy support can use the archived parameters\"\n}\n[/block]","category":"56fbf8960023171700b9614c","createdAt":"2016-04-19T18:37:24.285Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"modify-a-role","sync_unique":"","title":"Modify a Role","type":"patch","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

patchModify a Role


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role

Body Params

name:
string
The name of the role
min_hours_per_workday:
integer
The minimum amount of hours each worker of the role can be scheduled for on a given workday
max_hours_per_workday:
integer
The maximum amount of hours each worker of the role can be scheduled for on a given workday
max_consecutive_workdays:
integer
The maximum amount of consecutive workdays that a worker is allowed to work
min_hours_between_shifts:
integer
Define the minimum amount of time workers will be given between each shift
enable_timeclocks:
boolean
Toggle whether workers can use the timeclock from My Schedules
enable_time_off_requests:
boolean
Toggle whether workers can make time off requests from My Schedules

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.

Only Staffjoy support can use the archived parameters


User Information

Try It Out

patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656 -X PATCH -d "name=Agents"

Result Format

{
    "name": "Agents"
}


{"__v":1,"_id":"57167af3810df00e00cc7ac4","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656 -X DELETE"}]},"method":"delete","params":[{"_id":"571697b43d3c000e009f6f2f","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"571697b43d3c000e009f6f2e","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"571697b43d3c000e009f6f2d","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"}],"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"56fbf8960023171700b9614c","createdAt":"2016-04-19T18:37:39.944Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"delete-role","sync_unique":"","title":"Delete Role","type":"delete","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

deleteDelete Role


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656 -X DELETE

Result Format



{"__v":3,"_id":"57169c59e3ed402000b6c336","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/"}]},"method":"get","params":[{"_id":"57170de79610f71900a3cd82","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57170de79610f71900a3cd81","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57170de79610f71900a3cd80","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57170e99d2a6510e00840900","ref":"","required":false,"desc":"Filter results by the archived flag. Use false to return only current workers","default":"","type":"boolean","name":"archived","in":"query"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": [\n        {\n            \"username\": \"lenny\",\n            \"confirmed\": true,\n            \"working_hours\": null,\n            \"name\": \"Leonhard Euler\",\n            \"internal_id\": null,\n            \"member_since\": \"2015-02-14T20:53:31\",\n            \"sudo\": true,\n            \"archived\": false,\n            \"min_hours_per_workweek\": 20,\n            \"email\": \"leonhard@staffjoy.com\",\n            \"max_hours_per_workweek\": 40,\n            \"active\": true,\n            \"id\": 1,\n            \"last_seen\": \"2016-04-20T16:32:17\"\n        },\n        {\n            \"username\": \"rosalind\",\n            \"confirmed\": true,\n            \"working_hours\": null,\n            \"name\": \"Rosalind Franklin\",\n            \"internal_id\": null,\n            \"member_since\": \"2015-02-14T20:53:31\",\n            \"sudo\": true,\n            \"archived\": false,\n            \"min_hours_per_workweek\": 30,\n            \"email\": \"rosalind@staffjoy.com\",\n            \"max_hours_per_workweek\": 40,\n            \"active\": true,\n            \"id\": 2,\n            \"last_seen\": \"2016-04-20T16:34:26.065983\"\n        },\n        {\n            \"username\": \"bahador\",\n            \"confirmed\": true,\n            \"working_hours\": {\n                \"monday\": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\n                \"tuesday\": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\n                \"friday\": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\n                \"wednesday\": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\n                \"thursday\": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\n                \"sunday\": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\n                \"saturday\": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]\n            },\n            \"name\": \"bahador\",\n            \"internal_id\": null,\n            \"member_since\": \"2015-11-11T18:43:07\",\n            \"sudo\": true,\n            \"archived\": false,\n            \"min_hours_per_workweek\": 20,\n            \"email\": \"bahador@staffjoy.com\",\n            \"max_hours_per_workweek\": 40,\n            \"active\": true,\n            \"id\": 458,\n            \"last_seen\": \"2016-04-18T18:11:04\"\n        },\n        {\n            \"username\": \"nikola\",\n            \"confirmed\": true,\n            \"working_hours\": null,\n            \"name\": \"Nikola Tesla\",\n            \"internal_id\": null,\n            \"member_since\": \"2016-02-15T20:15:42\",\n            \"sudo\": true,\n            \"archived\": false,\n            \"min_hours_per_workweek\": 20,\n            \"email\": \"tesla@staffjoy.com\",\n            \"max_hours_per_workweek\": 29,\n            \"active\": true,\n            \"id\": 706,\n            \"last_seen\": \"2016-04-18T06:22:07\"\n        },\n    ]\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/users/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"57169c48e3ed402000b6c333","createdAt":"2016-04-19T21:00:09.107Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-role-workers","sync_unique":"","title":"All Role Workers","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Role Workers


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role

Query Params

archived:
boolean
Filter results by the archived flag. Use false to return only current workers

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/

Result Format

{
    "data": [
        {
            "username": "lenny",
            "confirmed": true,
            "working_hours": null,
            "name": "Leonhard Euler",
            "internal_id": null,
            "member_since": "2015-02-14T20:53:31",
            "sudo": true,
            "archived": false,
            "min_hours_per_workweek": 20,
            "email": "leonhard@staffjoy.com",
            "max_hours_per_workweek": 40,
            "active": true,
            "id": 1,
            "last_seen": "2016-04-20T16:32:17"
        },
        {
            "username": "rosalind",
            "confirmed": true,
            "working_hours": null,
            "name": "Rosalind Franklin",
            "internal_id": null,
            "member_since": "2015-02-14T20:53:31",
            "sudo": true,
            "archived": false,
            "min_hours_per_workweek": 30,
            "email": "rosalind@staffjoy.com",
            "max_hours_per_workweek": 40,
            "active": true,
            "id": 2,
            "last_seen": "2016-04-20T16:34:26.065983"
        },
        {
            "username": "bahador",
            "confirmed": true,
            "working_hours": {
                "monday": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
                "tuesday": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
                "friday": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
                "wednesday": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
                "thursday": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
                "sunday": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
                "saturday": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
            },
            "name": "bahador",
            "internal_id": null,
            "member_since": "2015-11-11T18:43:07",
            "sudo": true,
            "archived": false,
            "min_hours_per_workweek": 20,
            "email": "bahador@staffjoy.com",
            "max_hours_per_workweek": 40,
            "active": true,
            "id": 458,
            "last_seen": "2016-04-18T18:11:04"
        },
        {
            "username": "nikola",
            "confirmed": true,
            "working_hours": null,
            "name": "Nikola Tesla",
            "internal_id": null,
            "member_since": "2016-02-15T20:15:42",
            "sudo": true,
            "archived": false,
            "min_hours_per_workweek": 20,
            "email": "tesla@staffjoy.com",
            "max_hours_per_workweek": 29,
            "active": true,
            "id": 706,
            "last_seen": "2016-04-18T06:22:07"
        },
    ]
}


{"__v":3,"_id":"57169c73bdc0fe2000fc4f53","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/ -X POST -d \"email=dantzig@7bridg.es\" -d \"min_hours_per_workweek=20\" -d \"max_hours_per_workweek=29\"","language":"curl"}]},"method":"post","params":[{"_id":"57170de62be45f0e00caae4d","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57170de62be45f0e00caae4c","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57170de62be45f0e00caae4b","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57171078fdcb310e00f23e36","ref":"","required":false,"desc":"If known, a User ID is the best way to add a worker to a role","default":"","type":"int","name":"id","in":"body"},{"_id":"57171078fdcb310e00f23e35","ref":"","required":false,"desc":"If the User ID is not known, a user can be added as a worker via their email address. Use the email address if the worker does not currently have a Staffjoy account.","default":"","type":"string","name":"email","in":"body"},{"_id":"57171078fdcb310e00f23e34","default":"","desc":"Determines the minimum amount of hours a worker is allowed to work during a workweek","name":"min_hours_per_workweek","ref":"","required":true,"type":"int","in":"body"},{"_id":"57171078fdcb310e00f23e33","default":"","desc":"Determines the maximum amount of hours a worker is allowed to work during a workweek","name":"max_hours_per_workweek","ref":"","required":true,"type":"int","in":"body"},{"_id":"57171078fdcb310e00f23e32","ref":"","required":false,"desc":"If the user is being invited to sign up for Staffjoy, a name can optionally be given to the worker","default":"","type":"string","name":"name","in":"body"},{"_id":"57171078fdcb310e00f23e31","ref":"","required":false,"desc":"An optional ID to help track workers across various systems","default":"","type":"string","name":"internal_id","in":"body"},{"_id":"57171078fdcb310e00f23e30","default":"","desc":"Needs a serialized JSON structure of the same format used for setting demand, but only with binary data. 1 for available, 0 for unavailable.","name":"working_hours","ref":"","required":false,"type":"string","in":"body"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"username\": null,\n    \"confirmed\": false,\n    \"working_hours\": null,\n    \"name\": \"George Dantzig\",\n    \"internal_id\": null,\n    \"member_since\": \"2015-10-22T02:49:48\",\n    \"sudo\": false,\n    \"archived\": false,\n    \"min_hours_per_workweek\": 20,\n    \"email\": \"dantzig@7bridg.es\",\n    \"max_hours_per_workweek\": 29,\n    \"active\": true,\n    \"id\": 95,\n    \"last_seen\": \"2015-10-22T02:49:48\"\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/users/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]\nNote that either a User ID or an email address is required","category":"57169c48e3ed402000b6c333","createdAt":"2016-04-19T21:00:35.069Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"create-a-role-worker","sync_unique":"","title":"Create a Role Worker","type":"post","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

postCreate a Role Worker


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role

Body Params

id:
integer
If known, a User ID is the best way to add a worker to a role
email:
string
If the User ID is not known, a user can be added as a worker via their email address. Use the email address if the worker does not currently have a Staffjoy account.
min_hours_per_workweek:
required
integer
Determines the minimum amount of hours a worker is allowed to work during a workweek
max_hours_per_workweek:
required
integer
Determines the maximum amount of hours a worker is allowed to work during a workweek
name:
string
If the user is being invited to sign up for Staffjoy, a name can optionally be given to the worker
internal_id:
string
An optional ID to help track workers across various systems
working_hours:
string
Needs a serialized JSON structure of the same format used for setting demand, but only with binary data. 1 for available, 0 for unavailable.

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.

Note that either a User ID or an email address is required


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/ -X POST -d "email=dantzig@7bridg.es" -d "min_hours_per_workweek=20" -d "max_hours_per_workweek=29"

Result Format

{
    "username": null,
    "confirmed": false,
    "working_hours": null,
    "name": "George Dantzig",
    "internal_id": null,
    "member_since": "2015-10-22T02:49:48",
    "sudo": false,
    "archived": false,
    "min_hours_per_workweek": 20,
    "email": "dantzig@7bridg.es",
    "max_hours_per_workweek": 29,
    "active": true,
    "id": 95,
    "last_seen": "2015-10-22T02:49:48"
}


{"__v":2,"_id":"57169c85f5b57c20005390bb","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2"}]},"method":"get","params":[{"_id":"57170e5a3cf2960e0009a3f7","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57170e5a3cf2960e0009a3f6","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57170e5a3cf2960e0009a3f5","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57170e5a3cf2960e0009a3f4","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  data: {\n      \"username\": \"rosalind\",\n      \"confirmed\": true,\n      \"working_hours\": null,\n      \"name\": \"Rosalind Franklin\",\n      \"internal_id\": null,\n      \"member_since\": \"2015-02-14T20:53:31\",\n      \"sudo\": true,\n      \"archived\": false,\n      \"min_hours_per_workweek\": 30,\n      \"email\": \"rosalind@staffjoy.com\",\n      \"max_hours_per_workweek\": 40,\n      \"active\": true,\n      \"id\": 2,\n      \"last_seen\": \"2016-04-20T16:34:26.065983\"\n    },\n    \"resources\": [\n      \"timeclocks\",\n      \"timeoffrequests\"\n    ]\n}\n  \n  \n  ,","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/users/:user_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager or Individual\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations. Workers are able to access their own data.\"\n}\n[/block]","category":"57169c48e3ed402000b6c333","createdAt":"2016-04-19T21:00:53.316Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"role-worker","sync_unique":"","title":"Role Worker","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getRole Worker


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
user_id:
required
integer
ID of the user

Permission Required: Location Manager or Individual

Managers are limited to their location. Organization administrators have access in all locations. Workers are able to access their own data.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2

Result Format

{
  data: {
      "username": "rosalind",
      "confirmed": true,
      "working_hours": null,
      "name": "Rosalind Franklin",
      "internal_id": null,
      "member_since": "2015-02-14T20:53:31",
      "sudo": true,
      "archived": false,
      "min_hours_per_workweek": 30,
      "email": "rosalind@staffjoy.com",
      "max_hours_per_workweek": 40,
      "active": true,
      "id": 2,
      "last_seen": "2016-04-20T16:34:26.065983"
    },
    "resources": [
      "timeclocks",
      "timeoffrequests"
    ]
}
  
  
  ,


{"__v":3,"_id":"57169c93e3ed402000b6c338","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2 -X PATCH -d \"min_hours_per_workweek=25\"\n"}]},"method":"patch","params":[{"_id":"57170e5e9610f71900a3cd87","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57170e5e9610f71900a3cd86","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57170e5e9610f71900a3cd85","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57170e5e9610f71900a3cd84","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"571711063cf2960e0009a3fe","ref":"","required":false,"desc":"Determines the minimum amount of hours a worker is allowed to work during a workweek","default":"","type":"int","name":"min_hours_per_workweek","in":"body"},{"_id":"571711063cf2960e0009a3fd","ref":"","required":false,"desc":"Determines the maximum amount of hours a worker is allowed to work during a workweek","default":"","type":"int","name":"max_hours_per_workweek","in":"body"},{"_id":"571711063cf2960e0009a3fc","ref":"","required":false,"desc":"An optional ID to help track workers across various systems","default":"","type":"string","name":"internal_id","in":"body"},{"_id":"571711063cf2960e0009a3fb","ref":"","required":false,"desc":"Needs a binary JSON structure of the same format used for setting demand","default":"","type":"object","name":"working_hours","in":"body"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"min_half_hours_per_workweek\": 50\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/users/:user_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"57169c48e3ed402000b6c333","createdAt":"2016-04-19T21:01:07.317Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"modify-a-role-worker","sync_unique":"","title":"Modify a Role Worker","type":"patch","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

patchModify a Role Worker


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
user_id:
required
integer
ID of the user

Body Params

min_hours_per_workweek:
integer
Determines the minimum amount of hours a worker is allowed to work during a workweek
max_hours_per_workweek:
integer
Determines the maximum amount of hours a worker is allowed to work during a workweek
internal_id:
string
An optional ID to help track workers across various systems
working_hours:
object
Needs a binary JSON structure of the same format used for setting demand

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2 -X PATCH -d "min_hours_per_workweek=25"

Result Format

{
    "min_half_hours_per_workweek": 50
}


{"__v":3,"_id":"57169c9ce3ed402000b6c33a","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2 -X DELETE"}]},"method":"delete","params":[{"_id":"57170e619610f71900a3cd8b","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57170e619610f71900a3cd8a","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57170e619610f71900a3cd89","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57170e619610f71900a3cd88","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"}],"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/users/:user_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"57169c48e3ed402000b6c333","createdAt":"2016-04-19T21:01:16.353Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"delete-a-role-worker","sync_unique":"","title":"Delete a Role Worker","type":"delete","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

deleteDelete a Role Worker


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
user_id:
required
integer
ID of the user

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2 -X DELETE

Result Format



{"__v":2,"_id":"5719204d4604d417003d2427","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"A schedule is used to coordinate actions related to shifts and is essential for creating, assigning, and publishing a schedule.\n\n## Attributes\n\n* id (int) - a unique identifier of the schedule\n* role_id (int) - maps the schedule to its Role\n* state (sting) - see [Schedule State Machine](doc:schedule-state-machine) for more info\n* demand (JSON) - an hour by hour representation of forecasted demand\n* start (Iso8601 datetime) - when the schedule starts\n* stop (Iso8601 datetime) - when the schedule stops\n* min_shift_length_hour (int) - the minimum number of hours calculated shifts are allowed to be\n* max_shift_length_hour (int) - the maximum number of hours calculated shifts are allowed to be\n\n\n## Schedule Start and Stop\n\nAll schedules start at midnight of their location's local timezone on the `organization.day_week_starts` property and are exactly 1 week long. So if `organization.day_week_starts` is \"monday\" and the location's timezone was \"America/Los_Angeles\", then all schedules will have a 'schedule.start` that corresponds to midnight on Monday in Pacific Time.\n\n## The Demand Object\n\nThe `demand` object has an attribute for each day of the week. Each attribute is an array of exactly 24 cells that represent each hour of the day. For example, 9am on Monday corresponds to the 9th index of the \"monday\" array. The API accepts demand as a serialized JSON.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"demand: {\\n    \\\"monday\\\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\\n    \\\"tuesday\\\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\\n    \\\"friday\\\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\\n    \\\"wednesday\\\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\\n    \\\"thursday\\\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\\n    \\\"sunday\\\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\\n    \\\"saturday\\\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","category":"56fbf8a0587e43170081eb55","createdAt":"2016-04-21T18:47:41.980Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"schedule-overview","sync_unique":"","title":"Schedule Overview","type":"basic","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

Schedule Overview


A schedule is used to coordinate actions related to shifts and is essential for creating, assigning, and publishing a schedule.

Attributes

  • id (int) - a unique identifier of the schedule
  • role_id (int) - maps the schedule to its Role
  • state (sting) - see Schedule State Machine for more info
  • demand (JSON) - an hour by hour representation of forecasted demand
  • start (Iso8601 datetime) - when the schedule starts
  • stop (Iso8601 datetime) - when the schedule stops
  • min_shift_length_hour (int) - the minimum number of hours calculated shifts are allowed to be
  • max_shift_length_hour (int) - the maximum number of hours calculated shifts are allowed to be

Schedule Start and Stop

All schedules start at midnight of their location's local timezone on the organization.day_week_starts property and are exactly 1 week long. So if organization.day_week_starts is "monday" and the location's timezone was "America/Los_Angeles", then all schedules will have a 'schedule.start` that corresponds to midnight on Monday in Pacific Time.

The Demand Object

The demand object has an attribute for each day of the week. Each attribute is an array of exactly 24 cells that represent each hour of the day. For example, 9am on Monday corresponds to the 9th index of the "monday" array. The API accepts demand as a serialized JSON.

demand: {
    "monday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],
    "tuesday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],
    "friday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],
    "wednesday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],
    "thursday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],
    "sunday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],
    "saturday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0]
}
{"__v":10,"_id":"56fbf8aa0023171700b9614d","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"Staffjoy uses a state machine to control the automation of shift creation, assignment, and publication. Changing the state of a schedule coordinates actions for all shifts that start during the schedule. Formally, this is defined by `schedule.start <= shift.start < schedule.stop`.\n\nFor reference, \"chomp\" refers to our internal engineering service that computes shifts from demand, and \"mobius\" refers to our internal engineering service that assigns workers to shifts. \n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/TEsuwWbbTw6ALOuI5noj_schedule2%20state%20machine.png\",\n        \"schedule2 state machine.png\",\n        \"850\",\n        \"542\",\n        \"#4cb4ab\",\n        \"\"\n      ],\n      \"caption\": \"Allowed schedule state transitions. \\\"boss\\\" and \\\"flex\\\" refer to the package of the organization.\"\n    }\n  ]\n}\n[/block]\n## initial\n\nSchedules start in the `initial` state. When a user begins planning schedules in the front-end, we transition the state to `unpublished`. When the state transitions from `initial` to `unpublished`, **recurring shifts are created for the given week**. We wait until the last moment possible to do this so that modifications to recurring shifts are accounted for.\n\n**Boss**:\nWhen a schedule in the `initial` state reaches its `schedule.start - organization.shifts_assigned_days_before_start` time, Staffjoy automatically promotes it to `mobius-queue`. \n\n**Flex**:\nSchedules will remain in this state until they are moved.\n\n## unpublished\n\nShifts are constructed while the schedule is in the unpublished state. They can be created via the shifts api or by using Staffjoy's demand-based automated shift calculation.\n\nThere are 3 possible next states:\n\n* `chomp-queue` - Sends the schedule to Staffjoy's demand-based, automatic shift calculation service, Chomp. The schedule must have `demand`, `min_shift_length_hour`, and `max_shift_length_hour` set. When the system claims a job, the schedule state is set to `chomp-processing`. It will be returned to `unpublished` once shifts are calculated.\n* `mobius-queue` (Boss only) - Sends the schedule to Staffjoy's shift assignment system, Mobius.  When the system claims a job, the schedule state is set to `mobius-processing`. The schedule will automatically be set to `published` after the calculation is complete.\n* `published` - Workers are not assigned to shifts, so this step typically happens only for **Flex** organizations when they click \"Publish Now\" in the UI.\n\n**Boss**: If a schedule is not been manually promoted to `mobius-queue`, it will be automatically transitioned once it reaches the time of  `schedule.start - organization.shifts_assigned_days_before_start` time. The schedule is always set to `published` after calculation.\n\n**Flex**: Schedules will remain in this state until they are moved.\n\n## published\n\nWhen a schedule is transitioned to the `published` state, shifts in the role are automatically promoted to `published=true` if  `schedule.start <= shift.start < schedule.stop`. All workers and admins receive an email notifying them that schedules are published. Workers may view and claim shifts in the My Schedules App.","category":"56fbf8a0587e43170081eb55","createdAt":"2016-03-30T16:02:50.386Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"schedule-state-machine","sync_unique":"","title":"Schedule State Machine","type":"basic","updates":[],"user":"561aed1a30e7490d0022d6ae","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

Schedule State Machine


Staffjoy uses a state machine to control the automation of shift creation, assignment, and publication. Changing the state of a schedule coordinates actions for all shifts that start during the schedule. Formally, this is defined by schedule.start <= shift.start < schedule.stop.

For reference, "chomp" refers to our internal engineering service that computes shifts from demand, and "mobius" refers to our internal engineering service that assigns workers to shifts.

Allowed schedule state transitions. "boss" and "flex" refer to the package of the organization.

initial

Schedules start in the initial state. When a user begins planning schedules in the front-end, we transition the state to unpublished. When the state transitions from initial to unpublished, recurring shifts are created for the given week. We wait until the last moment possible to do this so that modifications to recurring shifts are accounted for.

Boss:
When a schedule in the initial state reaches its schedule.start - organization.shifts_assigned_days_before_start time, Staffjoy automatically promotes it to mobius-queue.

Flex:
Schedules will remain in this state until they are moved.

unpublished

Shifts are constructed while the schedule is in the unpublished state. They can be created via the shifts api or by using Staffjoy's demand-based automated shift calculation.

There are 3 possible next states:

  • chomp-queue - Sends the schedule to Staffjoy's demand-based, automatic shift calculation service, Chomp. The schedule must have demand, min_shift_length_hour, and max_shift_length_hour set. When the system claims a job, the schedule state is set to chomp-processing. It will be returned to unpublished once shifts are calculated.
  • mobius-queue (Boss only) - Sends the schedule to Staffjoy's shift assignment system, Mobius. When the system claims a job, the schedule state is set to mobius-processing. The schedule will automatically be set to published after the calculation is complete.
  • published - Workers are not assigned to shifts, so this step typically happens only for Flex organizations when they click "Publish Now" in the UI.

Boss: If a schedule is not been manually promoted to mobius-queue, it will be automatically transitioned once it reaches the time of schedule.start - organization.shifts_assigned_days_before_start time. The schedule is always set to published after calculation.

Flex: Schedules will remain in this state until they are moved.

published

When a schedule is transitioned to the published state, shifts in the role are automatically promoted to published=true if schedule.start <= shift.start < schedule.stop. All workers and admins receive an email notifying them that schedules are published. Workers may view and claim shifts in the My Schedules App.

{"__v":1,"_id":"5717cee92948680e00addc8e","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/"}]},"method":"get","params":[{"_id":"5717cee92948680e00addc91","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5717cee92948680e00addc90","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5717cee92948680e00addc8f","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5717d3a2f2d4380e006f0279","ref":"","required":false,"desc":"Iso8601 datetime to search for schedules that start after this time","default":"","type":"datetime","name":"start","in":"query"},{"_id":"5717d3a2f2d4380e006f0278","ref":"","required":false,"desc":"Iso8601 datetime to search for schedules that start before this time","default":"","type":"datetime","name":"end","in":"query"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": [\n        {\n            \"created_at\": \"2016-03-02T08:31:38\",\n            \"stop\": \"2016-02-15T08:00:00\",\n            \"role_id\": 656,\n            \"min_shift_length_hour\": null,\n            \"start\": \"2016-02-08T08:00:00\",\n            \"state\": \"published\",\n            \"chomp_end\": null,\n            \"demand\": {\n                \"monday\": [0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0],\n                \"tuesday\": [0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0],\n                \"friday\": [0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0],\n                \"wednesday\": [0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0],\n                \"thursday\": [0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0],\n                \"sunday\": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n                \"saturday\": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\n            },\n            \"id\": 1550,\n            \"last_update\": null,\n            \"max_shift_length_hour\": null,\n            \"chomp_start\": null\n        },\n        {\n            \"created_at\": \"2016-03-02T08:31:38\",\n            \"stop\": \"2016-02-22T08:00:00\",\n            \"role_id\": 656,\n            \"min_shift_length_hour\": null,\n            \"start\": \"2016-02-15T08:00:00\",\n            \"state\": \"published\",\n            \"chomp_end\": null,\n            \"demand\": null,\n            \"id\": 1551,\n            \"last_update\": null,\n            \"max_shift_length_hour\": null,\n            \"chomp_start\": null\n        },\n        {\n            \"created_at\": \"2016-03-02T08:32:09\",\n            \"stop\": \"2016-02-29T08:00:00\",\n            \"role_id\": 656,\n            \"min_shift_length_hour\": null,\n            \"start\": \"2016-02-22T08:00:00\",\n            \"state\": \"published\",\n            \"chomp_end\": null,\n            \"demand\": null,\n            \"id\": 1574,\n            \"last_update\": \"2016-03-02T20:50:18\",\n            \"max_shift_length_hour\": null,\n            \"chomp_start\": null\n        },\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/schedules/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Member\",\n  \"body\": \"Managers and workers within the location can access this in addition to organization administrators.\"\n}\n[/block]\nNote that the start and stop times on a schedule are in UTC time and translate to midnight on the start week in the location's local timezone.","category":"56fbf8a0587e43170081eb55","createdAt":"2016-04-20T18:48:09.666Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-schedules","sync_unique":"","title":"All Schedules","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Schedules


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role

Query Params

start:
datetime
Iso8601 datetime to search for schedules that start after this time
end:
datetime
Iso8601 datetime to search for schedules that start before this time

Permission Required: Location Member

Managers and workers within the location can access this in addition to organization administrators.

Note that the start and stop times on a schedule are in UTC time and translate to midnight on the start week in the location's local timezone.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/

Result Format

{
    "data": [
        {
            "created_at": "2016-03-02T08:31:38",
            "stop": "2016-02-15T08:00:00",
            "role_id": 656,
            "min_shift_length_hour": null,
            "start": "2016-02-08T08:00:00",
            "state": "published",
            "chomp_end": null,
            "demand": {
                "monday": [0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0],
                "tuesday": [0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0],
                "friday": [0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0],
                "wednesday": [0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0],
                "thursday": [0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0],
                "sunday": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
                "saturday": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
            },
            "id": 1550,
            "last_update": null,
            "max_shift_length_hour": null,
            "chomp_start": null
        },
        {
            "created_at": "2016-03-02T08:31:38",
            "stop": "2016-02-22T08:00:00",
            "role_id": 656,
            "min_shift_length_hour": null,
            "start": "2016-02-15T08:00:00",
            "state": "published",
            "chomp_end": null,
            "demand": null,
            "id": 1551,
            "last_update": null,
            "max_shift_length_hour": null,
            "chomp_start": null
        },
        {
            "created_at": "2016-03-02T08:32:09",
            "stop": "2016-02-29T08:00:00",
            "role_id": 656,
            "min_shift_length_hour": null,
            "start": "2016-02-22T08:00:00",
            "state": "published",
            "chomp_end": null,
            "demand": null,
            "id": 1574,
            "last_update": "2016-03-02T20:50:18",
            "max_shift_length_hour": null,
            "chomp_start": null
        },
    ]
}


{"__v":0,"_id":"5717d6dcf2d4380e006f0282","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1551"}]},"method":"get","params":[{"_id":"5717d6dcf2d4380e006f0286","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0285","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0284","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0283","ref":"","required":true,"desc":"ID of the schedule","default":"","type":"int","name":"schedule_id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": {\n        \"max_shift_length_hour\": null,\n        \"stop\": \"2016-04-11T07:00:00\",\n        \"demand\": null,\n        \"role_id\": 656,\n        \"id\": 1580,\n        \"created_at\": \"2016-03-02T08:32:09\",\n        \"last_update\": \"2016-03-31T22:17:53\",\n        \"min_shift_length_hour\": null,\n        \"start\": \"2016-04-04T07:00:00\",\n        \"state\": \"published\",\n        \"chomp_end\": null,\n        \"chomp_start\": null\n    },\n    \"resources\": [\n        \"preferences\",\n        \"shifts\",\n        \"timeclocks\",\n        \"timeoffrequests\"\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/schedules/:schedule_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Member\",\n  \"body\": \"Managers and workers within the location can access this in addition to organization administrators.\"\n}\n[/block]","category":"56fbf8a0587e43170081eb55","createdAt":"2016-04-20T19:22:04.737Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"schedule","sync_unique":"","title":"Schedule","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getSchedule


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
schedule_id:
required
integer
ID of the schedule

Permission Required: Location Member

Managers and workers within the location can access this in addition to organization administrators.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1551

Result Format

{
    "data": {
        "max_shift_length_hour": null,
        "stop": "2016-04-11T07:00:00",
        "demand": null,
        "role_id": 656,
        "id": 1580,
        "created_at": "2016-03-02T08:32:09",
        "last_update": "2016-03-31T22:17:53",
        "min_shift_length_hour": null,
        "start": "2016-04-04T07:00:00",
        "state": "published",
        "chomp_end": null,
        "chomp_start": null
    },
    "resources": [
        "preferences",
        "shifts",
        "timeclocks",
        "timeoffrequests"
    ]
}


{"__v":0,"_id":"5717d8b3d555880e00e118f4","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1551 -X PATCH -d 'demand={\"monday\":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\"tuesday\":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\"friday\":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\"wednesday\":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\"thursday\":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\"sunday\":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\"saturday\":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0]}'\n"}]},"method":"patch","params":[{"_id":"5717d8b3d555880e00e118fc","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5717d8b3d555880e00e118fb","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5717d8b3d555880e00e118fa","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5717d8b3d555880e00e118f9","ref":"","required":true,"desc":"ID of the schedule","default":"","type":"int","name":"schedule_id","in":"path"},{"_id":"5717d8b3d555880e00e118f8","default":"","desc":"A JSON string of hourly demand for each day of the week.","name":"demand","ref":"","required":false,"type":"string","in":"body"},{"_id":"5717d8b3d555880e00e118f7","default":"","desc":"The desired state of the schedule.","name":"state","ref":"","required":false,"type":"string","in":"body"},{"_id":"5717d8b3d555880e00e118f6","ref":"","required":false,"desc":"If shifts are being generated, this determines the minimum length (in hours) that a shift can be","default":"","type":"int","name":"min_shift_length_hour","in":"body"},{"_id":"5717d8b3d555880e00e118f5","ref":"","required":false,"desc":"If shifts are being generated, this determines the maximum length (in hours) that a shift can be","default":"","type":"int","name":"max_shift_length_hour","in":"body"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"demand\": {\n    \"monday\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\n    \"tuesday\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\n    \"friday\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\n    \"wednesday\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\n    \"thursday\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\n    \"sunday\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],\n    \"saturday\": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0]\n\t}\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/schedules/:schedule_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]\nThe example on the side shows a Patch request with demand being set via cURL.\n\n### Calculate Shifts\nFrom the `unpublished` state, make a patch request to set the state to ```chomp-queue```. The following parameters must also be set:\n* min_shift_length_hour\n* max_shift_length_hour\n* demand\n\n### Assign Shifts\nFrom the `unpublished` state, make a patch request to set the state to ```mobius-queue```. Any unassigned shifts will be assigned to workers according to their rules.","category":"56fbf8a0587e43170081eb55","createdAt":"2016-04-20T19:29:55.401Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"modify-a-schedule","sync_unique":"","title":"Modify a Schedule","type":"patch","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

patchModify a Schedule


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
schedule_id:
required
integer
ID of the schedule

Body Params

demand:
string
A JSON string of hourly demand for each day of the week.
state:
string
The desired state of the schedule.
min_shift_length_hour:
integer
If shifts are being generated, this determines the minimum length (in hours) that a shift can be
max_shift_length_hour:
integer
If shifts are being generated, this determines the maximum length (in hours) that a shift can be

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.

The example on the side shows a Patch request with demand being set via cURL.

Calculate Shifts

From the unpublished state, make a patch request to set the state to chomp-queue. The following parameters must also be set:

  • min_shift_length_hour
  • max_shift_length_hour
  • demand

Assign Shifts

From the unpublished state, make a patch request to set the state to mobius-queue. Any unassigned shifts will be assigned to workers according to their rules.


User Information

Try It Out

patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1551 -X PATCH -d 'demand={"monday":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],"tuesday":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],"friday":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],"wednesday":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],"thursday":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],"sunday":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],"saturday":[0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0]}'

Result Format

{
  "demand": {
    "monday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],
    "tuesday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],
    "friday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],
    "wednesday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],
    "thursday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],
    "sunday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0],
    "saturday": [0,0,0,0,0,0,0,0,0,3,4,5,5,5,4,3,3,2,0,0,0,0,0,0]
	}
}


{"__v":1,"_id":"571e6f344a14580e00760190","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1551/shifts/"}]},"method":"get","params":[{"_id":"5717d6dcf2d4380e006f0286","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0285","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0284","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0283","ref":"","required":true,"desc":"ID of the schedule","default":"","type":"int","name":"schedule_id","in":"path"},{"_id":"571e7016e2b7000e0091c346","ref":"","required":false,"desc":"Filter results by shifts that are published or unpublished.","default":"","type":"boolean","name":"filter_by_published","in":"query"},{"_id":"571e7016e2b7000e0091c345","ref":"","required":false,"desc":"If true, will include a summary of the number of minutes each User is scheduled to work.","default":"","type":"boolean","name":"include_summary","in":"query"},{"_id":"571e7016e2b7000e0091c344","ref":"","required":false,"desc":"Returns all shifts that a user can claim without violating any of the rules from their worker profile","default":"","type":"int","name":"claimable_by_user","in":"query"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": [\n        {\n            \"user_id\": 1,\n            \"stop\": \"2016-02-16T01:00:00\",\n            \"role_id\": 656,\n            \"start\": \"2016-02-15T17:00:00\",\n            \"published\": true,\n            \"user_name\": \"Nikola Tesla\",\n            \"id\": 5229\n        },\n        {\n            \"user_id\": 458,\n            \"stop\": \"2016-02-16T01:00:00\",\n            \"role_id\": 656,\n            \"start\": \"2016-02-15T17:00:00\",\n            \"published\": true,\n            \"user_name\": \"Leonhard Euler\",\n            \"id\": 5241\n        },\n    ]\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/schedules/:schedule_id/shifts/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Member\",\n  \"body\": \"Managers and workers within the location can access this in addition to organization administrators. When using claimable_by_user, workers can only see shifts in the future.\"\n}\n[/block]","category":"571e6eead8667f0e00a3c2dd","createdAt":"2016-04-25T19:25:40.029Z","editedParams":true,"editedParams2":true,"excerpt":"Returns all shifts that start during a specific schedule. This endpoint is cached and naturally faster than the ordinary shifts endpoint.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"schedule-shifts","sync_unique":"","title":"Schedule Shifts","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getSchedule Shifts

Returns all shifts that start during a specific schedule. This endpoint is cached and naturally faster than the ordinary shifts endpoint.

Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
schedule_id:
required
integer
ID of the schedule

Query Params

filter_by_published:
boolean
Filter results by shifts that are published or unpublished.
include_summary:
boolean
If true, will include a summary of the number of minutes each User is scheduled to work.
claimable_by_user:
integer
Returns all shifts that a user can claim without violating any of the rules from their worker profile

Permission Required: Location Member

Managers and workers within the location can access this in addition to organization administrators. When using claimable_by_user, workers can only see shifts in the future.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1551/shifts/

Result Format

{
    "data": [
        {
            "user_id": 1,
            "stop": "2016-02-16T01:00:00",
            "role_id": 656,
            "start": "2016-02-15T17:00:00",
            "published": true,
            "user_name": "Nikola Tesla",
            "id": 5229
        },
        {
            "user_id": 458,
            "stop": "2016-02-16T01:00:00",
            "role_id": 656,
            "start": "2016-02-15T17:00:00",
            "published": true,
            "user_name": "Leonhard Euler",
            "id": 5241
        },
    ]
}


{"__v":1,"_id":"571e851dd8667f0e00a3c311","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1551/timeclocks/"}]},"method":"get","params":[{"_id":"5717d6dcf2d4380e006f0286","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0285","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0284","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0283","ref":"","required":true,"desc":"ID of the schedule","default":"","type":"int","name":"schedule_id","in":"path"},{"_id":"571e8545cb4baa0e00d13897","ref":"","required":false,"desc":"Filter results by timeclocks related to a specific user","default":"","type":"int","name":"user_id","in":"query"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": [\n        {\n            \"user_id\": 458,\n            \"stop\": \"2016-02-15T21:56:33\",\n            \"role_id\": 656,\n            \"start\": \"2016-02-15T17:56:14\",\n            \"id\": 743\n        },\n        {\n            \"user_id\": 1,\n            \"stop\": \"2016-02-17T02:02:18\",\n            \"role_id\": 656,\n            \"start\": \"2016-02-16T16:02:06\",\n            \"id\": 825\n        },\n        {\n            \"user_id\": 2,\n            \"stop\": \"2016-02-17T04:18:31\",\n            \"role_id\": 656,\n            \"start\": \"2016-02-16T17:16:49\",\n            \"id\": 826\n        },\n    ]\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/schedules/:schedule_id/timeclocks/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"571e6eead8667f0e00a3c2dd","createdAt":"2016-04-25T20:59:09.870Z","editedParams":true,"editedParams2":true,"excerpt":"Returns all timeclocks that were started during the schedule.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"schedule-timeclocks","sync_unique":"","title":"Schedule Timeclocks","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getSchedule Timeclocks

Returns all timeclocks that were started during the schedule.

Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
schedule_id:
required
integer
ID of the schedule

Query Params

user_id:
integer
Filter results by timeclocks related to a specific user

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1551/timeclocks/

Result Format

{
    "data": [
        {
            "user_id": 458,
            "stop": "2016-02-15T21:56:33",
            "role_id": 656,
            "start": "2016-02-15T17:56:14",
            "id": 743
        },
        {
            "user_id": 1,
            "stop": "2016-02-17T02:02:18",
            "role_id": 656,
            "start": "2016-02-16T16:02:06",
            "id": 825
        },
        {
            "user_id": 2,
            "stop": "2016-02-17T04:18:31",
            "role_id": 656,
            "start": "2016-02-16T17:16:49",
            "id": 826
        },
    ]
}


{"__v":0,"_id":"571e85ad4a14580e007601da","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1551/timeoffrequests/","language":"curl"}]},"method":"get","params":[{"_id":"5717d6dcf2d4380e006f0286","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0285","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0284","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0283","ref":"","required":true,"desc":"ID of the schedule","default":"","type":"int","name":"schedule_id","in":"path"},{"_id":"571e8545cb4baa0e00d13897","default":"","desc":"Filter results by time off requests related to a specific user","name":"user_id","ref":"","required":false,"type":"int","in":"query"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": [\n        {\n            \"start\": \"2016-06-15T07:00:00\",\n            \"state\": null,\n            \"user_id\": 2,\n            \"approver_user_id\": 0,\n            \"minutes_paid\": 0,\n            \"stop\": \"2016-06-16T07:00:00\",\n            \"id\": 371,\n            \"role_id\": 656\n        }\n    ]\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/schedules/:schedule_id/timeoffrequests/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"571e6eead8667f0e00a3c2dd","createdAt":"2016-04-25T21:01:33.022Z","editedParams":true,"editedParams2":true,"excerpt":"Returns all time off requests that occur during the schedule.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"schedule-time-off-requests","sync_unique":"","title":"Schedule Time Off Requests","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getSchedule Time Off Requests

Returns all time off requests that occur during the schedule.

Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
schedule_id:
required
integer
ID of the schedule

Query Params

user_id:
integer
Filter results by time off requests related to a specific user

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1551/timeoffrequests/

Result Format

{
    "data": [
        {
            "start": "2016-06-15T07:00:00",
            "state": null,
            "user_id": 2,
            "approver_user_id": 0,
            "minutes_paid": 0,
            "stop": "2016-06-16T07:00:00",
            "id": 371,
            "role_id": 656
        }
    ]
}


{"__v":1,"_id":"571e8c30cb4baa0e00d138ac","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1587/preferences/","language":"curl"}]},"method":"get","params":[{"_id":"5717d6dcf2d4380e006f0286","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0285","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0284","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0283","ref":"","required":true,"desc":"ID of the schedule","default":"","type":"int","name":"schedule_id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": [\n        {\n            \"created_at\": \"2016-04-22T00:30:58\",\n            \"schedule_id\": 1587,\n            \"user_id\": 1,\n            \"preference\": {\n                \"monday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\n                \"tuesday\": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n                \"friday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\n                \"wednesday\": [0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\n                \"thursday\": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n                \"sunday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\n                \"saturday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0]\n            },\n            \"last_update\": \"2016-04-22T00:31:25\"\n        }\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/schedules/:schedule_id/preferences/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"571e8c1eebc88a0e008d4fc4","createdAt":"2016-04-25T21:29:20.946Z","editedParams":true,"editedParams2":true,"excerpt":"Returns all shifts that start during a specific schedule. This endpoint is cached and naturally faster than the ordinary shifts endpoint.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-preferences","sync_unique":"","title":"All Preferences","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Preferences

Returns all shifts that start during a specific schedule. This endpoint is cached and naturally faster than the ordinary shifts endpoint.

Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
schedule_id:
required
integer
ID of the schedule

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1587/preferences/

Result Format

{
    "data": [
        {
            "created_at": "2016-04-22T00:30:58",
            "schedule_id": 1587,
            "user_id": 1,
            "preference": {
                "monday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
                "tuesday": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
                "friday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
                "wednesday": [0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
                "thursday": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
                "sunday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
                "saturday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0]
            },
            "last_update": "2016-04-22T00:31:25"
        }
    ]
}


{"__v":1,"_id":"571e8e07cb4baa0e00d138af","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1587 -X POST -d 'preference={\"monday\":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\"tuesday\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"friday\":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\"wednesday\":[0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\"thursday\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"sunday\":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\"saturday\":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0]}' -d 'user_id=2'","language":"curl"}]},"method":"post","params":[{"_id":"5719252fb69de41700478477","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5719252fb69de41700478476","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5719252fb69de41700478475","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"571e8e64ac2a080e0014c4a1","ref":"","required":true,"desc":"ID of the schedule","default":"","type":"int","name":"schedule_id","in":"body"},{"_id":"571e8e64ac2a080e0014c4a0","ref":"","required":true,"desc":"Needs a serialized JSON structure of the same format used for setting demand, but only with binary data. 1 for preferred, 0 for not preferred.","default":"","type":"string","name":"preference","in":"body"},{"_id":"571e8e64ac2a080e0014c49f","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"body"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"created_at\": \"2016-04-25T21:42:41\",\n    \"schedule_id\": 1589,\n    \"user_id\": 2,\n    \"preference\": {\n        \"monday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\n        \"tuesday\": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n        \"friday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\n        \"wednesday\": [0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\n        \"thursday\": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n        \"sunday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\n        \"saturday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0]\n    },\n    \"last_update\": null\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/shifts/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager or Individual\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations. Workers are able to create their own data.\"\n}\n[/block]","category":"571e8c1eebc88a0e008d4fc4","createdAt":"2016-04-25T21:37:11.537Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"create-a-preference","sync_unique":"","title":"Create Preferences","type":"post","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

postCreate Preferences


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role

Body Params

schedule_id:
required
integer
ID of the schedule
preference:
required
string
Needs a serialized JSON structure of the same format used for setting demand, but only with binary data. 1 for preferred, 0 for not preferred.
user_id:
required
integer
ID of the user

Permission Required: Location Manager or Individual

Managers are limited to their location. Organization administrators have access in all locations. Workers are able to create their own data.


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1587 -X POST -d 'preference={"monday":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"tuesday":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"friday":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"wednesday":[0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"thursday":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"sunday":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"saturday":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0]}' -d 'user_id=2'

Result Format

{
    "created_at": "2016-04-25T21:42:41",
    "schedule_id": 1589,
    "user_id": 2,
    "preference": {
        "monday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
        "tuesday": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
        "friday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
        "wednesday": [0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
        "thursday": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
        "sunday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
        "saturday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0]
    },
    "last_update": null
}


{"__v":1,"_id":"571e8ffdebc88a0e008d4fc8","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1587/preferences/2","language":"curl"}]},"method":"get","params":[{"_id":"5717d6dcf2d4380e006f0286","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0285","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0284","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0283","ref":"","required":true,"desc":"ID of the schedule","default":"","type":"int","name":"schedule_id","in":"path"},{"_id":"571e900dcb4baa0e00d138b2","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": [\n        {\n            \"created_at\": \"2016-04-22T00:30:58\",\n            \"schedule_id\": 1587,\n            \"user_id\": 1,\n            \"preference\": {\n                \"monday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\n                \"tuesday\": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n                \"friday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\n                \"wednesday\": [0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\n                \"thursday\": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n                \"sunday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\n                \"saturday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0]\n            },\n            \"last_update\": \"2016-04-22T00:31:25\"\n        }\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/schedules/:schedule_id/preferences/:user_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager or Individual\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations. Workers are able to access their own data.\"\n}\n[/block]","category":"571e8c1eebc88a0e008d4fc4","createdAt":"2016-04-25T21:45:33.025Z","editedParams":true,"editedParams2":true,"excerpt":"Returns all shifts that start during a specific schedule. This endpoint is cached and naturally faster than the ordinary shifts endpoint.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"preferences","sync_unique":"","title":"Preferences","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getPreferences

Returns all shifts that start during a specific schedule. This endpoint is cached and naturally faster than the ordinary shifts endpoint.

Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
schedule_id:
required
integer
ID of the schedule
user_id:
required
integer
ID of the user

Permission Required: Location Manager or Individual

Managers are limited to their location. Organization administrators have access in all locations. Workers are able to access their own data.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1587/preferences/2

Result Format

{
    "data": [
        {
            "created_at": "2016-04-22T00:30:58",
            "schedule_id": 1587,
            "user_id": 1,
            "preference": {
                "monday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
                "tuesday": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
                "friday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
                "wednesday": [0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
                "thursday": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
                "sunday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
                "saturday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0]
            },
            "last_update": "2016-04-22T00:31:25"
        }
    ]
}


{"__v":1,"_id":"571e90f1cb4baa0e00d138b3","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1587/2 -X PATCH -d 'preference={\"monday\":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\"tuesday\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"friday\":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\"wednesday\":[0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\"thursday\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"sunday\":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\"saturday\":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0]}'","language":"curl"}]},"method":"patch","params":[{"_id":"57192566e967cb1700d078f5","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57192566e967cb1700d078f4","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57192566e967cb1700d078f3","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57192566e967cb1700d078f2","ref":"","required":true,"desc":"ID of the schedule","default":"","type":"int","name":"schedule_id","in":"path"},{"_id":"571e9186ac2a080e0014c4ab","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"571e9186ac2a080e0014c4aa","ref":"","required":false,"desc":"Needs a serialized JSON structure of the same format used for setting demand, but only with binary data. 1 for preferred, 0 for not preferred.","default":"","type":"string","name":"preference","in":"body"}],"results":{"codes":[{"name":"","code":"{\n    \"preference\": {\n        \"monday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\n        \"tuesday\": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n        \"friday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\n        \"wednesday\": [0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\n        \"thursday\": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n        \"sunday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],\n        \"saturday\": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0]\n    },\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/schedules/:schedule_id/preferences/:user_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager or Individual\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations. Workers are able to modify their own data.\"\n}\n[/block]","category":"571e8c1eebc88a0e008d4fc4","createdAt":"2016-04-25T21:49:37.935Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"modify-preferences","sync_unique":"","title":"Modify Preferences","type":"patch","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

patchModify Preferences


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
schedule_id:
required
integer
ID of the schedule
user_id:
required
integer
ID of the user

Body Params

preference:
string
Needs a serialized JSON structure of the same format used for setting demand, but only with binary data. 1 for preferred, 0 for not preferred.

Permission Required: Location Manager or Individual

Managers are limited to their location. Organization administrators have access in all locations. Workers are able to modify their own data.


User Information

Try It Out

patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1587/2 -X PATCH -d 'preference={"monday":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"tuesday":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"friday":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"wednesday":[0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"thursday":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"sunday":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],"saturday":[0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0]}'

Result Format

{
    "preference": {
        "monday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
        "tuesday": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
        "friday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
        "wednesday": [0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
        "thursday": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
        "sunday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
        "saturday": [0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0]
    },
}


{"__v":1,"_id":"571e909f4a14580e007601f1","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1587/preferences/2 -X DELETE"}]},"method":"delete","params":[{"_id":"571925866346850e00833ffd","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"571925866346850e00833ffc","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"571925866346850e00833ffb","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"571925866346850e00833ffa","ref":"","required":true,"desc":"ID of the shift","default":"","type":"int","name":"shift_id","in":"body"},{"_id":"571e90dde2b7000e0091c393","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"}],"results":{"codes":[{"name":"","code":"{}","language":"json","status":204}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/schedules/:schedule_id/preferences/:user_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"571e8c1eebc88a0e008d4fc4","createdAt":"2016-04-25T21:48:15.080Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"delete-preferences","sync_unique":"","title":"Delete Preferences","type":"delete","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

deleteDelete Preferences


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
user_id:
required
integer
ID of the user

Body Params

shift_id:
required
integer
ID of the shift

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/schedules/1587/preferences/2 -X DELETE

Result Format



{"__v":2,"_id":"57192454b69de41700478470","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"A shift represents when someone is scheduled to work.\n\n## Attributes:\n\n* id (int) - A unique identifier\n* role_id (int) - Maps the relationship between a shift and its role\n* user_id (int) - The user who the shift is assigned to\n* start (Iso8601 datetime) - Determines when the shift starts, in UTC\n* stop (Iso8601 datetime) - Determines when the shift ends, in UTC\n* published (boolean) - Determines whether workers can see the shift in My Schedules\n* description (string) - A string that allows additional custom information to be included with the shift\n\n## Notes:\n\n* The start and end times are stored in UTC in the Staffjoy database, and all queries to search the database need datetime values to be in UTC as well.\n* Shifts are allowed to be up to 23 hours long. \n* Unassigned shifts have a user_id of 0.\n* A user is not allowed to be assigned to a shift if it overlaps with another shift he is assigned to\n* Shifts are specific to roles, and only workers in that role can be assigned to them","category":"56fbf89d4c3cea190015da0d","createdAt":"2016-04-21T19:04:52.112Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"shifts-overview","sync_unique":"","title":"Shifts Overview","type":"basic","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

Shifts Overview


A shift represents when someone is scheduled to work.

Attributes:

  • id (int) - A unique identifier
  • role_id (int) - Maps the relationship between a shift and its role
  • user_id (int) - The user who the shift is assigned to
  • start (Iso8601 datetime) - Determines when the shift starts, in UTC
  • stop (Iso8601 datetime) - Determines when the shift ends, in UTC
  • published (boolean) - Determines whether workers can see the shift in My Schedules
  • description (string) - A string that allows additional custom information to be included with the shift

Notes:

  • The start and end times are stored in UTC in the Staffjoy database, and all queries to search the database need datetime values to be in UTC as well.
  • Shifts are allowed to be up to 23 hours long.
  • Unassigned shifts have a user_id of 0.
  • A user is not allowed to be assigned to a shift if it overlaps with another shift he is assigned to
  • Shifts are specific to roles, and only workers in that role can be assigned to them
{"__v":2,"_id":"571924626346850e00833ff3","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/shifts/ -d \"start=2016-04-05T08:00:00\" -d \"end=2016-04-15T08:00:00\"","language":"curl"}]},"method":"get","params":[{"_id":"5719251cac1e2e0e001833bc","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5719251cac1e2e0e001833bb","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5719251cac1e2e0e001833ba","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57193cd8e967cb1700d0797d","ref":"","required":true,"desc":"Search for shifts that start after the given time","default":"","type":"datetime","name":"start","in":"query"},{"_id":"57193cd8e967cb1700d0797c","ref":"","required":true,"desc":"Search for shifts that start before the given time","default":"","type":"datetime","name":"end","in":"query"},{"_id":"57193cd8e967cb1700d0797b","ref":"","required":false,"desc":"Filter results by shifts that are assigned to the given User ID. Use 0 to search for unassigned shifts.","default":"","type":"int","name":"user_id","in":"query"},{"_id":"57193cd8e967cb1700d0797a","ref":"","required":false,"desc":"Filter results by shifts that are published or unpublished.","default":"","type":"boolean","name":"filter_by_published","in":"query"},{"_id":"57193cd8e967cb1700d07979","ref":"","required":false,"desc":"If true, will include a summary of the number of minutes each User is scheduled to work","default":"","type":"boolean","name":"include_summary","in":"query"},{"_id":"57193cd8e967cb1700d07978","ref":"","required":false,"desc":"If true, the response will be a CSV file of the shifts","default":"","type":"boolean","name":"csv_export","in":"query"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": [\n        {\n            \"user_id\": 706,\n            \"stop\": \"2016-04-06T00:00:00\",\n            \"role_id\": 656,\n            \"start\": \"2016-04-05T16:00:00\",\n            \"published\": true,\n            \"user_name\": \"Rosalind Franklin\",\n            \"id\": 41674\n        },\n        {\n            \"user_id\": 2,\n            \"stop\": \"2016-04-11T21:30:00\",\n            \"role_id\": 656,\n            \"start\": \"2016-04-11T15:30:00\",\n            \"published\": false,\n            \"user_name\": \"Nikola Tesla\",\n            \"id\": 42194\n        }\n    ]\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/shifts/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Member\",\n  \"body\": \"Managers and workers within the location can access this in addition to organization administrators.\"\n}\n[/block]","category":"56fbf89d4c3cea190015da0d","createdAt":"2016-04-21T19:05:06.321Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-shifts","sync_unique":"","title":"All Shifts","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Shifts


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role

Query Params

start:
required
datetime
Search for shifts that start after the given time
end:
required
datetime
Search for shifts that start before the given time
user_id:
integer
Filter results by shifts that are assigned to the given User ID. Use 0 to search for unassigned shifts.
filter_by_published:
boolean
Filter results by shifts that are published or unpublished.
include_summary:
boolean
If true, will include a summary of the number of minutes each User is scheduled to work
csv_export:
boolean
If true, the response will be a CSV file of the shifts

Permission Required: Location Member

Managers and workers within the location can access this in addition to organization administrators.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/shifts/ -d "start=2016-04-05T08:00:00" -d "end=2016-04-15T08:00:00"

Result Format

{
    "data": [
        {
            "user_id": 706,
            "stop": "2016-04-06T00:00:00",
            "role_id": 656,
            "start": "2016-04-05T16:00:00",
            "published": true,
            "user_name": "Rosalind Franklin",
            "id": 41674
        },
        {
            "user_id": 2,
            "stop": "2016-04-11T21:30:00",
            "role_id": 656,
            "start": "2016-04-11T15:30:00",
            "published": false,
            "user_name": "Nikola Tesla",
            "id": 42194
        }
    ]
}


{"__v":4,"_id":"57192469e967cb1700d078e5","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/shifts/ -X POST -d \"start=2016-04-21T08:00:00-08:00\" -d \"stop=2016-04-21T12:00:00-08:00\""}]},"method":"post","params":[{"_id":"5719252fb69de41700478477","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5719252fb69de41700478476","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5719252fb69de41700478475","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57192a28ac1e2e0e001833d6","ref":"","required":true,"desc":"When the shift starts, an Iso8601 datetime in UTC time","default":"","type":"datetime","name":"start","in":"body"},{"_id":"57192a28ac1e2e0e001833d5","ref":"","required":true,"desc":"When the shift ends, an Iso8601 datetime in UTC time","default":"","type":"datetime","name":"stop","in":"body"},{"_id":"57192a28ac1e2e0e001833d4","ref":"","required":false,"desc":"Assigns the shift to a specific user, if set to 0 or left blank, will be left unassigned","default":"","type":"int","name":"user_id","in":"body"},{"_id":"57192a28ac1e2e0e001833d3","ref":"","required":false,"desc":"Determines whether workers can see the shift in My Schedules. Defaults to false","default":"","type":"boolean","name":"published","in":"body"},{"_id":"575f11f141c8ba0e00259c1c","ref":"","required":false,"desc":"A custom description of the shift","default":"","type":"string","name":"description","in":"body"}],"results":{"codes":[{"name":"","code":"{\n    \"user_id\": 0,\n    \"stop\": \"2016-04-21T04:00:00\",\n    \"role_id\": 656,\n    \"start\": \"2016-04-21T00:00:00\",\n    \"published\": false,\n    \"user_name\": null,\n    \"id\": 42193\n}","language":"json","status":201}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/shifts/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Be Careful About Timezones\",\n  \"body\": \"Start and stop times are stored in Staffjoy databases in UTC time. When creating a shift, it is best to be specific.\\n\\nIn the example on the side, the `start` gives a time of `08:00:00-08:00`, which would be 8 AM with a local timezone offset of 8 hours. The response shows that in UTC this same time is `00:00:00+00:00`. If the `start` param only sent `08:00:00`, this would be interpreted as UTC, and then the shift would actually start at `16:00:00` in the local timezone!\\n\\nTo avoid problems, follow these tips:\\n* Use a library for timezone conversions such as [pytz](http://pytz.sourceforge.net/). The adjustment needed to convert between a local time and UTC changes depending on Daylight Savings Time.\\n* Never use naive datetimes. It's best to convert everything to UTC before sending to Staffjoy, but it is ok to send the timezone offset too.\"\n}\n[/block]","category":"56fbf89d4c3cea190015da0d","createdAt":"2016-04-21T19:05:13.402Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"create-a-shift","sync_unique":"","title":"Create a Shift","type":"post","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

postCreate a Shift


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role

Body Params

start:
required
datetime
When the shift starts, an Iso8601 datetime in UTC time
stop:
required
datetime
When the shift ends, an Iso8601 datetime in UTC time
user_id:
integer
Assigns the shift to a specific user, if set to 0 or left blank, will be left unassigned
published:
boolean
Determines whether workers can see the shift in My Schedules. Defaults to false
description:
string
A custom description of the shift

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.

Be Careful About Timezones

Start and stop times are stored in Staffjoy databases in UTC time. When creating a shift, it is best to be specific.

In the example on the side, the start gives a time of 08:00:00-08:00, which would be 8 AM with a local timezone offset of 8 hours. The response shows that in UTC this same time is 00:00:00+00:00. If the start param only sent 08:00:00, this would be interpreted as UTC, and then the shift would actually start at 16:00:00 in the local timezone!

To avoid problems, follow these tips:

  • Use a library for timezone conversions such as pytz. The adjustment needed to convert between a local time and UTC changes depending on Daylight Savings Time.
  • Never use naive datetimes. It's best to convert everything to UTC before sending to Staffjoy, but it is ok to send the timezone offset too.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/shifts/ -X POST -d "start=2016-04-21T08:00:00-08:00" -d "stop=2016-04-21T12:00:00-08:00"

Result Format

{
    "user_id": 0,
    "stop": "2016-04-21T04:00:00",
    "role_id": 656,
    "start": "2016-04-21T00:00:00",
    "published": false,
    "user_name": null,
    "id": 42193
}


{"__v":0,"_id":"5748dc805a77a71700965627","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/shifts/830"}]},"method":"get","params":[{"_id":"5719254c6346850e00833ff9","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5719254c6346850e00833ff8","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5719254c6346850e00833ff7","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5719254c6346850e00833ff6","ref":"","required":true,"desc":"ID of the recurring shift","default":"","type":"int","name":"shift_id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": {\n        \"user_id\": 706,\n        \"stop\": \"2016-04-06T00:00:00\",\n        \"role_id\": 656,\n        \"start\": \"2016-04-05T16:00:00\",\n        \"published\": true,\n        \"user_name\": \"Rosalind Franklin\",\n        \"id\": 41674\n    },\n    \"resources\": [\n        \"users\"\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/shifts/:shift_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Member\",\n  \"body\": \"Managers and workers within the location can access this in addition to organization administrators.\"\n}\n[/block]","category":"56fbf89d4c3cea190015da0d","createdAt":"2016-05-27T23:47:12.038Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"shift-1","sync_unique":"","title":"Shift","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getShift


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
shift_id:
required
integer
ID of the recurring shift

Permission Required: Location Member

Managers and workers within the location can access this in addition to organization administrators.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/shifts/830

Result Format

{
    "data": {
        "user_id": 706,
        "stop": "2016-04-06T00:00:00",
        "role_id": 656,
        "start": "2016-04-05T16:00:00",
        "published": true,
        "user_name": "Rosalind Franklin",
        "id": 41674
    },
    "resources": [
        "users"
    ]
}


{"__v":3,"_id":"57192484ac1e2e0e001833b5","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/shifts/5241 -X PATCH -d \"user_id=2\""}]},"method":"patch","params":[{"_id":"57192566e967cb1700d078f5","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57192566e967cb1700d078f4","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57192566e967cb1700d078f3","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57192566e967cb1700d078f2","ref":"","required":true,"desc":"ID of the shift","default":"","type":"int","name":"shift_id","in":"path"},{"_id":"571928e2e967cb1700d07909","ref":"","required":false,"desc":"When the shift starts, an Iso8601 datetime in UTC time","default":"","type":"datetime","name":"start","in":"body"},{"_id":"571928e2e967cb1700d07908","ref":"","required":false,"desc":"When the shift ends, an Iso8601 datetime in UTC time","default":"","type":"datetime","name":"stop","in":"body"},{"_id":"571928e2e967cb1700d07907","ref":"","required":false,"desc":"Assigns the shift to a specific worker","default":"","type":"int","name":"user_id","in":"body"},{"_id":"571928e2e967cb1700d07906","ref":"","required":false,"desc":"Determines whether workers can view the shift in My Schedules","default":"","type":"boolean","name":"published","in":"body"},{"_id":"575f121f41c8ba0e00259c1d","ref":"","required":false,"desc":"A custom string that contains additional information about the shift","default":"","type":"string","name":"description","in":"body"}],"results":{"codes":[{"name":"","code":"{\n    \"user_id\": 2\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/shifts/:shift_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Member\",\n  \"body\": \"Workers are only allowed to claim unassigned shifts for themselves\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Location managers are able to adjust any property within their location. Organization administrators have access in all locations.\"\n}\n[/block]\n### Claiming a Shift\nMake a patch request to the shift with the only parameter being `user_id` with a value of the User's ID.","category":"56fbf89d4c3cea190015da0d","createdAt":"2016-04-21T19:05:40.934Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"modify-a-shift","sync_unique":"","title":"Modify a Shift","type":"patch","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

patchModify a Shift


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
shift_id:
required
integer
ID of the shift

Body Params

start:
datetime
When the shift starts, an Iso8601 datetime in UTC time
stop:
datetime
When the shift ends, an Iso8601 datetime in UTC time
user_id:
integer
Assigns the shift to a specific worker
published:
boolean
Determines whether workers can view the shift in My Schedules
description:
string
A custom string that contains additional information about the shift

Permission Required: Location Member

Workers are only allowed to claim unassigned shifts for themselves

Permission Required: Location Manager

Location managers are able to adjust any property within their location. Organization administrators have access in all locations.

Claiming a Shift

Make a patch request to the shift with the only parameter being user_id with a value of the User's ID.


User Information

Try It Out

patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/shifts/5241 -X PATCH -d "user_id=2"

Result Format

{
    "user_id": 2
}


{"__v":1,"_id":"57192490e967cb1700d078e7","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/shifts/5241 -X DELETE"}]},"method":"delete","params":[{"_id":"571925866346850e00833ffd","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"571925866346850e00833ffc","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"571925866346850e00833ffb","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"571925866346850e00833ffa","ref":"","required":true,"desc":"ID of the shift","default":"","type":"int","name":"shift_id","in":"path"}],"results":{"codes":[{"name":"","code":"{}","language":"json","status":204}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/shifts/:shift_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"56fbf89d4c3cea190015da0d","createdAt":"2016-04-21T19:05:52.615Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":5,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"delete-a-shift","sync_unique":"","title":"Delete a Shift","type":"delete","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

deleteDelete a Shift


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
shift_id:
required
integer
ID of the shift

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/shifts/5241 -X DELETE

Result Format



{"__v":1,"_id":"571e8764ac2a080e0014c490","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/180/locations/250/roles/477/shifts/42490/users/"}]},"method":"get","params":[{"_id":"5717d6dcf2d4380e006f0286","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0285","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0284","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5717d6dcf2d4380e006f0283","ref":"","required":true,"desc":"ID of the shift","default":"","type":"int","name":"shift_id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": [\n        {\n            \"username\": null,\n            \"confirmed\": false,\n            \"name\": \"Rosalind Franklin\",\n            \"active\": true,\n            \"member_since\": \"2015-10-22T02:49:48\",\n            \"last_seen\": \"2015-10-22T02:49:48\",\n            \"sudo\": false,\n            \"email\": \"rosalind@7bridg.es\",\n            \"id\": 91,\n            \"within_caps\": true\n        },\n        {\n            \"username\": null,\n            \"confirmed\": false,\n            \"name\": \"Max Planck\",\n            \"active\": true,\n            \"member_since\": \"2015-10-22T02:49:48\",\n            \"last_seen\": \"2015-10-22T02:49:48\",\n            \"sudo\": false,\n            \"email\": \"planck@7bridg.es\",\n            \"id\": 93,\n            \"within_caps\": true\n        },\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/shifts/:shift_id/users/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Admin\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]\n## Notes:\n* The response returns all workers who do not have a shift that overlaps with this shift in question.\n* The `within_caps` field indicates whether this person can be assigned to the shift without violating the scheduling rules from their worker profile.","category":"571e8755ebc88a0e008d4fc0","createdAt":"2016-04-25T21:08:52.200Z","editedParams":true,"editedParams2":true,"excerpt":"Returns all users that are able to be assigned to a specific shift.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"shift-eligible-users","sync_unique":"","title":"Shift Eligible Users","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getShift Eligible Users

Returns all users that are able to be assigned to a specific shift.

Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
shift_id:
required
integer
ID of the shift

Permission Required: Location Admin

Managers are limited to their location. Organization administrators have access in all locations.

Notes:

  • The response returns all workers who do not have a shift that overlaps with this shift in question.
  • The within_caps field indicates whether this person can be assigned to the shift without violating the scheduling rules from their worker profile.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/180/locations/250/roles/477/shifts/42490/users/

Result Format

{
    "data": [
        {
            "username": null,
            "confirmed": false,
            "name": "Rosalind Franklin",
            "active": true,
            "member_since": "2015-10-22T02:49:48",
            "last_seen": "2015-10-22T02:49:48",
            "sudo": false,
            "email": "rosalind@7bridg.es",
            "id": 91,
            "within_caps": true
        },
        {
            "username": null,
            "confirmed": false,
            "name": "Max Planck",
            "active": true,
            "member_since": "2015-10-22T02:49:48",
            "last_seen": "2015-10-22T02:49:48",
            "sudo": false,
            "email": "planck@7bridg.es",
            "id": 93,
            "within_caps": true
        },
    ]
}


{"__v":0,"_id":"5748d4eb919ad20e00b6c82d","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/recurringshifts/","language":"curl"}]},"method":"get","params":[{"_id":"5719251cac1e2e0e001833bc","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5719251cac1e2e0e001833bb","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5719251cac1e2e0e001833ba","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57193cd8e967cb1700d07978","default":"","desc":"Filter results by shifts that are assigned to the given User ID. Use 0 to search for unassigned recurring shifts.","name":"user_id","ref":"","required":false,"type":"int","in":"query"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": [\n        {\n            \"start_day\": \"monday\",\n            \"start_minute\": 0,\n            \"user_id\": 1,\n            \"duration_minutes\": 480,\n            \"quantity\": 1,\n            \"start_hour\": 9,\n            \"id\": 3,\n            \"role_id\": 656\n        },\n        {\n            \"start_day\": \"tuesday\",\n            \"start_minute\": 0,\n            \"user_id\": 1,\n            \"duration_minutes\": 480,\n            \"quantity\": 1,\n            \"start_hour\": 9,\n            \"id\": 4,\n            \"role_id\": 656\n        },\n    ]\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/recurringshifts/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Member\",\n  \"body\": \"Managers and workers within the location can access this in addition to organization administrators.\"\n}\n[/block]","category":"5748d4835a77a71700965624","createdAt":"2016-05-27T23:14:51.433Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-recurring-shifts","sync_unique":"","title":"All Recurring Shifts","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Recurring Shifts


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role

Query Params

user_id:
integer
Filter results by shifts that are assigned to the given User ID. Use 0 to search for unassigned recurring shifts.

Permission Required: Location Member

Managers and workers within the location can access this in addition to organization administrators.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/recurringshifts/

Result Format

{
    "data": [
        {
            "start_day": "monday",
            "start_minute": 0,
            "user_id": 1,
            "duration_minutes": 480,
            "quantity": 1,
            "start_hour": 9,
            "id": 3,
            "role_id": 656
        },
        {
            "start_day": "tuesday",
            "start_minute": 0,
            "user_id": 1,
            "duration_minutes": 480,
            "quantity": 1,
            "start_hour": 9,
            "id": 4,
            "role_id": 656
        },
    ]
}


{"__v":0,"_id":"5748d94cdb72e72d00b2c6de","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/recurringshifts/ -X POST -d \"start_day=monday\" -d \"start_hour=8\" -d \"start_minute=0\" -d \"duration_minutes=300\" -d \"quantity=2\""}]},"method":"post","params":[{"_id":"5719252fb69de41700478477","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5719252fb69de41700478476","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5719252fb69de41700478475","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57192a28ac1e2e0e001833d6","ref":"","required":true,"desc":"The day of the week when the shift starts, e.g. \"monday\"","default":"","type":"string","name":"start_day","in":"body"},{"_id":"57192a28ac1e2e0e001833d5","ref":"","required":true,"desc":"The hour of the day when the shift will start, 0-23","default":"","type":"int","name":"start_hour","in":"body"},{"_id":"57192a28ac1e2e0e001833d4","default":"","desc":"The minute of the day when the shift will start, 0-59","name":"start_minute","ref":"","required":true,"type":"int","in":"body"},{"_id":"57192a28ac1e2e0e001833d3","ref":"","required":true,"desc":"The length of the shift, in minutes","default":"","type":"int","name":"duration_minutes","in":"body"},{"_id":"5748d94cdb72e72d00b2c6e0","ref":"","required":false,"desc":"Recurring shifts can optionally be given to specific workers","default":"","type":"int","name":"user_id","in":"body"},{"_id":"5748d94cdb72e72d00b2c6df","ref":"","required":false,"desc":"If no user_id is defined, a quantity can be given to create multiple shifts","default":"","type":"int","name":"quantity","in":"body"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"start_day\": \"monday\",\n    \"start_minute\": 0,\n    \"user_id\": 0,\n    \"duration_minutes\": 300,\n    \"quantity\": 2,\n    \"start_hour\": 8,\n    \"id\": 830,\n    \"role_id\": 656\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/recurringshifts/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Times are all in local time\",\n  \"body\": \"start_day, start_hour, start_minute will create a shift corresponding to that time in the location's timezone\"\n}\n[/block]","category":"5748d4835a77a71700965624","createdAt":"2016-05-27T23:33:32.158Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"create-a-recurring","sync_unique":"","title":"Create a Recurring Shift","type":"post","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

postCreate a Recurring Shift


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role

Body Params

start_day:
required
string
The day of the week when the shift starts, e.g. "monday"
start_hour:
required
integer
The hour of the day when the shift will start, 0-23
start_minute:
required
integer
The minute of the day when the shift will start, 0-59
duration_minutes:
required
integer
The length of the shift, in minutes
user_id:
integer
Recurring shifts can optionally be given to specific workers
quantity:
integer
If no user_id is defined, a quantity can be given to create multiple shifts

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.

Times are all in local time

start_day, start_hour, start_minute will create a shift corresponding to that time in the location's timezone


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/recurringshifts/ -X POST -d "start_day=monday" -d "start_hour=8" -d "start_minute=0" -d "duration_minutes=300" -d "quantity=2"

Result Format

{
    "start_day": "monday",
    "start_minute": 0,
    "user_id": 0,
    "duration_minutes": 300,
    "quantity": 2,
    "start_hour": 8,
    "id": 830,
    "role_id": 656
}


{"__v":1,"_id":"571924784604d417003d2438","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/recurringshifts/830"}]},"method":"get","params":[{"_id":"5719254c6346850e00833ff9","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5719254c6346850e00833ff8","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5719254c6346850e00833ff7","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5719254c6346850e00833ff6","default":"","desc":"ID of the recurring shift","name":"recurring_shift_id","ref":"","required":true,"type":"int","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": {\n        \"start_day\": \"monday\",\n        \"start_minute\": 0,\n        \"user_id\": 0,\n        \"duration_minutes\": 300,\n        \"quantity\": 2,\n        \"start_hour\": 8,\n        \"id\": 830,\n        \"role_id\": 656\n    },\n    \"resources\": []\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/recurringshifts/:recurring_shift_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Member\",\n  \"body\": \"Managers and workers within the location can access this in addition to organization administrators.\"\n}\n[/block]","category":"5748d4835a77a71700965624","createdAt":"2016-04-21T19:05:28.963Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"shift","sync_unique":"","title":"Recurring Shift","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getRecurring Shift


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
recurring_shift_id:
required
integer
ID of the recurring shift

Permission Required: Location Member

Managers and workers within the location can access this in addition to organization administrators.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/recurringshifts/830

Result Format

{
    "data": {
        "start_day": "monday",
        "start_minute": 0,
        "user_id": 0,
        "duration_minutes": 300,
        "quantity": 2,
        "start_hour": 8,
        "id": 830,
        "role_id": 656
    },
    "resources": []
}


{"__v":0,"_id":"5748d9d4919ad20e00b6c831","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/recurringshifts/830 -X PATCH -d \"quantity=4\""}]},"method":"patch","params":[{"_id":"5719252fb69de41700478477","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5719252fb69de41700478476","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5719252fb69de41700478475","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5748d9d4919ad20e00b6c832","ref":"","required":true,"desc":"ID of the recurring shift","default":"","type":"int","name":"recurring_shift_id","in":"path"},{"_id":"57192a28ac1e2e0e001833d6","default":"","desc":"The day of the week when the shift starts, e.g. \"monday\"","name":"start_day","ref":"","required":false,"type":"string","in":"body"},{"_id":"57192a28ac1e2e0e001833d5","default":"","desc":"The hour of the day when the shift will start, 0-23","name":"start_hour","ref":"","required":false,"type":"int","in":"body"},{"_id":"57192a28ac1e2e0e001833d4","default":"","desc":"The minute of the day when the shift will start, 0-59","name":"start_minute","ref":"","required":false,"type":"int","in":"body"},{"_id":"57192a28ac1e2e0e001833d3","default":"","desc":"The length of the shift, in minutes","name":"duration_minutes","ref":"","required":false,"type":"int","in":"body"},{"_id":"5748d94cdb72e72d00b2c6e0","ref":"","required":false,"desc":"Recurring shifts can optionally be given to specific workers","default":"","type":"int","name":"user_id","in":"body"},{"_id":"5748d94cdb72e72d00b2c6df","ref":"","required":false,"desc":"If no user_id is defined, a quantity can be given to create multiple shifts","default":"","type":"int","name":"quantity","in":"body"}],"results":{"codes":[{"name":"","code":"{\n    \"quantity\": 4\n}","language":"json","status":201}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/recurringshifts/:recurring_shift_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Times are all in local time\",\n  \"body\": \"start_day, start_hour, start_minute will create a shift corresponding to that time in the location's timezone\"\n}\n[/block]","category":"5748d4835a77a71700965624","createdAt":"2016-05-27T23:35:48.341Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"modify-a-recurring-shift","sync_unique":"","title":"Modify a Recurring Shift","type":"patch","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

patchModify a Recurring Shift


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
recurring_shift_id:
required
integer
ID of the recurring shift

Body Params

start_day:
string
The day of the week when the shift starts, e.g. "monday"
start_hour:
integer
The hour of the day when the shift will start, 0-23
start_minute:
integer
The minute of the day when the shift will start, 0-59
duration_minutes:
integer
The length of the shift, in minutes
user_id:
integer
Recurring shifts can optionally be given to specific workers
quantity:
integer
If no user_id is defined, a quantity can be given to create multiple shifts

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.

Times are all in local time

start_day, start_hour, start_minute will create a shift corresponding to that time in the location's timezone


User Information

Try It Out

patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/recurringshifts/830 -X PATCH -d "quantity=4"

Result Format

{
    "quantity": 4
}


{"__v":0,"_id":"5748d9f9b3ae442b003af2f7","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/recurringshifts/830 -X DELETE"}]},"method":"delete","params":[{"_id":"5719252fb69de41700478477","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"5719252fb69de41700478476","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"5719252fb69de41700478475","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"5748d9d4919ad20e00b6c832","ref":"","required":true,"desc":"ID of the recurring shift","default":"","type":"int","name":"recurring_shift_id","in":"path"}],"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/recurringshifts/:recurring_shift_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Times are all in local time\",\n  \"body\": \"start_day, start_hour, start_minute will create a shift corresponding to that time in the location's timezone\"\n}\n[/block]","category":"5748d4835a77a71700965624","createdAt":"2016-05-27T23:36:25.802Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"delete-a-recurring-shift","sync_unique":"","title":"Delete a Recurring Shift","type":"delete","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

deleteDelete a Recurring Shift


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
recurring_shift_id:
required
integer
ID of the recurring shift

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.

Times are all in local time

start_day, start_hour, start_minute will create a shift corresponding to that time in the location's timezone


User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/recurringshifts/830 -X DELETE

Result Format



{"__v":3,"_id":"571942e66346850e0083409d","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"A timeclock represents a span of time when a worker was on the job.\n\n## Attributes:\n\n* id (int) - A unique identifier\n* role_id (int) - The ID of the role the user works in\n* user_id (int) - The ID of the user who recorded the timeclock\n* start (Iso8601 datetime) - Determines when the timeclock began, in UTC\n* stop (Iso8601 datetime) - Determines when the timeclock ended, in UTC\n\n## Notes:\n\n* A user can only have one timeclock record at a time.\n* If stop is null, then the worker is still clocked in.\n* The start and end times are stored in UTC in the Staffjoy database, and all queries to search the database need datetime values to be in UTC as well.\n* Timeclocks are allowed to be up to 23 hours long, workers will automatically be clocked out if they forget to clock out.\n* Timeclocks are specific to a role. If a worker is moved to a different role, new timeclocks would be created on a route with the new role_id.","category":"571942d3ac1e2e0e0018346f","createdAt":"2016-04-21T21:15:18.901Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"timeclocks-overview","sync_unique":"","title":"Timeclocks Overview","type":"basic","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

Timeclocks Overview


A timeclock represents a span of time when a worker was on the job.

Attributes:

  • id (int) - A unique identifier
  • role_id (int) - The ID of the role the user works in
  • user_id (int) - The ID of the user who recorded the timeclock
  • start (Iso8601 datetime) - Determines when the timeclock began, in UTC
  • stop (Iso8601 datetime) - Determines when the timeclock ended, in UTC

Notes:

  • A user can only have one timeclock record at a time.
  • If stop is null, then the worker is still clocked in.
  • The start and end times are stored in UTC in the Staffjoy database, and all queries to search the database need datetime values to be in UTC as well.
  • Timeclocks are allowed to be up to 23 hours long, workers will automatically be clocked out if they forget to clock out.
  • Timeclocks are specific to a role. If a worker is moved to a different role, new timeclocks would be created on a route with the new role_id.
{"__v":2,"_id":"571942f7ac1e2e0e00183471","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeclocks/"}]},"method":"get","params":[{"_id":"571945126346850e008340aa","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"571945126346850e008340a9","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"571945126346850e008340a8","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"571945126346850e008340a7","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"57194648b69de4170047851a","ref":"","required":false,"desc":"If true, will only search for active timeclocks by the user","default":"","type":"boolean","name":"active","in":"query"},{"_id":"57194648b69de41700478519","ref":"","required":false,"desc":"Searches for timeclocks that start after this time (Iso8601 datetime)","default":"","type":"datetime","name":"start","in":"query"},{"_id":"57194648b69de41700478518","ref":"","required":false,"desc":"Searches for timeclocks that start before this time (Iso8601 datetime)","default":"","type":"datetime","name":"end","in":"query"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": [\n        {\n            \"user_id\": 2,\n            \"stop\": \"2016-04-21T21:39:17\",\n            \"role_id\": 656,\n            \"start\": \"2016-04-21T16:01:19\",\n            \"id\": 9360\n        },\n        {\n            \"user_id\": 2,\n            \"stop\": \"2016-04-20T14:01:00\",\n            \"role_id\": 656,\n            \"start\": \"2016-04-19T15:01:00\",\n            \"id\": 9388\n        }\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/users/:user_id/timeclocks/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager or Individual\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations. Workers are able to access their own data.\"\n}\n[/block]\nIf no values are given for `start` and `end`, the query will default to the past week. The best practice is to always query for a specific span of time.","category":"571942d3ac1e2e0e0018346f","createdAt":"2016-04-21T21:15:35.036Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-timeclocks","sync_unique":"","title":"All Timeclocks","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Timeclocks


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
user_id:
required
integer
ID of the user

Query Params

active:
boolean
If true, will only search for active timeclocks by the user
start:
datetime
Searches for timeclocks that start after this time (Iso8601 datetime)
end:
datetime
Searches for timeclocks that start before this time (Iso8601 datetime)

Permission Required: Location Manager or Individual

Managers are limited to their location. Organization administrators have access in all locations. Workers are able to access their own data.

If no values are given for start and end, the query will default to the past week. The best practice is to always query for a specific span of time.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeclocks/

Result Format

{
    "data": [
        {
            "user_id": 2,
            "stop": "2016-04-21T21:39:17",
            "role_id": 656,
            "start": "2016-04-21T16:01:19",
            "id": 9360
        },
        {
            "user_id": 2,
            "stop": "2016-04-20T14:01:00",
            "role_id": 656,
            "start": "2016-04-19T15:01:00",
            "id": 9388
        }
    ]
}


{"__v":3,"_id":"57194302ac1e2e0e00183474","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeclocks/ -X POST"}]},"method":"post","params":[{"_id":"571944b84604d417003d24dc","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"571944eee967cb1700d079bc","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"571944eee967cb1700d079bb","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"571944eee967cb1700d079ba","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"57194680c863120e00129fab","ref":"","required":false,"desc":"Iso8601 datetime of when the timeclock began","default":"","type":"datetime","name":"start","in":"body"},{"_id":"57194680c863120e00129faa","default":"","desc":"Iso8601 datetime of when the timeclock ended","name":"stop","ref":"","required":false,"type":"datetime","in":"body"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"user_id\": 2,\n    \"stop\": null,\n    \"role_id\": 656,\n    \"start\": \"2016-04-21T21:53:38\",\n    \"id\": 9390\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/users/:user_id/timeclocks/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Individual\",\n  \"body\": \"Individuals are able to clock themselves in at the current time\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers have full control but are limited to their location. Organization administrators have control in all locations.\"\n}\n[/block]\n## Clocking In\nTo clock in, simply create a POST request without any parameters. That will create a record at the current time.","category":"571942d3ac1e2e0e0018346f","createdAt":"2016-04-21T21:15:46.866Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"create-a-timeclock","sync_unique":"","title":"Create a Timeclock","type":"post","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

postCreate a Timeclock


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
user_id:
required
integer
ID of the user

Body Params

start:
datetime
Iso8601 datetime of when the timeclock began
stop:
datetime
Iso8601 datetime of when the timeclock ended

Permission Required: Individual

Individuals are able to clock themselves in at the current time

Permission Required: Location Manager

Managers have full control but are limited to their location. Organization administrators have control in all locations.

Clocking In

To clock in, simply create a POST request without any parameters. That will create a record at the current time.


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeclocks/ -X POST

Result Format

{
    "user_id": 2,
    "stop": null,
    "role_id": 656,
    "start": "2016-04-21T21:53:38",
    "id": 9390
}


{"__v":2,"_id":"571943106346850e008340a0","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeclocks/9360"}]},"method":"get","params":[{"_id":"57194451ac1e2e0e0018348d","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57194451ac1e2e0e0018348c","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57194451ac1e2e0e0018348b","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57194451ac1e2e0e0018348a","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"571944646346850e008340a4","ref":"","required":true,"desc":"ID of the timeclock","default":"","type":"int","name":"timeclock_id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": {\n        \"user_id\": 2,\n        \"stop\": \"2016-04-21T21:39:17\",\n        \"role_id\": 656,\n        \"start\": \"2016-04-21T16:01:19\",\n        \"id\": 9360\n    },\n    \"resources\": []\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/users/:user_id/timeclocks/:timeclock_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager or Individual\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations. Workers are able to access their own data.\"\n}\n[/block]","category":"571942d3ac1e2e0e0018346f","createdAt":"2016-04-21T21:16:00.870Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"timeclock","sync_unique":"","title":"Timeclock","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getTimeclock


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
user_id:
required
integer
ID of the user
timeclock_id:
required
integer
ID of the timeclock

Permission Required: Location Manager or Individual

Managers are limited to their location. Organization administrators have access in all locations. Workers are able to access their own data.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeclocks/9360

Result Format

{
    "data": {
        "user_id": 2,
        "stop": "2016-04-21T21:39:17",
        "role_id": 656,
        "start": "2016-04-21T16:01:19",
        "id": 9360
    },
    "resources": []
}


{"__v":3,"_id":"5719431aac1e2e0e00183478","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeclocks/9390 -X PATCH -d \"close=true\"\n"}]},"method":"patch","params":[{"_id":"57194401e967cb1700d079b2","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57194401e967cb1700d079b1","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57194401e967cb1700d079b0","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57194401e967cb1700d079af","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"5719441bac1e2e0e00183488","ref":"","required":true,"desc":"ID of the timeclock","default":"","type":"int","name":"timeclock_id","in":"path"},{"_id":"571946f4c863120e00129faf","ref":"","required":false,"desc":"Adjusts the start time to the given time. Iso8601 datetime","default":"","type":"datetime","name":"start","in":"body"},{"_id":"571946f4c863120e00129fae","ref":"","required":false,"desc":"Adjusts the stop time to the given time. Iso8601 datetime","default":"","type":"datetime","name":"stop","in":"body"},{"_id":"571946f4c863120e00129fad","ref":"","required":false,"desc":"When true, it will close a timeclock at the current time","default":"","type":"boolean","name":"close","in":"body"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"stop\": \"2016-04-21T22:41:09.289093+00:00\"\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/users/:user_id/timeclocks/:timeclock_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Individual\",\n  \"body\": \"Individuals are allowed to clock out of an open timeclock at the current time via the close=true parameter.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are able to modify any timeclock within their location. Organization administrators have access in all locations.\"\n}\n[/block]\n## Clocking Out\nTo clock out of a shift, make a PATCH request with the parameter `close=true`. It will set stop to the current time.","category":"571942d3ac1e2e0e0018346f","createdAt":"2016-04-21T21:16:10.875Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"modify-a-timeclock","sync_unique":"","title":"Modify a Timeclock","type":"patch","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

patchModify a Timeclock


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
user_id:
required
integer
ID of the user
timeclock_id:
required
integer
ID of the timeclock

Body Params

start:
datetime
Adjusts the start time to the given time. Iso8601 datetime
stop:
datetime
Adjusts the stop time to the given time. Iso8601 datetime
close:
boolean
When true, it will close a timeclock at the current time

Permission Required: Individual

Individuals are allowed to clock out of an open timeclock at the current time via the close=true parameter.

Permission Required: Location Manager

Managers are able to modify any timeclock within their location. Organization administrators have access in all locations.

Clocking Out

To clock out of a shift, make a PATCH request with the parameter close=true. It will set stop to the current time.


User Information

Try It Out

patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeclocks/9390 -X PATCH -d "close=true"

Result Format

{
    "stop": "2016-04-21T22:41:09.289093+00:00"
}


{"__v":2,"_id":"57194327b69de41700478503","api":{"auth":"required","examples":{"codes":[{"language":"text","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeclocks/9390 -X DELETE"}]},"method":"delete","params":[{"_id":"571943a84604d417003d24d6","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"571943a84604d417003d24d5","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"571943cdac1e2e0e00183483","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"571943cdac1e2e0e00183482","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"571943cdac1e2e0e00183481","ref":"","required":true,"desc":"ID of the timeclock","default":"","type":"int","name":"timeclock_id","in":"path"}],"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/users/:user_id/timeclocks/:timeclock_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are able to delete any timeclock within their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"571942d3ac1e2e0e0018346f","createdAt":"2016-04-21T21:16:23.346Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":5,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"delete-a-timeclock","sync_unique":"","title":"Delete a Timeclock","type":"delete","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

deleteDelete a Timeclock


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
user_id:
required
integer
ID of the user
timeclock_id:
required
integer
ID of the timeclock

Permission Required: Location Manager

Managers are able to delete any timeclock within their location. Organization administrators have access in all locations.


User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeclocks/9390 -X DELETE

Result Format



{"__v":4,"_id":"57195aca4604d417003d2528","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"A time off request \n\n## Attributes:\n\n* id (int) - A unique identifier\n* role_id (int) - the ID of the role that the user belongs to\n* user_id (int) - the ID of the user\n* role_to_user_id (int) - Maps the relationship between a user and a role - don't worry about this\n* start (Iso8601 datetime) - Determines when the time off request starts, in UTC\n* stop (Iso8601 datetime) - Determines when the time off request ends, in UTC\n* state (string) - The current state of the time off request. See below for details on each state.\n* minutes_paid (int) - The amount minutes that will be paid for this time off request.\n\n## States:\n* null - When a worker has requested time off, it starts in the null state. Time off requests in the null state require action from a manager.\n* approved_paid - Time off has been approved and a worker will be paid an amount designated by the minutes_paid field, which must be greater than 0.\n* approved_unpaid - Time off has been approved, but a worker will not be paid for it. minutes_paid must be 0.\n* sick - This is a special type of time off that is independent of minutes_paid because rules will differ between different organizations.\n\n## Notes:\n\n* All time off requests span for exactly one calendar day and start at midnight in the location's timezone.\n* A user can only have one time off request record for a calendar day\n* The start and end times are stored in UTC in the Staffjoy database, and all queries to search the database need datetime values to be in UTC as well.\n* `minutes_paid` must be greater than 0 if the `state` is `approved_paid`; it must be 0 if the `state` is `approved_unpaid`","category":"5719456eb69de41700478511","createdAt":"2016-04-21T22:57:14.982Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"time-off-requests-overview","sync_unique":"","title":"Time Off Requests Overview","type":"basic","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

Time Off Requests Overview


A time off request

Attributes:

  • id (int) - A unique identifier
  • role_id (int) - the ID of the role that the user belongs to
  • user_id (int) - the ID of the user
  • role_to_user_id (int) - Maps the relationship between a user and a role - don't worry about this
  • start (Iso8601 datetime) - Determines when the time off request starts, in UTC
  • stop (Iso8601 datetime) - Determines when the time off request ends, in UTC
  • state (string) - The current state of the time off request. See below for details on each state.
  • minutes_paid (int) - The amount minutes that will be paid for this time off request.

States:

  • null - When a worker has requested time off, it starts in the null state. Time off requests in the null state require action from a manager.
  • approved_paid - Time off has been approved and a worker will be paid an amount designated by the minutes_paid field, which must be greater than 0.
  • approved_unpaid - Time off has been approved, but a worker will not be paid for it. minutes_paid must be 0.
  • sick - This is a special type of time off that is independent of minutes_paid because rules will differ between different organizations.

Notes:

  • All time off requests span for exactly one calendar day and start at midnight in the location's timezone.
  • A user can only have one time off request record for a calendar day
  • The start and end times are stored in UTC in the Staffjoy database, and all queries to search the database need datetime values to be in UTC as well.
  • minutes_paid must be greater than 0 if the state is approved_paid; it must be 0 if the state is approved_unpaid
{"__v":1,"_id":"57195ab9b69de41700478576","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeoffrequests/ -d \"start=2016-03-01\""}]},"method":"get","params":[{"_id":"571945126346850e008340aa","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"571945126346850e008340a9","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"571945126346850e008340a8","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"571945126346850e008340a7","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"57194648b69de41700478519","ref":"","required":false,"desc":"Searches for time off requests that start after this time (Iso8601 datetime)","default":"","type":"datetime","name":"start","in":"query"},{"_id":"57194648b69de41700478518","ref":"","required":false,"desc":"Searches for time off requests that start before this time (Iso8601 datetime)","default":"","type":"datetime","name":"end","in":"query"},{"_id":"57194648b69de4170047851a","ref":"","required":false,"desc":"Filter results by a specific state","default":"","type":"string","name":"state","in":"query"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"data\": [\n        {\n            \"user_id\": 2,\n            \"stop\": \"2016-04-21T21:39:17\",\n            \"role_id\": 656,\n            \"organization_id\": 1,\n            \"start\": \"2016-04-21T16:01:19\",\n            \"location_id\": 6,\n            \"id\": 9360\n        },\n        {\n            \"user_id\": 2,\n            \"stop\": \"2016-04-20T14:01:00\",\n            \"role_id\": 656,\n            \"organization_id\": 1,\n            \"start\": \"2016-04-19T15:01:00\",\n            \"location_id\": 6,\n            \"id\": 9388\n        }\n    ]\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/users/:user_id/timeoffrequests/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager or Individual\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations. Workers are able to access their own data.\"\n}\n[/block]\nIf no values are given for `start` and `end`, the query will default to the past week. The best practice is to always query for a specific span of time.","category":"5719456eb69de41700478511","createdAt":"2016-04-21T22:56:57.334Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"all-time-off-requests","sync_unique":"","title":"All Time Off Requests","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getAll Time Off Requests


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
user_id:
required
integer
ID of the user

Query Params

start:
datetime
Searches for time off requests that start after this time (Iso8601 datetime)
end:
datetime
Searches for time off requests that start before this time (Iso8601 datetime)
state:
string
Filter results by a specific state

Permission Required: Location Manager or Individual

Managers are limited to their location. Organization administrators have access in all locations. Workers are able to access their own data.

If no values are given for start and end, the query will default to the past week. The best practice is to always query for a specific span of time.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeoffrequests/ -d "start=2016-03-01"

Result Format

{
    "data": [
        {
            "user_id": 2,
            "stop": "2016-04-21T21:39:17",
            "role_id": 656,
            "organization_id": 1,
            "start": "2016-04-21T16:01:19",
            "location_id": 6,
            "id": 9360
        },
        {
            "user_id": 2,
            "stop": "2016-04-20T14:01:00",
            "role_id": 656,
            "organization_id": 1,
            "start": "2016-04-19T15:01:00",
            "location_id": 6,
            "id": 9388
        }
    ]
}


{"__v":1,"_id":"57195ad74604d417003d252a","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeoffrequests/ -X POST -d \"date=2016-05-11\"","language":"curl"}]},"method":"post","params":[{"_id":"571944b84604d417003d24dc","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"571944eee967cb1700d079bc","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"571944eee967cb1700d079bb","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"571944eee967cb1700d079ba","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"57194680c863120e00129fab","default":"","desc":"Iso8601 datetime of the calendar date when time is being requested off","name":"date","ref":"","required":true,"type":"datetime","in":"body"},{"_id":"57194680c863120e00129faa","default":"","desc":"The number of minutes being paid with this request","name":"minutes_paid","ref":"","required":false,"type":"int","in":"body"},{"_id":"57197bcbc863120e0012a0a3","default":"","desc":"The type of time off being requested","name":"state","ref":"","required":false,"type":"string","in":"body"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n  \"start\": \"2016-05-11T07:00:00\",\n  \"state\": null,\n  \"user_id\": 2,\n  \"approver_user_id\": 0,\n  \"minutes_paid\": 0,\n  \"stop\": \"2016-05-12T07:00:00\",\n  \"id\": 14,\n  \"role_id\": 41\n}","name":""}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/users/:user_id/timeoffrequests/"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Individual\",\n  \"body\": \"Individuals are able to request time off for themselves but state and minutes_paid must be undefined\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations.\"\n}\n[/block]","category":"5719456eb69de41700478511","createdAt":"2016-04-21T22:57:27.836Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"create-a-time-off-request","sync_unique":"","title":"Create a Time Off Request","type":"post","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

postCreate a Time Off Request


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
user_id:
required
integer
ID of the user

Body Params

date:
required
datetime
Iso8601 datetime of the calendar date when time is being requested off
minutes_paid:
integer
The number of minutes being paid with this request
state:
string
The type of time off being requested

Permission Required: Individual

Individuals are able to request time off for themselves but state and minutes_paid must be undefined

Permission Required: Location Manager

Managers are limited to their location. Organization administrators have access in all locations.


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeoffrequests/ -X POST -d "date=2016-05-11"

Result Format

{
  "start": "2016-05-11T07:00:00",
  "state": null,
  "user_id": 2,
  "approver_user_id": 0,
  "minutes_paid": 0,
  "stop": "2016-05-12T07:00:00",
  "id": 14,
  "role_id": 41
}


{"__v":0,"_id":"57195ae5b69de4170047857a","api":{"auth":"required","examples":{"codes":[{"code":"curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeoffrequests/369","language":"curl"}]},"method":"get","params":[{"_id":"57194451ac1e2e0e0018348d","ref":"","required":true,"desc":"ID of the organization","default":"","type":"int","name":"organization_id","in":"path"},{"_id":"57194451ac1e2e0e0018348c","ref":"","required":true,"desc":"ID of the location","default":"","type":"int","name":"location_id","in":"path"},{"_id":"57194451ac1e2e0e0018348b","ref":"","required":true,"desc":"ID of the role","default":"","type":"int","name":"role_id","in":"path"},{"_id":"57194451ac1e2e0e0018348a","ref":"","required":true,"desc":"ID of the user","default":"","type":"int","name":"user_id","in":"path"},{"_id":"571944646346850e008340a4","default":"","desc":"ID of the time off request","name":"time_off_request_id","ref":"","required":true,"type":"int","in":"path"}],"results":{"codes":[{"name":"","code":"{\n    \"data\": {\n        \"start\": \"2016-05-11T07:00:00\",\n        \"state\": \"approved_paid\",\n        \"user_id\": 2,\n        \"approver_user_id\": 2,\n        \"minutes_paid\": 480,\n        \"stop\": \"2016-05-12T07:00:00\",\n        \"id\": 369,\n        \"role_id\": 656\n    },\n    \"resources\": []\n}","language":"json","status":200}]},"settings":"","url":"/organizations/:organization_id/locations/:location_id/roles/:role_id/users/:user_id/timeoffrequests/:time_off_request_id"},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Permission Required: Location Manager or Individual\",\n  \"body\": \"Managers are limited to their location. Organization administrators have access in all locations. Workers are able to access their own data.\"\n}\n[/block]","category":"5719456eb69de41700478511","createdAt":"2016-04-21T22:57:41.452Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"56f9fe2cf9102d0e00ca623e","slug":"time-off-request","sync_unique":"","title":"Time Off Request","type":"get","updates":[],"user":"561da5369ace800d00289ea3","version":"56fa046648e69f0e00a7742f","childrenPages":[]}

getTime Off Request


Path Params

organization_id:
required
integer
ID of the organization
location_id:
required
integer
ID of the location
role_id:
required
integer
ID of the role
user_id:
required
integer
ID of the user
time_off_request_id:
required
integer
ID of the time off request

Permission Required: Location Manager or Individual

Managers are limited to their location. Organization administrators have access in all locations. Workers are able to access their own data.


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples

curl -u [[app:api-token]]: https://suite.staffjoy.com/api/v2/organizations/1/locations/6/roles/656/users/2/timeoffrequests/369

Result Format

{
    "data": {
        "start": "2016-05-11T07:00:00",
        "state": "approved_paid",
        "user_id": 2,
        "approver_user_id": 2,
        "minutes_paid": 480,
        "stop": "2016-05-12T07:00:00",
        "id": 369,