User Assignments

Get Users Assigned To Projects

GET https://YOURACCOUNT.harvestapp.com/projects/{PROJECTID}/user_assignments

You can filter by updated_since. To show only the user assignments that have been updated since 2010-09-25 18:30, pass the UTC date time value (URL encoded). Check out the example below.

GET https://YOURACCOUNT.harvestapp.com/projects/{PROJECTID}/user_assignments?updated_since=2015-09-25+18%3A30

HTTP Response: 200 OK

Examples

Example request in Postman

<?xml version="1.0" encoding="UTF-8"?>
<user-assignments type="array">
    <user-assignment>
        <user-id type="integer">508343</user-id>
        <project-id type="integer">5198193</project-id>
        <is-project-manager type="boolean">true</is-project-manager>
        <deactivated type="boolean">false</deactivated>
        <hourly-rate type="decimal">0.0</hourly-rate>
        <id type="integer">39918789</id>
        <budget type="decimal" nil="true"/>
        <created-at type="dateTime">2014-03-12T15:35:35Z</created-at>
        <updated-at type="dateTime">2014-07-15T16:33:05Z</updated-at>
        <estimate nil="true"/>
    </user-assignment>
</user-assignments>
[
    {
        "user_assignment": {
            "user_id": 508343,
            "project_id": 5198193,
            "is_project_manager": true,
            "deactivated": false,
            "hourly_rate": 0,
            "id": 39918789,
            "budget": null,
            "created_at": "2014-03-12T15:35:35Z",
            "updated_at": "2014-07-15T16:33:05Z",
            "estimate": null
        }
    }
]

Get A User Assignment

GET https://YOURACCOUNT.harvestapp.com/projects/{PROJECTID}/user_assignments/{USERASSIGNMENTID}

HTTP Response: 200 OK

Examples

Example request in Postman

<?xml version="1.0" encoding="UTF-8"?>
<user-assignment>
    <user-id type="integer">508343</user-id>
    <project-id type="integer">5198193</project-id>
    <is-project-manager type="boolean">true</is-project-manager>
    <deactivated type="boolean">false</deactivated>
    <hourly-rate type="decimal">0.0</hourly-rate>
    <id type="integer">39918789</id>
    <budget type="decimal" nil="true"/>
    <created-at type="dateTime">2014-03-12T15:35:35Z</created-at>
    <updated-at type="dateTime">2014-07-15T16:33:05Z</updated-at>
    <estimate nil="true"/>
</user-assignment>
{
    "user_assignment": {
        "user_id": 508343,
        "project_id": 5198193,
        "is_project_manager": true,
        "deactivated": false,
        "hourly_rate": 0,
        "id": 39918789,
        "budget": null,
        "created_at": "2014-03-12T15:35:35Z",
        "updated_at": "2014-07-15T16:33:05Z",
        "estimate": null
    }
}

Assign A User To A Project

POST https://YOURACCOUNT.harvestapp.com/projects/{PROJECTID}/user_assignments

To assign a user to a project, you’ll need to send the user’s ID in your request. Format it like the example below.

A successful call will return:

Location: /projects/{PROJECT_ID}/user_assignments/{NEW_USER_ASSIGNMENT_ID}

HTTP Response: 201 Created

Examples

<?xml version="1.0" encoding="UTF-8"?>
<user>
    <id type="integer">508343</id>
</user>
{
    "user": {
        "id": 508343
    }
}

Remove A User From A Project

DELETE https://YOURACCOUNT.harvestapp.com/projects/{PROJECT_ID}/user_assignments/{USER_ASSIGNMENT_ID}

Note that if the user has recorded hours against the project Harvest will archive the assignment record instead of deleting it. From the end result there is no difference between archiving or deletion, but if you need to make a difference Harvest will reply with a custom Hint header if deletion did not occur.

HTTP Response: 200 OK

Updating User Assignments

PUT https://YOURACCOUNT.harvestapp.com/projects/{PROJECT_ID}/user_assignments/{USER_ASSIGNMENT_ID}

No need to include attributes that you’d rather not update — the user assignment will keep the current value if you do not specify a new value.

Examples

Example request in Postman

<?xml version="1.0" encoding="UTF-8"?>
<user-assignment>
    <user-id type="integer">508343</user-id>
    <project-id type="integer">5198193</project-id>
    <is-project-manager type="boolean">true</is-project-manager>
    <deactivated type="boolean">false</deactivated>
    <hourly-rate type="decimal">0.0</hourly-rate>
</user-assignment>
{
    "user_assignment": {
        "user_id": 508343,
        "project_id": 5198193,
        "is_project_manager": true,
        "deactivated": false,
        "hourly_rate": 0
    }
}

Still have questions? We’re happy to help!

Contact Us