curl --request POST \
--url https://api.projectcor.com/v1/contracts/{contract_id}/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"users": [
{
"id": 123,
"dates": [
{
"start": "2026-01-01",
"end": "2026-02-01"
},
{
"start": "2026-01-01",
"end": "2026-02-02"
}
]
}
]
}
'{
"status": "partial_success",
"company_id": 999,
"contract_id": 777,
"records_received": 8,
"records_created": 2,
"records_rejected": 8,
"assigned": [
{
"id": 501,
"user_id": 88001,
"start_date": "2024-01-01T00:00:00.000Z",
"end_date": "2024-12-31T00:00:00.000Z"
},
{
"id": 502,
"user_id": 88001,
"start_date": "2024-03-01T00:00:00.000Z",
"end_date": "2024-06-30T00:00:00.000Z"
}
],
"errors": [
{
"id": 88001,
"dates": [
{
"start": "2024-06-01",
"end": "2024-04-01",
"message": "Date malformatted. Start date must be before end date"
},
{
"start": null,
"end": null,
"message": "Date malformatted"
},
{
"start": "2024-02-01",
"end": null,
"message": "Date malformatted. Start and end date are required"
},
{
"start": "not-a-date",
"end": "2024-12-31",
"message": "Invalid date"
},
{
"start": "1990-01-01",
"end": "1990-06-30",
"message": "Invalid contract periods. Range must be within contract start and end dates"
}
],
"message": "Partial success. Some dates were rejected"
},
{
"id": "hello",
"dates": [
{
"start": "2024-01-01",
"end": "2024-12-31"
}
],
"message": "User malformatted"
},
{
"id": 88002,
"start": "2024-01-01",
"end": "2024-12-31",
"message": "Legacy format detected. Use \"dates\" array instead of \"start\" and \"end\" fields"
},
{
"id": 88003,
"dates": [],
"message": "Date malformatted or empty"
},
{
"id": 88004,
"dates": [
{
"start": "2024-07-01",
"end": "2024-07-01",
"message": "Date malformatted. Start date must be before end date"
}
],
"message": "Dates are malformatted or empty"
},
{
"id": 88005,
"dates": [
{
"start": null,
"end": null,
"message": "Date malformatted"
}
],
"message": "Partial success. Some dates were rejected"
},
{
"id": 999999,
"dates": [
{
"start": "2024-01-01",
"end": "2024-12-31"
}
],
"message": "User malformatted"
},
{
"id": 88005,
"dates": [
{
"start": "2024-01-01",
"end": "2024-06-30"
}
],
"message": "User malformatted"
}
]
}Attaches one or more users to a contract, each with one or more date ranges.
curl --request POST \
--url https://api.projectcor.com/v1/contracts/{contract_id}/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"users": [
{
"id": 123,
"dates": [
{
"start": "2026-01-01",
"end": "2026-02-01"
},
{
"start": "2026-01-01",
"end": "2026-02-02"
}
]
}
]
}
'{
"status": "partial_success",
"company_id": 999,
"contract_id": 777,
"records_received": 8,
"records_created": 2,
"records_rejected": 8,
"assigned": [
{
"id": 501,
"user_id": 88001,
"start_date": "2024-01-01T00:00:00.000Z",
"end_date": "2024-12-31T00:00:00.000Z"
},
{
"id": 502,
"user_id": 88001,
"start_date": "2024-03-01T00:00:00.000Z",
"end_date": "2024-06-30T00:00:00.000Z"
}
],
"errors": [
{
"id": 88001,
"dates": [
{
"start": "2024-06-01",
"end": "2024-04-01",
"message": "Date malformatted. Start date must be before end date"
},
{
"start": null,
"end": null,
"message": "Date malformatted"
},
{
"start": "2024-02-01",
"end": null,
"message": "Date malformatted. Start and end date are required"
},
{
"start": "not-a-date",
"end": "2024-12-31",
"message": "Invalid date"
},
{
"start": "1990-01-01",
"end": "1990-06-30",
"message": "Invalid contract periods. Range must be within contract start and end dates"
}
],
"message": "Partial success. Some dates were rejected"
},
{
"id": "hello",
"dates": [
{
"start": "2024-01-01",
"end": "2024-12-31"
}
],
"message": "User malformatted"
},
{
"id": 88002,
"start": "2024-01-01",
"end": "2024-12-31",
"message": "Legacy format detected. Use \"dates\" array instead of \"start\" and \"end\" fields"
},
{
"id": 88003,
"dates": [],
"message": "Date malformatted or empty"
},
{
"id": 88004,
"dates": [
{
"start": "2024-07-01",
"end": "2024-07-01",
"message": "Date malformatted. Start date must be before end date"
}
],
"message": "Dates are malformatted or empty"
},
{
"id": 88005,
"dates": [
{
"start": null,
"end": null,
"message": "Date malformatted"
}
],
"message": "Partial success. Some dates were rejected"
},
{
"id": 999999,
"dates": [
{
"start": "2024-01-01",
"end": "2024-12-31"
}
],
"message": "User malformatted"
},
{
"id": 88005,
"dates": [
{
"start": "2024-01-01",
"end": "2024-06-30"
}
],
"message": "User malformatted"
}
]
}Documentation Index
Fetch the complete documentation index at: https://developers.projectcor.com/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Show child attributes
Users attached to contract with full or partial success
Result status for attach operation
success, partial_success, failure Company ID
Contract ID
Total number of date records received
Total number of date records successfully created
Total number of date records rejected
Array of user IDs that were successfully assigned to the contract
Array of user assignments for the contract
Show child attributes
Array of user assignments that failed to be assigned to the contract
Show child attributes
Was this page helpful?