Aller au contenu

Environnement de développement : contenu en cours de rédaction, rien ne pointe vers la production.

Sommaire de la documentation

roles

Version 0.1.08 opérations

Predefined and custom roles with their permissions

GET/organisations/{id}/rolesSession du tableau de bord

Paramètres

  • idstringpathobligatoire

Réponses

  • 200

    • idstring (uuid)obligatoire
    • keystring | nullobligatoire

      Predefined role key, null for custom

    • namestringobligatoire
    • descriptionstring | nullobligatoire
    • predefinedbooleanobligatoire
    • permissionsstring[]obligatoire
    • memberCountnumberobligatoire

      Members of this organisation holding the role

Exemples de code

curl -X GET "$KONNECT_API_URL/organisations/id/roles" \
  -H "Cookie: konnect_session=$KONNECT_SESSION"

Exemple : 200

[
  {
    "id": "id",
    "key": "key",
    "name": "name",
    "description": "description",
    "predefined": true,
    "permissions": [
      "payments.view"
    ],
    "memberCount": 1
  }
]

Create a custom role, or duplicate one with basedOnRoleId

POST/organisations/{id}/rolesSession du tableau de bord

Paramètres

  • idstringpathobligatoire

Corps de la requête application/json

  • namestringobligatoire
  • descriptionstring
  • permissionsstring[]

    Required unless basedOnRoleId is given

  • basedOnRoleIdstring (uuid)

    Duplicate the permissions of this role

Réponses

  • 201

    • idstring (uuid)obligatoire
    • keystring | nullobligatoire

      Predefined role key, null for custom

    • namestringobligatoire
    • descriptionstring | nullobligatoire
    • predefinedbooleanobligatoire
    • permissionsstring[]obligatoire
    • memberCountnumberobligatoire

      Members of this organisation holding the role

Exemples de code

curl -X POST "$KONNECT_API_URL/organisations/id/roles" \
  -H "Cookie: konnect_session=$KONNECT_SESSION" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Statistics only",
  "description": "description",
  "permissions": [
    "payments.view"
  ],
  "basedOnRoleId": "basedOnRoleId"
}'

Exemple : corps de la requête

{
  "name": "Statistics only",
  "description": "description",
  "permissions": [
    "payments.view"
  ],
  "basedOnRoleId": "basedOnRoleId"
}

Exemple : 201

{
  "id": "id",
  "key": "key",
  "name": "name",
  "description": "description",
  "predefined": true,
  "permissions": [
    "payments.view"
  ],
  "memberCount": 1
}

Edit a custom role (predefined roles are fixed)

PATCH/organisations/{id}/roles/{roleId}Session du tableau de bord

Paramètres

  • idstringpathobligatoire
  • roleIdstringpathobligatoire

Corps de la requête application/json

  • namestring
  • descriptionstring
  • permissionsstring[]

Réponses

  • 200

    • idstring (uuid)obligatoire
    • keystring | nullobligatoire

      Predefined role key, null for custom

    • namestringobligatoire
    • descriptionstring | nullobligatoire
    • predefinedbooleanobligatoire
    • permissionsstring[]obligatoire
    • memberCountnumberobligatoire

      Members of this organisation holding the role

Exemples de code

curl -X PATCH "$KONNECT_API_URL/organisations/id/roles/roleId" \
  -H "Cookie: konnect_session=$KONNECT_SESSION" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "name",
  "description": "description",
  "permissions": [
    "payments.view"
  ]
}'

Exemple : corps de la requête

{
  "name": "name",
  "description": "description",
  "permissions": [
    "payments.view"
  ]
}

Exemple : 200

{
  "id": "id",
  "key": "key",
  "name": "name",
  "description": "description",
  "predefined": true,
  "permissions": [
    "payments.view"
  ],
  "memberCount": 1
}

Delete a custom role that no member or pending invitation uses

DELETE/organisations/{id}/roles/{roleId}Session du tableau de bord

Paramètres

  • idstringpathobligatoire
  • roleIdstringpathobligatoire

Réponses

  • 204

Exemples de code

curl -X DELETE "$KONNECT_API_URL/organisations/id/roles/roleId" \
  -H "Cookie: konnect_session=$KONNECT_SESSION"

The pending ownership transfer, if any

GET/organisations/{id}/ownership-transferSession du tableau de bord

Paramètres

  • idstringpathobligatoire

Réponses

  • 200

    • idstring (uuid)obligatoire
    • organisationIdstring (uuid)obligatoire
    • fromUserIdstring (uuid)obligatoire
    • toUserIdstring (uuid)obligatoire
    • statusstringobligatoire
      • enum: "pending", "accepted", "cancelled"
    • expiresAtstring (date-time)obligatoire
    • decidedAtstring (date-time) | nullobligatoire
    • createdAtstring (date-time)obligatoire

