Test And Accept
API ReferenceProjectusers

Add user to project

Add a user to a project with specified access level

POST
/projects/{projectId}/users
AuthorizationBearer <token>

Clerk authentication token

In: header

Path Parameters

projectIdstring
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$
Formatuuid
userIdstring
Length1 <= length
accessLevelstring
Value in"owner" | "editor" | "approver" | "viewer" | "follower"
expiresAt?string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Formatdate-time

Response Body

curl -X POST "http://localhost:3001/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/users" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "string",
    "accessLevel": "owner"
  }'
{
  "success": true
}
{
  "code": "BAD_REQUEST",
  "message": "Invalid input data",
  "issues": []
}
{
  "code": "UNAUTHORIZED",
  "message": "Authorization not provided",
  "issues": []
}
{
  "code": "FORBIDDEN",
  "message": "Insufficient access",
  "issues": []
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error",
  "issues": []
}