Skip to content
Suomi

Add a person to the project

POST
/v1/projects/{projectId}/members
Code sample: Shell / cURL
curl --request POST \
--url https://api.whatsbuilt.fi/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/members \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "user_id": "example", "email": "example", "project_role": "viewer" }'

By user_id: a person of the project’s organisation, or of another organisation whose access request was approved. By email: any person with a WhatsBuilt account, for a project of the integration’s own organisation; the person gets an e-mail. An integration is never added this way: its address finds nothing and its id answers 404. Adding someone who is already a member answers 200 with already_member and changes nothing, so a repeat is safe. The role can be at most the integration’s own on the project.

projectId
required
string format: uuid
Media typeapplication/json

The body of addMember: user_id or email.

object
user_id

A person of the project’s organisation, or one whose access request was approved

string
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
email

Any person with a WhatsBuilt account; they get an e-mail. Only for the project’s own organisation.

string
<= 320 characters
project_role

A role a member route gives.

string
default: viewer
Allowed values: viewer inspector admin

Already a member

Media typeapplication/json

The answer of addMember.

object
status
required

Whether the person was added.

string
Allowed values: added already_member
notified

For an add by e-mail: whether the member got the e-mail

boolean
member
required

A live member.

object
project_id
required

The project.

string format: uuid
user_id
required

The person.

string
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
name
required

Their name, read when answering.

string | null
email
required

Their e-mail, read when answering.

string | null
project_role
required

Their role on the project.

string
Allowed values: owner admin inspector viewer
account_id
required

Their organisation.

string | null format: uuid
account_name
required

Null when the member’s organisation is not readable to the principal

string | null
external
required

The member belongs to another organisation than the project’s owner

boolean
invited_by
required

Who added them.

string | null
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
added_at
required

When they were added.

string
changed_at
required

The row’s change time.

string
deleted
required
boolean

Example

{
"status": "added",
"member": {
"project_role": "owner",
"deleted": false
}
}

Added

Media typeapplication/json

The answer of addMember.

object
status
required

Whether the person was added.

string
Allowed values: added already_member
notified

For an add by e-mail: whether the member got the e-mail

boolean
member
required

A live member.

object
project_id
required

The project.

string format: uuid
user_id
required

The person.

string
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
name
required

Their name, read when answering.

string | null
email
required

Their e-mail, read when answering.

string | null
project_role
required

Their role on the project.

string
Allowed values: owner admin inspector viewer
account_id
required

Their organisation.

string | null format: uuid
account_name
required

Null when the member’s organisation is not readable to the principal

string | null
external
required

The member belongs to another organisation than the project’s owner

boolean
invited_by
required

Who added them.

string | null
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
added_at
required

When they were added.

string
changed_at
required

The row’s change time.

string
deleted
required
boolean

Example

{
"status": "added",
"member": {
"project_role": "owner",
"deleted": false
}
}

VALIDATION_ERROR; MEMBER_OTHER_ACCOUNT: a person of another organisation needs an approved access request, or an add by e-mail

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

Missing, malformed, expired or revoked token

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the integration is not the project’s admin, or the role is above its own; MEMBER_EXTERNAL_ADD_FORBIDDEN when the project is another organisation’s; PUBLIC_API_DISABLED

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

No such project or member; MEMBER_EMAIL_NOT_FOUND when no person has the address

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

IDEMPOTENCY_KEY_REUSED: the key was used with another body

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

RATE_LIMITED: the organisation’s hourly budget of adds by e-mail is spent

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}