THINKHX

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

MethodPathScope
GET/v1/teamteam:read
GET/v1/team/<member_id>team:read
POST/v1/teamteam: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

FieldTypeDescription
idstringThe membership identifier, prefixed pjin_.
objectstringAlways team_member.
consumerobjectThe person, as id, email, name and surname.
roleobjectThe role, as id (prefixed ptoi_) and name. A project has two roles: administrator and user.
is_defaultbooleanWhether this member is the project's default owner.
statusstringThe membership's status.
created_atintegerWhen the member joined, in Unix seconds.
updated_atintegerLast 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
curl https://api.thinkhx.com/v1/team \
  -H "Authorization: Bearer sk-project-YOUR_KEY"
json
{
  "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
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.

ParameterTypeRequiredDescription
consumer_emailstringone ofThe email address of the consumer to invite.
consumer_identstringone ofThe identifier of the consumer to invite, prefixed cons_.
rolestringnoThe role to give: either a role identifier prefixed ptoi_, or a role name (administrator or user). Defaults to user.

Important — A role that matches no identifier and no name is not refused. The invitation is created with user instead, so a wrong value looks like a success. Read role back from the response to confirm what was applied.

curl
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.

CodeMessageCause
422consumer_email or consumer_ident is required.Neither field was sent.
422The consumer cannot be invited to this project.The consumer cannot join. See below.

Important — Every reason an invitation cannot proceed answers the same 422 message: 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.

ParameterTypeRequiredDescription
rolestringyesThe new role: an identifier prefixed ptoi_, or a role name (administrator or user).
curl
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 role is not refused. The call answers 200 with the member's role unchanged, so a wrong value is a silent no-op. Check role in 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
curl -X DELETE https://api.thinkhx.com/v1/team/pjin_5c93b7e408a1df6215ba \
  -H "Authorization: Bearer sk-project-YOUR_KEY"
json
{
  "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.

Need help? Contact Support.