Exemples de code

curl -X GET "$KONNECT_API_URL/organisations/id/ownership-transfer" \
  -H "Cookie: konnect_session=$KONNECT_SESSION"

Exemple : 200

{
  "id": "id",
  "organisationId": "org_01J9Z3K4EXAMPLE0000000000",
  "fromUserId": "fromUserId",
  "toUserId": "toUserId",
  "status": "pending",
  "expiresAt": "2026-10-01T09:30:00.000Z",
  "decidedAt": "2026-10-01T09:30:00.000Z",
  "createdAt": "2026-10-01T09:30:00.000Z"
}

Owner only: offer ownership to a member (requires re-authentication)

POST/organisations/{id}/ownership-transferSession du tableau de bord

Paramètres

  • idstringpathobligatoire

Corps de la requête application/json

  • toUserIdstring (uuid)obligatoire

    A current member of the organisation

Réponses

  • 201

    • idstring (uuid)obligatoire
    • organisationIdstring (uuid)obligatoire
    • fromUserIdstring (uuid)obligatoire
    • toUserIdstring (uuid)obligatoire
    • statusstringobligatoire
      • enum: "pending", "accepted", "cancelled"
    • expiresAtstring (date-time)obligatoire
    • decidedAtstring (date-time) | nullobligatoire
    • createdAtstring (date-time)obligatoire

Exemples de code

curl -X POST "$KONNECT_API_URL/organisations/id/ownership-transfer" \
  -H "Cookie: konnect_session=$KONNECT_SESSION" \
  -H "Content-Type: application/json" \
  -d '{
  "toUserId": "toUserId"
}'

Exemple : corps de la requête

{
  "toUserId": "toUserId"
}

Exemple : 201

{
  "id": "id",
  "organisationId": "org_01J9Z3K4EXAMPLE0000000000",
  "fromUserId": "fromUserId",
  "toUserId": "toUserId",
  "status": "pending",
  "expiresAt": "2026-10-01T09:30:00.000Z",
  "decidedAt": "2026-10-01T09:30:00.000Z",
  "createdAt": "2026-10-01T09:30:00.000Z"
}

The new owner accepts; the former owner becomes Administrator

POST/organisations/{id}/ownership-transfer/{transferId}/acceptSession du tableau de bord

Paramètres

  • idstringpathobligatoire
  • transferIdstringpathobligatoire

Réponses

  • 200

    • idstring (uuid)obligatoire
    • organisationIdstring (uuid)obligatoire
    • fromUserIdstring (uuid)obligatoire
    • toUserIdstring (uuid)obligatoire
    • statusstringobligatoire
      • enum: "pending", "accepted", "cancelled"
    • expiresAtstring (date-time)obligatoire
    • decidedAtstring (date-time) | nullobligatoire
    • createdAtstring (date-time)obligatoire

Exemples de code

curl -X POST "$KONNECT_API_URL/organisations/id/ownership-transfer/transferId/accept" \
  -H "Cookie: konnect_session=$KONNECT_SESSION"

Exemple : 200

{
  "id": "id",
  "organisationId": "org_01J9Z3K4EXAMPLE0000000000",
  "fromUserId": "fromUserId",
  "toUserId": "toUserId",
  "status": "pending",
  "expiresAt": "2026-10-01T09:30:00.000Z",
  "decidedAt": "2026-10-01T09:30:00.000Z",
  "createdAt": "2026-10-01T09:30:00.000Z"
}

The owner withdraws, or the recipient declines, a pending transfer

DELETE/organisations/{id}/ownership-transfer/{transferId}Session du tableau de bord

Paramètres

  • idstringpathobligatoire
  • transferIdstringpathobligatoire

Réponses

  • 200

    • idstring (uuid)obligatoire
    • organisationIdstring (uuid)obligatoire
    • fromUserIdstring (uuid)obligatoire
    • toUserIdstring (uuid)obligatoire
    • statusstringobligatoire
      • enum: "pending", "accepted", "cancelled"
    • expiresAtstring (date-time)obligatoire
    • decidedAtstring (date-time) | nullobligatoire
    • createdAtstring (date-time)obligatoire

Exemples de code

curl -X DELETE "$KONNECT_API_URL/organisations/id/ownership-transfer/transferId" \
  -H "Cookie: konnect_session=$KONNECT_SESSION"

Exemple : 200

{
  "id": "id",
  "organisationId": "org_01J9Z3K4EXAMPLE0000000000",
  "fromUserId": "fromUserId",
  "toUserId": "toUserId",
  "status": "pending",
  "expiresAt": "2026-10-01T09:30:00.000Z",
  "decidedAt": "2026-10-01T09:30:00.000Z",
  "createdAt": "2026-10-01T09:30:00.000Z"
}