curl --request POST \
--url https://testnet.edel-api.xyz/v2/partner/sessions \
--header 'Content-Type: application/json' \
--data '
{
"idToken": "{{googleIdToken}}",
"nonce": "{{partnerSignInNonce}}"
}
'import requests
url = "https://testnet.edel-api.xyz/v2/partner/sessions"
payload = {
"idToken": "{{googleIdToken}}",
"nonce": "{{partnerSignInNonce}}"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({idToken: '{{googleIdToken}}', nonce: '{{partnerSignInNonce}}'})
};
fetch('https://testnet.edel-api.xyz/v2/partner/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));use reqwest::blocking::Client;
use serde_json::json;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let response = Client::new()
.post("https://testnet.edel-api.xyz/v2/partner/sessions")
.json(&json!({
"idToken": "{{googleIdToken}}",
"nonce": "{{partnerSignInNonce}}"
}))
.send()?;
println!("{} {}", response.status(), response.text()?);
Ok(())
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://testnet.edel-api.xyz/v2/partner/sessions"
payload := strings.NewReader("{\n \"idToken\": \"{{googleIdToken}}\",\n \"nonce\": \"{{partnerSignInNonce}}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://testnet.edel-api.xyz/v2/partner/sessions")
.header("Content-Type", "application/json")
.body("{\n \"idToken\": \"{{googleIdToken}}\",\n \"nonce\": \"{{partnerSignInNonce}}\"\n}")
.asString();{
"token": "<string>",
"expiresAt": "<string>",
"partnerUserId": "<string>",
"email": "<string>",
"memberships": [
{
"organizationId": "<string>",
"name": "<string>",
"role": "owner",
"permissions": {
"sub_accounts": "none",
"trading_spot": "none",
"trading_perps": "none",
"listings_deposits": "none",
"members_keys": "none"
},
"canWrite": true
}
]
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "promo_code_unknown",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "spot_disabled",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused",
"info": {
"group": "sub_accounts",
"level": "read"
}
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "promo_code_unknown",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "spot_disabled",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused",
"info": {
"group": "sub_accounts",
"level": "read"
}
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "promo_code_unknown",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "spot_disabled",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused",
"info": {
"group": "sub_accounts",
"level": "read"
}
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "promo_code_unknown",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "spot_disabled",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused",
"info": {
"group": "sub_accounts",
"level": "read"
}
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "promo_code_unknown",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "spot_disabled",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused",
"info": {
"group": "sub_accounts",
"level": "read"
}
}
}Exchange a verified partner identity for a partner session
For the partner app’s server only. Send the Google ID token of the partner sign in screen and that screen’s RAW nonce as the JSON body , with no bearer; the screen gives Google base64url(SHA-256(raw nonce)) (no padding) and keeps the raw value server side. The API verifies the token (Google’s signature and issuer, the partner web client id as audience, not expired, at least one minute left, its nonce claim equal to base64url(SHA-256) of the nonce sent, a verified email, and the Google subject this partner user was first seen with), signs the invited person in (a first sign in accepts the open invitations) and answers 201 with an opaque token (edel_ps_…), its end, the partner user id, the lower case email (for display) and the memberships with role and write permission. Only the token’s SHA-256 is stored; the token is in this answer only. Only where the API has the partner Cloudflare Access variables, a request with no body may instead send the partner host’s Access assertion in the Cf-Access-Jwt-Assertion header (a service token is never a person). The session ends one hour after its last accepted use and never later than twelve hours after this exchange; each accepted request with the token moves the end. Send the token as Authorization: Bearer on the organization routes (/v2/organizations/{organizationId}…), where the organization is the person’s membership of the organization in the path, read on every request: another organization answers 404 organization_not_found, a member without write permission 403 organization_permission_required, and a malformed, expired or revoked token 401 partner_session_invalid, partner_session_expired or partner_session_revoked (503 partner_session_store_unavailable while sessions cannot be read), in the partner session error shape of this route; each partner user can send at most 120 requests a minute there. Each identity token is single use, keyed on its signed claims: exchanging the same token again (in any spelling; a token that is not canonical unpadded base64url is refused), or a second exchange racing the first, answers 401 partner_identity_invalid and writes nothing; the first token keeps working. A body that is not answers 400 invalid_request; a token that fails any check answers 401 partner_identity_invalid (the Access path: partner_access_assertion_invalid); an address with no partner user and no open invitation, or a partner user with no active membership left, answers 403 partner_not_invited and writes nothing; at most 20 exchanges per verified identity in 10 minutes (429 with Retry-After); 503 partner_identity_unavailable while Google sign in is not configured on the API or Google’s keys cannot be read (the Access path: partner_access_unavailable). While the partner dashboard feature is off the route answers 403 feature_disabled with featureFlag partner_dashboard.
Method and path: POST /v2/partner/sessions
Authentication: none.
Request schema: PartnerSessionCreateRequest.
Response schema: PartnerSessionCreated.
Error envelope: PartnerSessionErrorResponse (contains ExternalRestError external-rest-error/v1 as info).
curl --request POST \
--url https://testnet.edel-api.xyz/v2/partner/sessions \
--header 'Content-Type: application/json' \
--data '
{
"idToken": "{{googleIdToken}}",
"nonce": "{{partnerSignInNonce}}"
}
'import requests
url = "https://testnet.edel-api.xyz/v2/partner/sessions"
payload = {
"idToken": "{{googleIdToken}}",
"nonce": "{{partnerSignInNonce}}"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({idToken: '{{googleIdToken}}', nonce: '{{partnerSignInNonce}}'})
};
fetch('https://testnet.edel-api.xyz/v2/partner/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));use reqwest::blocking::Client;
use serde_json::json;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let response = Client::new()
.post("https://testnet.edel-api.xyz/v2/partner/sessions")
.json(&json!({
"idToken": "{{googleIdToken}}",
"nonce": "{{partnerSignInNonce}}"
}))
.send()?;
println!("{} {}", response.status(), response.text()?);
Ok(())
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://testnet.edel-api.xyz/v2/partner/sessions"
payload := strings.NewReader("{\n \"idToken\": \"{{googleIdToken}}\",\n \"nonce\": \"{{partnerSignInNonce}}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://testnet.edel-api.xyz/v2/partner/sessions")
.header("Content-Type", "application/json")
.body("{\n \"idToken\": \"{{googleIdToken}}\",\n \"nonce\": \"{{partnerSignInNonce}}\"\n}")
.asString();{
"token": "<string>",
"expiresAt": "<string>",
"partnerUserId": "<string>",
"email": "<string>",
"memberships": [
{
"organizationId": "<string>",
"name": "<string>",
"role": "owner",
"permissions": {
"sub_accounts": "none",
"trading_spot": "none",
"trading_perps": "none",
"listings_deposits": "none",
"members_keys": "none"
},
"canWrite": true
}
]
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "promo_code_unknown",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "spot_disabled",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused",
"info": {
"group": "sub_accounts",
"level": "read"
}
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "promo_code_unknown",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "spot_disabled",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused",
"info": {
"group": "sub_accounts",
"level": "read"
}
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "promo_code_unknown",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "spot_disabled",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused",
"info": {
"group": "sub_accounts",
"level": "read"
}
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "promo_code_unknown",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "spot_disabled",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused",
"info": {
"group": "sub_accounts",
"level": "read"
}
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "promo_code_unknown",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "spot_disabled",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused",
"info": {
"group": "sub_accounts",
"level": "read"
}
}
}