Create a barrier type
Adds a reason that can be attached to sales opportunities. Do not retry blindly — check the Reporting API's barrier list.
Use it to:
- Seed the CRM barrier list of a new account
Behaviour:
- Not idempotent.
- Not safe to retry blindly. A 500 may follow a committed insert. Retrying with the SAME Id fails on the unique GUID (no duplicate); with a new Id it creates a duplicate.
- Duplicates: Names are not deduplicated; the caller-supplied Id is unique.
- Changes are visible to the next read immediately.
Next: PUT /v1/barrier
curl -X POST "https://app3.timelog.com/your-account/api/v1/barrier" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"Id": "123e4567-e89b-12d3-a456-426614174000",
"Name": "John Doe"
}'
import requests
import json
url = "https://app3.timelog.com/your-account/api/v1/barrier"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"Id": "123e4567-e89b-12d3-a456-426614174000",
"Name": "John Doe"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app3.timelog.com/your-account/api/v1/barrier", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"Id": "123e4567-e89b-12d3-a456-426614174000",
"Name": "John Doe"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"Id": "123e4567-e89b-12d3-a456-426614174000",
"Name": "John Doe"
}`)
req, err := http.NewRequest("POST", "https://app3.timelog.com/your-account/api/v1/barrier", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://app3.timelog.com/your-account/api/v1/barrier')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"Id": "123e4567-e89b-12d3-a456-426614174000",
"Name": "John Doe"
}'
response = http.request(request)
puts response.body
{
"Properties": {
"BarrierID": 123,
"Id": "123e4567-e89b-12d3-a456-426614174000",
"Name": "John Doe"
},
"Links": [
{
"Href": "example_string",
"Rel": "example_string"
}
],
"Actions": [
{}
]
}
{
"Code": 200,
"Details": [
"'Name' must not be empty."
],
"Message": "Invalid model state error.",
"Parameters": "barrier: {"Id":"00000000-0000-0000-0000-000000000000","Name":null}",
"Url": "https://app{server-number}.timelog.com/{account}/api/v1/barrier"
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Internal Server Error",
"message": "An unexpected error occurred on the server",
"code": 500,
"requestId": "req_1234567890"
}
/v1/barrier
Target server for requests. Edit to use your own host.
OAuth 2.0 bearer token, sent as Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp).
The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user.
> Not yet documented: how to obtain a token.
> Not yet documented: token lifetime.
Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp).
The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user.
> Not yet documented: how to obtain a token.
> Not yet documented: token lifetime.The media type of the request body
GUID for the new barrier, generated by the caller. It becomes the barrier's Id (used by update and delete). Can be set on create only. Alternate key, unique per TimeLog site. Default: 00000000-0000-0000-0000-000000000000 - Omitted — The all-zero GUID is stored as the barrier's Id. - A GUID already used by another barrier (including a second all-zero one) — Unique constraint violation → 500 Code 100.
Display name of the barrier. Can be set on create only. - Missing, null or empty — 400 Code 200 "'Name' must not be empty." (captured). > Not yet documented: behaviour.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. OAuth 2.0 bearer token, sent as Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp).
The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user.
Not yet documented: how to obtain a token.
Not yet documented: token lifetime.
Body
GUID for the new barrier, generated by the caller. It becomes the barrier's Id (used by update and delete).
Can be set on create only.
Alternate key, unique per TimeLog site.
Default: 00000000-0000-0000-0000-000000000000
-
Omitted — The all-zero GUID is stored as the barrier's Id.
-
A GUID already used by another barrier (including a second all-zero one) — Unique constraint violation → 500 Code 100.
Display name of the barrier.
Can be set on create only.
- Missing, null or empty — 400 Code 200 "'Name' must not be empty." (captured).
Not yet documented: behaviour.
Responses
A CRM barrier type: an entry of the account-wide list of reasons that hold back a sales opportunity (system administration page "Barrier management in TimeLog CRM"). Opportunities reference barriers by BarrierID. A barrier is NOT a time-registration or period lock: it is stored only on opportunities and used as a filter of the Reporting API's opportunity export. It blocks nothing. The active flag that exists in storage is not part of this model.