curl --request POST \
--url https://api.turnkey.com/public/v1/submit/create_session_profile \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <string> (see Authorizations)" \
--data '{
"type": "ACTIVITY_TYPE_CREATE_SESSION_PROFILE",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"sessionProfileName": "<string>",
"scope": "<string>",
"expirationSeconds": "<string>",
"notes": "<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().createSessionProfile({
sessionProfileName: "<string> (Human-readable name for a Session Profile.)",
scope: "<string> (The scope string that defines the permissions for this Session Profile.)",
expirationSeconds: "<string> (The duration in seconds for which sessions created with this Session Profile are valid. If not set, expiration will be determined by the value passed in to the intent of login activities.)",
notes: "<string> (Notes for a Session Profile.)"
});
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_CREATE_SESSION_PROFILE",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"id": "<string>",
"organizationId": "<string>",
"status": "<string>",
"type": "<string>",
"intent": {
"createSessionProfileIntent": {
"sessionProfileName": "<string>",
"scope": "<string>",
"expirationSeconds": "<string>",
"notes": "<string>"
}
},
"result": {
"createSessionProfileResult": {
"sessionProfileId": "<string>"
}
},
"votes": "<array>",
"fingerprint": "<string>",
"canApprove": "<boolean>",
"canReject": "<boolean>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}
}
Activities
Create session profile
Create a new session profile for an organization.
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/create_session_profile \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <string> (see Authorizations)" \
--data '{
"type": "ACTIVITY_TYPE_CREATE_SESSION_PROFILE",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"sessionProfileName": "<string>",
"scope": "<string>",
"expirationSeconds": "<string>",
"notes": "<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().createSessionProfile({
sessionProfileName: "<string> (Human-readable name for a Session Profile.)",
scope: "<string> (The scope string that defines the permissions for this Session Profile.)",
expirationSeconds: "<string> (The duration in seconds for which sessions created with this Session Profile are valid. If not set, expiration will be determined by the value passed in to the intent of login activities.)",
notes: "<string> (Notes for a Session Profile.)"
});
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_CREATE_SESSION_PROFILE",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"id": "<string>",
"organizationId": "<string>",
"status": "<string>",
"type": "<string>",
"intent": {
"createSessionProfileIntent": {
"sessionProfileName": "<string>",
"scope": "<string>",
"expirationSeconds": "<string>",
"notes": "<string>"
}
},
"result": {
"createSessionProfileResult": {
"sessionProfileId": "<string>"
}
},
"votes": "<array>",
"fingerprint": "<string>",
"canApprove": "<boolean>",
"canReject": "<boolean>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}
}
A successful response returns the following fields:
Was this page helpful?