Skip to main content

Team

Remove somebody

Take a member off the account, or cancel an invitation — one endpoint, because they are one row.

DELETE/team/members/{userId}
Remove somebody
curl --request DELETE \
  --url 'https://truestat.io/api/v1/team/members/{userId}' \
  --header 'Authorization: Bearer <token>'
{
  "data": {
    "removed": true,
    "user_id": "9c9df94f-59f2-4080-bc3c-21b80ebdfe9c",
    "was_pending": false
  },
  "meta": {}
}

Removes a member, or cancels an invitation that was never accepted.

One endpoint for both, because they are the same row at different stages. was_pending in the response says which happened — you cannot ask afterwards, since the row is gone.

What else goes

RemovingTheir TrueStat account
An unaccepted invitationdeleted with it
An accepted memberleft alone

The first account existed only for that invitation — nobody ever signed into it. Leaving it behind would one day produce the question why does this address look registered?

The second is theirs: their own password, possibly another organisation. Being removed from your team is not a reason to delete somebody's account.

Their data stays

Sites, goals, notes and everything else belong to the organisation, not to the person who created them. Nothing is deleted here except the seat.

The seat is freed immediately, so an invitation that was blocked by the plan's limit can be sent right after this call.

The owner cannot be removed

409 last_owner — nobody would be left to run the account, and the permission needed to undo it would go with them.

Owner only, like every team write.

Authorizations

Authorizationstringheaderrequired

An API key from Settings → API keys. Scopes available: analytics:read, sites:read, sites:write, settings:read, settings:write, goals:read, goals:write, funnels:read, funnels:write, notes:read, notes:write, alerts:read, alerts:write, team:read, team:write, revenue:read, revenue:write.

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

Path parameters

userIdstring (uuid)path
The person, as `GET /team` returns them.

Response

application/json

The answer.

dataobject
metaobject