Skip to main content
POST
/
projects
/
{project_id}
/
collaborators
Add project collaborators
curl --request POST \
  --url https://api.projectcor.com/v1/projects/{project_id}/collaborators \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data usersIds=123
import requests

url = "https://api.projectcor.com/v1/projects/{project_id}/collaborators"

payload = { "usersIds": "123" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-www-form-urlencoded"
}

response = requests.post(url, data=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({usersIds: '123'})
};

fetch('https://api.projectcor.com/v1/projects/{project_id}/collaborators', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
const encodedParams = new URLSearchParams();
encodedParams.set('usersIds', '123');

const url = 'https://api.projectcor.com/v1/projects/{project_id}/collaborators';
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: encodedParams
};

fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.projectcor.com/v1/projects/{project_id}/collaborators",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "usersIds=123",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/x-www-form-urlencoded"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.projectcor.com/v1/projects/{project_id}/collaborators"

payload := strings.NewReader("usersIds=123")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
{
  "message": "Collaborators added successfully"
}
{
"name": "CORCustomError",
"code": "PC001",
"message": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

project_id
integer
required

Body

application/x-www-form-urlencoded
usersIds
integer[]

Array of user IDs to add as collaborators

Response

Collaborators added successfully

message
string
Example:

"Collaborators added successfully"