CreateTask
Project management service 1.8: Creates a task as the last root task of a project, on the main contract or a contract you name, and returns it.
| Service | Project management 1.8 |
| Endpoint | POST https://app{server-number}.timelog.com/{account}/WebServices/ProjectManagement/V1_8/ProjectManagementServiceSecure.svc |
| SOAPAction | CreateTaskRequest |
| Content-Type | text/xml; charset=utf-8 |
| Authentication | A token from GetToken |
| Changes data | Yes |
| Safe to retry | Depends on the call |
How it works
Loads the project by integer ID, builds a new task with the project's default task status, billable flag and invoicing type, appends it as the next root WBS number, maps the members of the Task you send, puts it on ProjectSubContractID, applies HourlyRateID and saves the project. Use CreateSubTask to create a task under another task.
Parameters
Each parameter has one label: Required, Conditional (required depending on other values) or Optional. Send them in the order shown.
The Task to send. Its fields are listed below.
Integer ID of the project the task is added to.
The token from GetToken: Initials, Expires and Hash, sent back unchanged.
Request
POST /{account}/WebServices/ProjectManagement/V1_8/ProjectManagementServiceSecure.svc HTTP/1.1
Host: app{server-number}.timelog.com
Content-Type: text/xml; charset=utf-8
SOAPAction: "CreateTaskRequest"
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pm="http://www.timelog.com/api/tlp/v1_8"
xmlns:tok="http://www.timelog.com/api/tlp/v1_3"
xmlns:tlp="http://www.timelog.com/api/tlp/v1_7">
<soapenv:Body>
<pm:CreateTask>
<pm:task>
<tlp:Name>{Name}</tlp:Name>
<tlp:StartDate>{StartDate}</tlp:StartDate>
<tlp:EndDate>{EndDate}</tlp:EndDate>
<tlp:TaskTypeID>{TaskTypeID}</tlp:TaskTypeID>
<!-- more fields: see Parameters -->
</pm:task>
<pm:projectID>{projectID}</pm:projectID>
<pm:token>
<tok:Initials>{Initials from GetToken}</tok:Initials>
<tok:Expires>{Expires from GetToken, unchanged}</tok:Expires>
<tok:Hash>{Hash from GetToken}</tok:Hash>
</pm:token>
</pm:CreateTask>
</soapenv:Body>
</soapenv:Envelope>
curl -X POST "https://app{server-number}.timelog.com/{account}/WebServices/ProjectManagement/V1_8/ProjectManagementServiceSecure.svc" \
-H "Content-Type: text/xml; charset=utf-8" \
-H 'SOAPAction: "CreateTaskRequest"' \
--data-binary @request.xml
import requests
URL = "https://app{server-number}.timelog.com/{account}/WebServices/ProjectManagement/V1_8/ProjectManagementServiceSecure.svc"
SOAP_ACTION = '"CreateTaskRequest"'
envelope = """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pm="http://www.timelog.com/api/tlp/v1_8"
xmlns:tok="http://www.timelog.com/api/tlp/v1_3"
xmlns:tlp="http://www.timelog.com/api/tlp/v1_7">
<soapenv:Body>
<pm:CreateTask>
<pm:task>
<tlp:Name>{Name}</tlp:Name>
<tlp:StartDate>{StartDate}</tlp:StartDate>
<tlp:EndDate>{EndDate}</tlp:EndDate>
<tlp:TaskTypeID>{TaskTypeID}</tlp:TaskTypeID>
<!-- more fields: see Parameters -->
</pm:task>
<pm:projectID>{projectID}</pm:projectID>
<pm:token>
<tok:Initials>{Initials from GetToken}</tok:Initials>
<tok:Expires>{Expires from GetToken, unchanged}</tok:Expires>
<tok:Hash>{Hash from GetToken}</tok:Hash>
</pm:token>
</pm:CreateTask>
</soapenv:Body>
</soapenv:Envelope>"""
response = requests.post(
URL,
data=envelope.encode("utf-8"),
headers={"Content-Type": "text/xml; charset=utf-8", "SOAPAction": SOAP_ACTION},
timeout=60,
)
result = parse_result(response) # see "Responses and errors"
{…} placeholder with your own value.Response
The call returns the standard response envelope. Check ResponseState first: a failed call still returns HTTP 200.
Success, Invalid or Error.
0 on success, otherwise the error code. See Errors.
On any failure Return is EMPTY and the envelope is Error - there is no per-item failure container.
Example response
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<CreateTaskResponse xmlns="http://www.timelog.com/api/tlp/v1_8">
<CreateTaskResult xmlns:a="http://www.timelog.com/api/tlp/v1_2"
xmlns:b="http://api.timelog.com"
xmlns:c="http://www.timelog.com/api/tlp/v1_7"
xmlns:d="http://api.timelog.com/services/crm/1_2"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Return>
<a:BatchContainerOfTask>
<a:Item>
<b:Action>Original</b:Action>
<b:IsCustomFieldsLoaded>false</b:IsCustomFieldsLoaded>
<b:CustomFields i:nil="true"/>
<b:IsExternalKeysLoaded>false</b:IsExternalKeysLoaded>
<b:ExternalKeys i:nil="true"/>
<c:ID>3f2504e0-4f89-41d3-9a0c-305000000001</c:ID>
<c:TaskID>1001</c:TaskID>
<c:Name>Example </c:Name>
<c:FullName>Example full</c:FullName>
<c:No>1001</c:No>
<c:Description>Example</c:Description>
<c:Link>Example</c:Link>
<c:BudgetHours>0</c:BudgetHours>
<c:BudgetAmount>0</c:BudgetAmount>
<c:StartDate>2026-10-01T00:00:00</c:StartDate>
<c:EndDate>2026-10-01T00:00:00</c:EndDate>
<c:TaskTypeID>1001</c:TaskTypeID>
<c:AdditionalTextIsRequired>false</c:AdditionalTextIsRequired>
<c:ProjectSubContractID>1001</c:ProjectSubContractID>
<c:HourlyRateID>1001</c:HourlyRateID>
<c:IsReadyForInvoicing>false</c:IsReadyForInvoicing>
<c:Details>
<c:CustomerHeader>
<d:ID>1001</d:ID>
<d:Name>Example </d:Name>
<d:No>1001</d:No>
<d:GUID>3f2504e0-4f89-41d3-9a0c-305000000002</d:GUID>
</c:CustomerHeader>
<c:ProjectHeader>
<c:ID>1001</c:ID>
<c:ProjectGUID>3f2504e0-4f89-41d3-9a0c-305000000003</c:ProjectGUID>
<c:Name>Example </c:Name>
<c:No>1001</c:No>
<c:IsActive>true</c:IsActive>
<c:IsGeneralProject>false</c:IsGeneralProject>
<c:StartDate>2026-10-01T00:00:00</c:StartDate>
<c:EndDate>2026-10-01T00:00:00</c:EndDate>
<c:MainContractID>1001</c:MainContractID>
</c:ProjectHeader>
<c:Type>
<c:ID>1001</c:ID>
<c:ID2>0</c:ID2>
<c:Name>Example </c:Name>
<c:Name2>Example</c:Name2>
</c:Type>
<c:CustomField>Example</c:CustomField>
</c:Details>
<c:State>
<c:IsActive>true</c:IsActive>
</c:State>
</a:Item>
<a:Status>Success</a:Status>
<a:Message>Example</a:Message>
</a:BatchContainerOfTask>
</a:Return>
<a:ReturnTypeDescription>BatchContainerOfTask</a:ReturnTypeDescription>
<a:Request>…</a:Request>
<a:ResponseState>Success</a:ResponseState>
<a:Messages>
<b:APIMessage>
<b:Message>Duration of call was 0,0421337 sec.</b:Message>
<b:Severity>Message</b:Severity>
<b:ErrorCode>0</b:ErrorCode>
</b:APIMessage>
</a:Messages>
<a:ErrorCode>0</a:ErrorCode>
<a:IsReturnPaged>false</a:IsReturnPaged>
<a:TotalPageCount>0</a:TotalPageCount>
</CreateTaskResult>
</CreateTaskResponse>
</s:Body>
</s:Envelope>
Request block is shortened.Errors
All errors come back with HTTP 200: check ResponseState, ErrorCode and Messages. The errors every operation can return (expired or invalid token, API not enabled, HTTPS required, general errors) are listed once in Responses and errors.
Errors specific to this operation:
| ResponseState | ErrorCode | Message | What it means | What to do |
|---|---|---|---|---|
| Error | 40001 | Error during call on TimeLog.API, Message '{rule text}' - one message per violated rule, then 'Task is not in an invalid state to be saved' | Name empty, start / end date missing or end before start. | Send Name, StartDate and EndDate; create sub-tasks only under tasks without allocations. |
| Error | 40001 | Error during call on TimeLog.API, Message 'The specified contract ID does not exist in the project.' | ProjectSubContractID is not a contract of the project. | Send 0 or a contract of the project. |
| Error | 40001 | Error during call on TimeLog.API, Message 'The specified HourlyRateID {HourlyRateID} do not exist, is in-active or not in the Price List of the Project related to the specified ProjectID: {ProjectID}' | HourlyRateID not valid for the project. | Send 0, or a rate valid for the project's price list. |
| Error | 40001 | Error during call on TimeLog.API, Message 'TypeID has to be > 0 on Task. Current value: {TaskTypeID}' | account requires task types. | Send a TaskTypeID. |