Team
A team member is a consumer attached to your project with a role. This resource lists them, invites new ones and changes or removes existing ones. A member is identified by a membership identifier prefixed pjin_, which is not the consumer's own identifier.
Endpoints
| Method | Path | Scope |
|---|---|---|
| GET | /v1/team | team:read |
| GET | /v1/team/<member_id> | team:read |
| POST | /v1/team | team:write |
| PATCH | /v1/team/<member_id> | team:write |
| DELETE | /v1/team/<member_id> | team:write |
<member_id> is a membership identifier, prefixed pjin_.
The team member object
| Field | Type | Description |
|---|---|---|
id | string | The membership identifier, prefixed pjin_. |
object | string | Always team_member. |
consumer | object | The person, as id, email, name and surname. |
role | object | The role, as id (prefixed ptoi_) and name. A project has two roles: administrator and user. |
is_default | boolean | Whether this member is the project's default owner. |
status | string | The membership's status. |
created_at | integer | When the member joined, in Unix seconds. |
updated_at | integer | Last change, in Unix seconds. |
is_default marks the one membership the project cannot function without. It can be neither re-roled nor removed through the API.
List the team
GET /v1/team returns the project's members, at most 100, newest first.
curl https://api.thinkhx.com/v1/team \
-H "Authorization: Bearer sk-project-YOUR_KEY" {
"code": 200,
"title": "OK",
"response": {
"object": "list",
"data": [
{
"id": "pjin_5c93b7e408a1df6215ba",
"object": "team_member",
"consumer": {
"id": "cons_8e2b45a10c9df7631b4a",
"email": "ada@acme.example",
"name": "Ada",
"surname": "Lovelace"
},
"role": { "id": "ptoi_6d7e8f901a2b3c4d5e6f", "name": "administrator" },
"is_default": true,
"status": "activated",
"created_at": 1751328000,
"updated_at": 1751328000
}
],
"total": 1
}
} Read one member
GET /v1/team/<member_id> returns a single membership of your project. A membership of another project gives 404 and Team member not found.
curl https://api.thinkhx.com/v1/team/pjin_5c93b7e408a1df6215ba \
-H "Authorization: Bearer sk-project-YOUR_KEY" Invite a member
POST /v1/team invites an existing consumer. Name them by email or by identifier — one of the two is required.
| Parameter | Type | Required | Description |
|---|---|---|---|
consumer_email | string | one of | The email address of the consumer to invite. |
consumer_ident | string | one of | The identifier of the consumer to invite, prefixed cons_. |
role | string | no | The role to give: either a role identifier prefixed ptoi_, or a role name (administrator or user). Defaults to user. |
Important — A
rolethat matches no identifier and no name is not refused. The invitation is created withuserinstead, so a wrong value looks like a success. Readroleback from the response to confirm what was applied.
curl -X POST https://api.thinkhx.com/v1/team \
-H "Authorization: Bearer sk-project-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "consumer_email": "grace@acme.example" }' The call answers 201 with the new membership, in the same shape the list returns.
| Code | Message | Cause |
|---|---|---|
| 422 | consumer_email or consumer_ident is required. | Neither field was sent. |
| 422 | The consumer cannot be invited to this project. | The consumer cannot join. See below. |
Important — Every reason an invitation cannot proceed answers the same
422message: no such consumer, a suspended or deleted account, or a consumer who is already a member. The API deliberately does not distinguish them, so that this endpoint cannot be used to discover whether an email address has an account.
Change a role
PATCH /v1/team/<member_id> changes nothing but the role.
| Parameter | Type | Required | Description |
|---|---|---|---|
role | string | yes | The new role: an identifier prefixed ptoi_, or a role name (administrator or user). |
curl -X PATCH https://api.thinkhx.com/v1/team/pjin_5c93b7e408a1df6215ba \
-H "Authorization: Bearer sk-project-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "role": "ptoi_6d7e8f901a2b3c4d5e6f" }' Important — Here too an unrecognised
roleis not refused. The call answers200with the member's role unchanged, so a wrong value is a silent no-op. Checkrolein the response rather than the status code.
The default owner is refused with 422 and Cannot change the role of the default owner of the project.
Remove a member
DELETE /v1/team/<member_id> detaches the consumer from the project. The account itself is untouched.
curl -X DELETE https://api.thinkhx.com/v1/team/pjin_5c93b7e408a1df6215ba \
-H "Authorization: Bearer sk-project-YOUR_KEY" {
"code": 200,
"title": "OK",
"response": {
"deleted": true,
"id": "pjin_5c93b7e408a1df6215ba"
}
} The default owner is refused with 422 and Cannot remove the default owner of the project. To hand a project over, promote another member first through the workspace.
Invitations, role changes and removals are all recorded. See Events.