curl --request POST \
--url https://api.turnkey.com/public/v1/submit/create_invitations \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <string> (see Authorizations)" \
--data '{
"type": "ACTIVITY_TYPE_CREATE_INVITATIONS",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"invitations": [
{
"receiverUserName": "<string>",
"receiverUserEmail": "<string>",
"receiverUserTags": [
"<string>"
],
"accessType": "<ACCESS_TYPE_WEB>",
"senderUserId": "<string>"
}
]
}
}'
import { Turnkey } from "@turnkey/sdk-server";
const turnkeyClient = new Turnkey({
apiBaseUrl: "https://api.turnkey.com",
apiPublicKey: process.env.API_PUBLIC_KEY!,
apiPrivateKey: process.env.API_PRIVATE_KEY!,
defaultOrganizationId: process.env.ORGANIZATION_ID!,
});
const response = await turnkeyClient.apiClient().createInvitations({
invitations: [{ // A list of Invitations.,
receiverUserName: "<string> (The name of the intended Invitation recipient.)",
receiverUserEmail: "<string> (The email address of the intended Invitation recipient.)",
receiverUserTags: ["<string>"] // A list of tags assigned to the Invitation recipient. This field, if not needed, should be an empty array in your request body.,
accessType: "<ACCESS_TYPE_WEB>" // accessType field,
senderUserId: "<string> (Unique identifier for the Sender of an Invitation.)",
}]
});
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_CREATE_INVITATIONS",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"id": "<string>",
"organizationId": "<string>",
"status": "<string>",
"type": "<string>",
"intent": {
"createInvitationsIntent": {
"invitations": [
{
"receiverUserName": "<string>",
"receiverUserEmail": "<string>",
"receiverUserTags": [
"<string>"
],
"accessType": "<ACCESS_TYPE_WEB>",
"senderUserId": "<string>"
}
]
}
},
"result": {
"createInvitationsResult": {
"invitationIds": [
"<string>"
]
}
},
"votes": "<array>",
"fingerprint": "<string>",
"canApprove": "<boolean>",
"canReject": "<boolean>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}
}
Activities
Create invitations
Create invitations to join an existing organization.
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/create_invitations \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <string> (see Authorizations)" \
--data '{
"type": "ACTIVITY_TYPE_CREATE_INVITATIONS",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"invitations": [
{
"receiverUserName": "<string>",
"receiverUserEmail": "<string>",
"receiverUserTags": [
"<string>"
],
"accessType": "<ACCESS_TYPE_WEB>",
"senderUserId": "<string>"
}
]
}
}'
import { Turnkey } from "@turnkey/sdk-server";
const turnkeyClient = new Turnkey({
apiBaseUrl: "https://api.turnkey.com",
apiPublicKey: process.env.API_PUBLIC_KEY!,
apiPrivateKey: process.env.API_PRIVATE_KEY!,
defaultOrganizationId: process.env.ORGANIZATION_ID!,
});
const response = await turnkeyClient.apiClient().createInvitations({
invitations: [{ // A list of Invitations.,
receiverUserName: "<string> (The name of the intended Invitation recipient.)",
receiverUserEmail: "<string> (The email address of the intended Invitation recipient.)",
receiverUserTags: ["<string>"] // A list of tags assigned to the Invitation recipient. This field, if not needed, should be an empty array in your request body.,
accessType: "<ACCESS_TYPE_WEB>" // accessType field,
senderUserId: "<string> (Unique identifier for the Sender of an Invitation.)",
}]
});
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_CREATE_INVITATIONS",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"id": "<string>",
"organizationId": "<string>",
"status": "<string>",
"type": "<string>",
"intent": {
"createInvitationsIntent": {
"invitations": [
{
"receiverUserName": "<string>",
"receiverUserEmail": "<string>",
"receiverUserTags": [
"<string>"
],
"accessType": "<ACCESS_TYPE_WEB>",
"senderUserId": "<string>"
}
]
}
},
"result": {
"createInvitationsResult": {
"invitationIds": [
"<string>"
]
}
},
"votes": "<array>",
"fingerprint": "<string>",
"canApprove": "<boolean>",
"canReject": "<boolean>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}
}
A successful response returns the following fields:
Was this page helpful?