Skip to content

API reference

Invite a person to the workspace

Other routes API

POST/v1/team/invitations

For a new address: makes a login at the identity provider, adds the person to this workspace with the role and access, and has the identity provider mail them an invitation to set up their sign-in, in one step. When anything fails after the login was made, it is removed again and nothing is stored.

For an address that already has a Certinvo login: stores a pending invitation and mails a notice. Nothing is reachable until that person, signed in as themselves, accepts it with POST /v1/session/invitations/{id}/accept. The answer is the same as for a new address. A notice that could not be sent leaves the invitation pending; Team lists it, and it can be resent or revoked.

Only an owner or an admin of the workspace can invite, and only an owner can invite an owner. Only a signed-in person can invite. An API key is refused with 401 session_required.

Request body

application/json, required

  • emailstringRequired
  • rolestringRequired
    One of owner, admin, developer, operator, auditor.
  • accessstringRequired

    Every company of the workspace, or only the listed ones.

    One of all, selected.
  • companiesarray of string (uuid)

    The companies of a selected person, at least one.

Response

A 201 answer carries these fields.

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

Status codes

Status Meaning
201 The new person is on the workspace and the identity provider’s invitation was sent, or an existing login was invited and must accept.
400 The body is not {"email", "role", "access", "companies"} with an email address, one of the five roles, and at least one company for selected access (invalid_invitation); or a company is not one of this workspace (unknown_company). Nothing was done.
401 No usable credential was sent (invalid_credentials), or an API key was used (session_required).
403 The person is not an owner or an admin of this workspace, an admin tried to invite an owner, or an admin with selected access gave access beyond their own companies (role_required). Nothing was done.
409 The person is already a member of this workspace (already_member), so their access is changed in Team instead; this workspace already has a pending invitation to the address (already_invited); or the address belongs to a login at the identity provider that Certinvo does not know (email_taken). Nothing was done.
501 This deployment has no database (no_database). Sending the same request again will not help.
502 The identity provider refused or could not be reached (invitation_not_sent). Nothing was stored.
503 This deployment has no identity provider token (invitations_not_configured).
POST/v1/team/invitations
Example
curl -X POST https://api.certinvo.com/v1/team/invitations \
  -H "Authorization: Bearer $CERTINVO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @body.json
import { readFile } from 'node:fs/promises'

const response = await fetch(`https://api.certinvo.com/v1/team/invitations`, {
  method: 'POST',
  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

response = requests.post(
    "https://api.certinvo.com/v1/team/invitations",
    headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
    data=open("body.json", "rb"),
)
print(response.status_code, response.text)
201
application/json
{
  "email": "string",
  "role": "owner",
  "access": "all",
  "companies": [
    "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a"
  ]
}
Success response
POST
/v1/team/invitations
Invite a person to the workspace
All
›AuthenticationRequiredBearerAuth

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

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

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close