- Docs
- Api%2Freference%2Forganizations%2FCreateMember
Invite a member
Invite a new member to the organization by email, with the role they should hold. They receive an email with a link that accepts the invitation. Until they click it they appear here as `pending`, and the invitation is good for seven days. If they have no account yet, one is created when they accept. You can only hand out a role you hold yourself: an admin cannot invite a member as an owner. Attempting it comes back as `403`. Requires the `organizations.members.create` permission.
The access token returned after a successful sign-in, sent as
Authorization: Bearer <access_token>.
It identifies the person and the organization they are working in, and
it lasts about fifteen minutes. When it runs out, use their refresh
token at POST /auth/refresh-token instead of asking them to sign in
again.
In: header
Path Parameters
Identifier of the organization. Each endpoint states whether it must be the caller's active organization or may be used without authentication.
Request Body
application/json
Who to invite, and as what.
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.dual.network/organizations/665f1c2d4b1a2c3d4e5f6aa0/members" \ -H "Content-Type: application/json" \ -d '{ "email": "sam@example.com", "role_name": "member" }'{
"id": "665f1c2d4b1a2c3d4e5f6a7b"
}{
"code": 3,
"message": "Key: 'limit' Error:Field validation for 'limit' failed on the 'lte' tag"
}{
"code": 16,
"message": "no auth provided"
}{
"code": 7,
"message": "cannot assign a role with permissions beyond your own"
}{
"code": 5,
"message": "object not found"
}{
"code": 13,
"message": "internal error"
}