Skip to content

Invite a customer

POST
/v1/portals/{portalId}/customers
curl --request POST \
--url https://api.pealboard.com/v1/portals/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "email": "hello@example.com", "name": "example", "companyId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "role": "customer" }'

Creates the customer and emails them a link to the portal. There is no password and no invitation token to redeem: the address is the identity, and signing in sends a six-digit code to it. Company is assigned here and a customer never chooses their own.

Access. Requires the admin role or above (admin, owner). Inviting a customer grants somebody outside the company a way in. API-key scope: portals:write.

portalId
required

From GET /v1/portals.

string format: uuid

From GET /v1/portals.

Media typeapplication/json
object
email
required
string format: email
name
string
>= 1 characters <= 120 characters
companyId
required

A UUID this API issued.

string format: uuid
role

Customer: submits requests and sees their own, their company’s and the portal’s public ones. manager: a customer-side lead who sees every request in their company and can invite other customers into it.

string
default: customer
Allowed values: customer manager

The customer.

Media typeapplication/json
object
id
required

The portal_members id. Not the portal user’s id.

string format: uuid
email
required
string format: email
name
required
string
role
required

Customer: submits requests and sees their own, their company’s and the portal’s public ones. manager: a customer-side lead who sees every request in their company and can invite other customers into it.

string
Allowed values: customer manager
company
required
object
id
required

A UUID this API issued.

string format: uuid
name
required
string
lastSignedInAt
required
string | null format: date-time
createdAt
required
string format: date-time
Example
{
"role": "customer"
}

No valid credentials.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

Authenticated, but not permitted.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

No such resource, or it is not visible to you.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

The request conflicts with the current state.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

The request did not match the expected shape.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

Rate limited. Retry after the interval in the header.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

GitHub or another dependency refused or did not answer. Nothing in the workspace changed.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}