Skip to main content
POST
https://{tenantDomain}/api/v2
/
organizations
/
{id}
/
invitations
Go
package example

import (
    client "github.com/auth0/go-auth0/management/client"
    option "github.com/auth0/go-auth0/management/option"
    context "context"
    organizations "github.com/auth0/go-auth0/management/organizations"
    management "github.com/auth0/go-auth0/management"
)

func do() () {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    client.Organizations.Invitations.Create(
        context.TODO(),
        "id",
        &organizations.CreateOrganizationInvitationRequestContent{
            Inviter: &management.OrganizationInvitationInviter{
                Name: "name",
            },
            Invitee: &management.OrganizationInvitationInvitee{
                Email: "email",
            },
            ClientId: "client_id",
        },
    )
}
{
  "id": "uinv_0000000000000001",
  "organization_id": "<string>",
  "inviter": {
    "name": "Jane Doe"
  },
  "invitee": {
    "email": "john.doe@gmail.com"
  },
  "invitation_url": "https://mycompany.org/login?invitation=f81dWWYW6gzGGicxT8Ha0txBkGNcAcYr&organization=org_0000000000000001&organization_name=acme",
  "created_at": "2020-08-20T19:10:06.299Z",
  "expires_at": "2020-08-27T19:10:06.299Z",
  "client_id": "AaiyAPdpYdesoKnqjj8HJqRn4T5titww",
  "connection_id": "con_0000000000000001",
  "app_metadata": {},
  "user_metadata": {},
  "roles": [
    "<string>"
  ],
  "ticket_id": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Organization identifier.

Maximum string length: 50

Body

inviter
object
required
invitee
object
required
client_id
string<client-id>
default:AaiyAPdpYdesoKnqjj8HJqRn4T5titww
required

Auth0 client ID. Used to resolve the application's login initiation endpoint.

connection_id
string<connection-id>
default:con_0000000000000001

The id of the connection to force invitee to authenticate with.

app_metadata
object

Data related to the user that does affect the application's core functionality.

user_metadata
object

Data related to the user that does not affect the application's core functionality.

ttl_sec
integer

Number of seconds for which the invitation is valid before expiration. If unspecified or set to 0, this value defaults to 604800 seconds (7 days). Max value: 2592000 seconds (30 days).

Required range: 0 <= x <= 2592000
roles
string<role-id>[]

List of roles IDs to associated with the user.

Minimum array length: 1
send_invitation_email
boolean
default:true

Whether the user will receive an invitation email (true) or no email (false), true by default

Response

Invitation successfully created.

id
string<user-invitation-id>
default:uinv_0000000000000001

The id of the user invitation.

organization_id
string<organization-id>

Organization identifier.

Maximum string length: 50
inviter
object
invitee
object
invitation_url
string<strict-https-uri>
default:https://mycompany.org/login?invitation=f81dWWYW6gzGGicxT8Ha0txBkGNcAcYr&organization=org_0000000000000001&organization_name=acme

The invitation url to be send to the invitee.

created_at
string<date-time>
default:2020-08-20T19:10:06.299Z

The ISO 8601 formatted timestamp representing the creation time of the invitation.

expires_at
string<date-time>
default:2020-08-27T19:10:06.299Z

The ISO 8601 formatted timestamp representing the expiration time of the invitation.

client_id
string<client-id>
default:AaiyAPdpYdesoKnqjj8HJqRn4T5titww

Auth0 client ID. Used to resolve the application's login initiation endpoint.

connection_id
string<connection-id>
default:con_0000000000000001

The id of the connection to force invitee to authenticate with.

app_metadata
object

Data related to the user that does affect the application's core functionality.

user_metadata
object

Data related to the user that does not affect the application's core functionality.

roles
string<role-id>[]

List of roles IDs to associated with the user.

Minimum array length: 1
ticket_id
string<ticket-id>

The id of the invitation ticket