POST /company/{uid}/position

Crée un nouveau poste (position) pour un utilisateur dans l'entreprise.

Concept de Position:

  • Un poste représente le lien entre un utilisateur et une entreprise
  • Chaque poste définit un type (admin, collaborateur, etc.) et des droits spécifiques
  • Un utilisateur peut avoir des postes dans plusieurs entreprises

Champs requis:

  • user : Identifiant de l'utilisateur à ajouter
  • type : Type de poste (référence vers un Type de droits)

Événement déclenché: CREATE_POSITION

Path parameters

  • uid string Required

    Identifiant unique de l'entreprise

application/json

Body Required

  • user string Required

    Identifiant de l'utilisateur

  • type string Required

    Type de poste (ID du Type de droits)

  • rights array[object]

    Liste des droits spécifiques

    Hide rights attributes Show rights attributes object
    • name string

      Nom du droit

    • group string

      Groupe du droit

    • checked boolean

      Droit activé ou non

Responses

  • 201 application/json

    Poste créé avec succès

    Hide response attributes Show response attributes object
    • _id string

      Unique identifier for the position

    • company string

      ID of the company

    • user string

      ID of the user

    • userEmail string(email)

      Email of the user

    • first_name string

      First name

    • last_name string

      Last name

    • avatar string

      URL to avatar

    • state string

      State of the position

      Values are active or inactive.

    • type string

      Type of the position

    • rights array[object]

      List of rights

      Hide rights attributes Show rights attributes object
      • checked boolean

        Whether the right is checked

      • group string

        Group of the right

      • name string

        Name of the right

    • teams array[object]

      List of teams

      Hide teams attributes Show teams attributes object
      • team string

        ID of the team

      • rightType string

        Type of rights

      • default boolean

        Whether this is the default team

    • entry_date string(date-time)

      Date of entry

    • release_date string(date-time)

      Date of release

    • createdAt string(date-time)

      Date when position was created

    • updatedAt string(date-time)

      Date when position was last updated

  • 400

    Requête invalide - Données manquantes ou incorrectes

  • 403

    Non autorisé - Droits insuffisants pour ajouter un poste

  • 404

    Entreprise non trouvée

POST /company/{uid}/position
curl \
 --request POST 'https://wuro.pro/api/v3.2/company/{uid}/position' \
 --header "X-APP-ID: $API_KEY" \
 --header "X-APP-SECRET: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"user":"string","type":"string","rights":[{"name":"string","group":"string","checked":true}]}'
Request examples
{
  "user": "string",
  "type": "string",
  "rights": [
    {
      "name": "string",
      "group": "string",
      "checked": true
    }
  ]
}
Response examples (201)
{
  "_id": "string",
  "company": "string",
  "user": "string",
  "userEmail": "hello@example.com",
  "first_name": "string",
  "last_name": "string",
  "avatar": "string",
  "state": "active",
  "type": "string",
  "rights": [
    {
      "checked": true,
      "group": "string",
      "name": "string"
    }
  ],
  "teams": [
    {
      "team": "string",
      "rightType": "string",
      "default": true
    }
  ],
  "entry_date": "2025-05-04T09:42:00Z",
  "release_date": "2025-05-04T09:42:00Z",
  "createdAt": "2025-05-04T09:42:00Z",
  "updatedAt": "2025-05-04T09:42:00Z"
}