Skip to main content
POST/activities/

Create activity

You can create an activity. It can be linked to a contact (user_id), a deal and a company, or to none of them. Fields that aren't in the table are ignored: no attribute is created for them.

Attributes

Optional unless marked required

custom_idstring
Your own ID for the activity. Unique: another activity can't have the same one.
activity_typeintegerrequired
A unique identifier of any activity type given by User automatically.
assigned_tointeger
A unique identifier for the agent which is given by User automatically.
company_idinteger
A unique identifier for the company which is given by User automatically.
deal_idinteger
A unique identifier for the deal which is given by User automatically.
descriptionstring
A description of the activity.
doneboolean
Whether the activity is done. false when not sent.
due_datestringrequired
When the activity is due, ISO 8601 (for example 2026-11-21T10:00:00Z). A date in the past is accepted.
durationinteger
Time needed for the activity. 15 when not sent. Not checked beyond being a whole number: a negative value is accepted.
namestringrequired
The main title of the activity.
user_idinteger
A unique identifier for the user which is given by User automatically.

Request​

curl -X POST "https://<your_app_subdomain>.user.com/api/public/activities/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"name": "Onboarding call",
"activity_type": 6,
"due_date": "2026-11-10T13:40:17Z",
"duration": 30,
"description": "Walk through the first campaign setup.",
"user_id": 1884
}'

Response examples​

{
"id": 14,
"activity_type": 6,
"name": "Onboarding call",
"due_date": "2026-11-10T13:40:17Z",
"duration": 30,
"description": "Walk through the first campaign setup.",
"assigned_to": null,
"deal_id": null,
"user_id": 1884,
"company_id": null,
"done": false,
"done_date": null,
"created_by": 1,
"created_at": "2026-11-09T13:40:18.141486Z",
"updated_at": "2026-11-09T13:40:18.141509Z",
"custom_id": null
}

A 400 names every field that was rejected, each with its messages. The ones you're most likely to see:

MessageWhen
This field is required.name, activity_type or due_date is missing (each missing field is listed).
Invalid pk "123" - object does not exist.No record has that ID: activity_type, assigned_to (agent), user_id, deal_id or company_id.
Incorrect type. Expected pk value, received str.An ID field got a string.
Datetime has wrong format. Use one of these formats instead: YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z].due_date isn't an ISO 8601 date and time.
A valid integer is required.duration isn't a whole number.
Must be a valid boolean.done isn't true or false.
activity with this custom id already exists.Another activity already has that custom_id.

Response fields​

Fields returned in the 201 Created response body.

idinteger
A unique identifier for the activity which is given by User automatically.
activity_typeinteger
A unique identifier of any activity type given by User automatically.
namestring
An activity name.
due_datestring (date-time)
When the activity is due, ISO 8601 (for example 2026-11-21T10:00:00Z). A date in the past is accepted.
durationinteger
Time needed for the activity. 15 when not sent. Not checked beyond being a whole number: a negative value is accepted.
descriptionstring
A description of the activity.
assigned_tointegernullable
A unique identifier for the agent which is given by User automatically.
deal_idintegernullable
A unique identifier for the deal which is given by User automatically.
user_idintegernullable
ID of the contact the activity is linked to. null when there's none, also after the contact is deleted.
company_idintegernullable
A unique identifier for the company which is given by User automatically.
doneboolean
Whether the activity is done. false when not sent.
done_datestring (date-time)nullable
When the activity was marked as done: set when done becomes true, cleared when it becomes false. Read-only.
created_byinteger
A unique identifier of an agent who created an activity.
created_atstring (date-time)
A creation date of an activity.
updated_atstring (date-time)
A date of last activity update.
custom_idstringnullable
Your own ID for the activity. Unique: another activity can't have the same one.
note

Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.