Work sessions
Stop work sessions
Close open sessions by deliverable, by person, or by both.
Send at least one of deliverableIds or workerIds. A request with neither is rejected: there is deliberately no way to stop every open session in one call.
When a person has several open sessions, the elapsed time is split evenly across them, and any session you did not explicitly stop is restarted from that point.
POST
/
deliverable
/
work-sessions
/
stop
Stop work sessions
curl --request POST \
--url https://{instance}/api/v2/deliverable/work-sessions/stop \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"deliverableIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"workerIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"sessionIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"endDate": "2023-11-07T05:31:56Z"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
deliverableIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
workerIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
sessionIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
endDate: '2023-11-07T05:31:56Z'
})
};
fetch('https://{instance}/api/v2/deliverable/work-sessions/stop', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{instance}/api/v2/deliverable/work-sessions/stop"
payload = {
"deliverableIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"workerIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"sessionIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"endDate": "2023-11-07T05:31:56Z"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}Authorizations
Body
application/json
At least one of deliverableIds or workerIds is required.
Response
Stopped. The response has no body.
⌘I
Stop work sessions
curl --request POST \
--url https://{instance}/api/v2/deliverable/work-sessions/stop \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"deliverableIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"workerIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"sessionIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"endDate": "2023-11-07T05:31:56Z"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
deliverableIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
workerIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
sessionIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
endDate: '2023-11-07T05:31:56Z'
})
};
fetch('https://{instance}/api/v2/deliverable/work-sessions/stop', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{instance}/api/v2/deliverable/work-sessions/stop"
payload = {
"deliverableIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"workerIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"sessionIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"endDate": "2023-11-07T05:31:56Z"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}