API reference
Media
8 endpoints. Click one to see its parameters, fields and an example. Code samples use the region you pick.
GET/v1/mediaPhotos (and recordings) on a project, client, site, time entry or invoice, newest first. Links expire after 10 minutes.
Photos (and recordings) on a project, client, site, time entry or invoice, newest first. Links expire after 10 minutes.
Query parameters
| Name | Type | Description |
|---|---|---|
attached_type | "project" | "customer" | "location" | "time_entry" | "invoice" | |
attached_id | string | |
kind | "photo" | "audio" | |
mine | "0" | "1" | "true" | "false" | |
limit | integer | |
before | string (date-time) |
Example
curl "https://ca-api.clocklap.com/v1/media" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
POST/v1/mediaUpload a photo or voice recording (raw file body; Content-Type image/* or audio/*). Idempotent on id.
Upload a photo or voice recording (raw file body; Content-Type image/* or audio/*). Idempotent on id.
Query parameters
| Name | Type | Description |
|---|---|---|
id | string | |
kind | "photo" | "audio" | |
attach | string | Comma list of type:id, e.g. project:prj_123,invoice:inv_456 |
caption | string | |
taken_at | string (date-time) | |
duration_s | number | |
visibility | "private" | "project" |
Example
curl -X POST "https://ca-api.clocklap.com/v1/media" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
GET/v1/media/{id}Get one media
Get one media
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Example
curl "https://ca-api.clocklap.com/v1/media/{id}" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
PATCH/v1/media/{id}Change the caption, or share it / keep it private
Change the caption, or share it / keep it private
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Body (JSON)
| Name | Type | Description |
|---|---|---|
caption | string or null | |
visibility | "private" | "project" |
Example
curl -X PATCH "https://ca-api.clocklap.com/v1/media/{id}" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"caption":"string","visibility":"private"}'Responses
200
DELETE/v1/media/{id}Remove a photo or recording (the file is deleted shortly after)
Remove a photo or recording (the file is deleted shortly after)
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Example
curl -X DELETE "https://ca-api.clocklap.com/v1/media/{id}" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
POST/v1/media/{id}/linksAlso attach it to other things
Also attach it to other things
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Body (JSON)
| Name | Type | Description |
|---|---|---|
attach_torequired | array of object | |
attach_to[].typerequired | "project" | "customer" | "location" | "time_entry" | "invoice" | |
attach_to[].idrequired | string |
Example
curl -X POST "https://ca-api.clocklap.com/v1/media/{id}/links" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"attach_to":[{"type":"project","id":"id_01J…"}]}'Responses
200
DELETE/v1/media/{id}/links/{type}/{target_id}Take it off something (the photo stays in the workspace)
Take it off something (the photo stays in the workspace)
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | |
typerequired | "project" | "customer" | "location" | "time_entry" | "invoice" | |
target_idrequired | string |
Example
curl -X DELETE "https://ca-api.clocklap.com/v1/media/{id}/links/{type}/{target_id}" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
GET/v1/media/configWhether voice notes can be transcribed in this workspace, and upload limits
Whether voice notes can be transcribed in this workspace, and upload limits
Example
curl "https://ca-api.clocklap.com/v1/media/config" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200