Tickets API · Ticket tasks
Record time spent
POST /api/v1/accounts/{account_id}/tickets/{number}/time
422 while the account doesn't record time (Settings → Tickets).
Authorization api_access_tokenheader required
A person's access token (Texa Desk, Profile settings → Access token ) or an agent bot's token, in the api_access_token header. It acts as that person, with their role's permissions.
Path parameters account_idinteger required
numberinteger required
The ticket's number, as in its reference AUD-1001
Body application/json Responses 200 {payload: {minutes, entries}}
curl -X POST 'https://desk.texadesk.com/api/v1/accounts/1/tickets/1001/time' \
-H "api_access_token: $TEXA_DESK_TOKEN " \
-H "Content-Type: application/json" \
-d '{
"minutes": 1
}'
import os , requests
headers = { "api_access_token" : os . environ [ "TEXA_DESK_TOKEN" ]}
body = {
"minutes" : 1
}
r = requests . post ( "https://desk.texadesk.com/api/v1/accounts/1/tickets/1001/time" , headers = headers , json = body )
r . raise_for_status ()
print ( r . json ())
const r = await fetch ( "https://desk.texadesk.com/api/v1/accounts/1/tickets/1001/time" , {
method : "POST" ,
headers : { "api_access_token" : ` ${ process . env . TEXA_DESK_TOKEN } ` , "Content-Type" : "application/json" },
body : JSON . stringify ({
"minutes" : 1
}),
});
if ( ! r . ok ) throw new Error ( ` ${ r . status } : ${ await r . text () } ` );
console . log ( await r . json ());