Defining the Current User

⚠️

Please Note

  • These docs are for the legacy API that will be depreciating early 2027.
  • We will not be adding new functionality and will provide very limited support for the legacy API.
  • If you are planning to build an integration or are an existing user of our API looking for improved functionality or support, please look to the new CompanyCam API at developers.companycam.com.

CompanyCam attributes a number of actions to the current User, or a designated User. Some examples of actions the current User can execute would be -

  • Current User creating Document 1
  • Current User assigning Project 1 to User B
  • Current User uploading a photo to Project 2

Within our API, The current User is defined by the person who authenticated with CompanyCam using the OAuth2.0 flow. By default, objects like Project, Photo, and Document that were created through our API will assign the current User as the creator or editor.

In order to designate a different CompanyCam User as the creator or editor, you can send that User's CompanyCam email in the request header of your API call. The request field should include X_COMPANYCAM_USER with the valid email of the User in CompanyCam.

curl --location "https://api.companycam.com/v2/projects" \
--header "X_COMPANYCAM_USER: [email protected]" \  
--header "Content-Type: application/json" \
--header "Authorization: Bearer {TOKEN}" \    
--header "Cookie: \_production_companycam_session={SESSION_TOKEN}' \
--data '{  
    "name": "Project for Roof Job 4132",  
    "address": {  
        "street_address_1": "4132 Pleasant St",  
        "city": "Lincoln",  
        "state": "NE",  
        "postal_code": "68508",  
        "country": "US"  
    }  
}'

Endpoints that use X_COMPANYCAM_USER in Request Header


Did this page help you?