Show examples in:
JavascriptHTTP
Endpoint info
Available examples
Dashboard API > Organization invitation

Invite a new member

Warning: Experimental API

Please note that the Dashboard API is an experimental, prerelease API. This API method is considered unstable, and should be avoided in production environments and automations. Changes may occur at any time without warning.

Sends an invitation email to the given address. Invitation emails are capped per day for each organization, and the cap counts both new and resent invitations. Past the cap the API answers 429 RATE_LIMIT_EXCEEDED, and the X-RateLimit-Reset header tells how many seconds are left before new invitations can be sent.

Body parameters

emailstringRequired

Email

Example:"mark.smith@example.com"
roleRequired

Role

Type:<a href="/docs/content-management-api/resources/organization_role">ResourceLinkage&#x3C;"organization_role"></a>

Returns

Returns a resource object of type organization_invitation

Examples

import { buildClient } from "@datocms/dashboard-client";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const organizationInvitation = await client.organizationInvitations.create({
email: "mark.smith@example.com",
role: { type: "organization_role", id: "312" },
});
// Check the 'Returned output' tab for the result ☝️
console.log(organizationInvitation);
}
run();
{
id: "312",
email: "mark.smith@example.com",
meta: { expired: false },
role: { type: "organization_role", id: "312" },
}