Skip to content

API reference

Change one person's role and access

Other routes API

PUT/v1/team/members/{userId}/access

Sets one person’s role, their access (every company, or the selected ones) and the companies of a selected person. Send the revision you read from GET /v1/team; if someone changed the access since, the answer is 409 version_conflict.

Only an owner or an admin may change access. Only an owner gives owner or changes an owner. An admin with selected access gives only selected access, only to their own companies, and never admin. Nobody widens their own access. The last owner stays an owner (409 last_owner).

A selected person with no company reaches no company at all. Only a signed-in person can change access. An API key is refused with 401 session_required.

Path parameters

  • userIdstring (uuid)Required

Request body

application/json, required

  • rolestringRequired
    One of owner, admin, developer, operator, auditor.
  • accessstringRequired
    One of all, selected.
  • companiesarray of string (uuid)
  • revisionintegerRequired

Response

A 200 answer carries these fields.

  • userIdstring (uuid)Required
  • emailstringRequired
  • rolestringRequired
    One of owner, admin, developer, operator, auditor.
  • accessstringRequired

    Every company of the workspace, or only the listed ones. Selected with none reaches no company.

    One of all, selected.
  • companiesarray of objectRequired

    The companies of a selected person and the role in each; empty for every-company access.

    Show 2 child fields
    • idstring (uuid)Required
    • rolestringRequired
      One of owner, admin, developer, operator, auditor.
  • revisionintegerRequired

    Send it back when changing this access.

Status codes

Status Meaning
200 The person, as GET /v1/team lists them now.
400 The body is not a role, an access and a revision (invalid_invitation), or a company is not one of this workspace (unknown_company).
401 No usable credential was sent (invalid_credentials), or an API key was used (session_required).
403 This person may not make this change (role_required).
404 The person is not in this workspace (not_found).
409 The access changed since it was read (version_conflict), or this is the last owner (last_owner).
PUT/v1/team/members/{userId}/access
Example
curl -X PUT https://api.certinvo.com/v1/team/members/$MEMBER_USER_ID/access \
  -H "Authorization: Bearer $CERTINVO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @body.json
import { readFile } from 'node:fs/promises'

const memberUserId = 'value'

const response = await fetch(`https://api.certinvo.com/v1/team/members/${memberUserId}/access`, {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: await readFile('body.json'),
})
console.log(response.status, await response.json())
import os

import requests

member_user_id = "value"

response = requests.put(
    f"https://api.certinvo.com/v1/team/members/{member_user_id}/access",
    headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
    data=open("body.json", "rb"),
)
print(response.status_code, response.text)
200
application/json
{
  "userId": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
  "email": "string",
  "role": "owner",
  "access": "all",
  "companies": [
    {
      "id": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
      "role": "owner"
    }
  ],
  "revision": 0
}
Success response
PUT
/v1/team/members/{userId}/access
Change one person's role and access
All
›AuthenticationRequiredBearerAuth

Provide your API key in the Authorization: Bearer <key> header. Keys are stored locally in your browser.

›Variables1
›Headers2
›Bodyapplication/json
›Code Snippet
curl -X PUT "https://api.certinvo.com/v1/team/members/{userId}/access" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "role": "owner",
  "access": "all",
  "companies": [
    "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a"
  ],
  "revision": 0
}...'
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close