Switch organization

Switch the context to a different organization for the authenticated user. This endpoint allows users to change their active organization, affecting subsequent API requests and operations within the new organizational context.

POST
/organizations/switch
AuthorizationBearer <token>

In: header

Request Body

application/json

The organization switch request payload containing the target organization ID.

TypeScript Definitions

Use the request body type in TypeScript.

id*string

Unique identifier of the organization to switch to

Response Body

application/json

application/json

application/json

curl -X POST "https://api-testnet.dual.network/organizations/switch" \  -H "Content-Type: application/json" \  -d '{    "id": "string"  }'
{
  "access_token": "string",
  "organization": {
    "id": "string",
    "fqdn": "string",
    "name": "string",
    "image": {
      "id": "string",
      "name": "string",
      "type": "string",
      "url": "string",
      "hash": "string",
      "is_public": true,
      "when_created": "2019-08-24T14:15:22Z"
    },
    "members": [
      {
        "id": "string",
        "wallet_id": "string",
        "email": "string",
        "invite_status": "pending",
        "role_name": "string",
        "when_created": "2019-08-24T14:15:22Z",
        "when_modified": "2019-08-24T14:15:22Z"
      }
    ],
    "roles": [
      {
        "id": "string",
        "name": "string",
        "description": "string",
        "permissions": [
          {
            "resource": "api-keys",
            "crud": {
              "read": true,
              "create": true,
              "update": true,
              "delete": true
            }
          }
        ],
        "when_created": "2019-08-24T14:15:22Z",
        "when_modified": "2019-08-24T14:15:22Z"
      }
    ],
    "description": "string",
    "account": {
      "address": "string",
      "public_key": "string",
      "type": "ED25519"
    },
    "when_created": "2019-08-24T14:15:22Z",
    "when_modified": "2019-08-24T14:15:22Z"
  }
}
{
  "code": 0,
  "message": "string",
  "details": {}
}
{
  "code": 0,
  "message": "string",
  "details": {}
}