{
  "info": {
    "name": "Smart Interview — API partenaire",
    "description": "Les appels de l'API partenaire de Smart Interview, dans l'ordre d'une intégration.\n\n1. Dans les variables de la collection, renseignez `CLE` (votre clé d’API), lancez « Lister les\n   recruteurs », qui n’a besoin que de la clé, puis renseignez `RECRUTEUR_ID` avec l’`id` de l’un\n   d’eux.\n2. Lancez les dossiers dans l’ordre : chaque création enregistre l’identifiant que les appels\n   suivants réutilisent (`AGENT_ID`, `INTERVIEW_ID`…).\n\nAttention : les appels envoient de vrais e-mails et de vrais messages aux adresses et numéros\nque vous leur donnez. Remplacez ceux des exemples par les vôtres.\n\nDocumentation : https://docs.smart-interview.ai/integration/schedule/api",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.smart-interview.ai"
    },
    {
      "key": "CLE",
      "value": ""
    },
    {
      "key": "RECRUTEUR_ID",
      "value": ""
    },
    {
      "key": "INTERVIEW_ID",
      "value": ""
    },
    {
      "key": "QUESTIONNAIRE_ID",
      "value": ""
    },
    {
      "key": "AGENT_ID",
      "value": ""
    },
    {
      "key": "QUESTIONNAIRE_AGENT_ID",
      "value": ""
    },
    {
      "key": "CATEGORY_ID",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "1. Savoir au nom de qui agir",
      "item": [
        {
          "name": "Lister les recruteurs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/users",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "users"
              ]
            },
            "description": "List the accounts of your organization"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "2. Choisir l'agent virtuel",
      "item": [
        {
          "name": "Lister les agents virtuels",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/agents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "agents"
              ]
            },
            "description": "List virtual agents"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));",
                  "const body = pm.response.json();",
                  "pm.collectionVariables.set('AGENT_ID', body.data.find((agent) => agent.purpose === 'recruitment')?.id);",
                  "pm.collectionVariables.set('QUESTIONNAIRE_AGENT_ID', body.data.find((agent) => agent.purpose === 'questionnaire')?.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Lire un agent virtuel",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/agents/{{AGENT_ID}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "agents",
                "{{AGENT_ID}}"
              ]
            },
            "description": "Get agent by id"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));",
                  "const body = pm.response.json();",
                  "pm.collectionVariables.set('CATEGORY_ID', body.category?.id);"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "3. Créer les entretiens",
      "item": [
        {
          "name": "Créer un entretien",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/interviews",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "interviews"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"agentId\": \"{{AGENT_ID}}\",\n  \"firstname\": \"Camille\",\n  \"lastname\": \"Martin\",\n  \"candidateEmail\": \"camille.martin@example.com\",\n  \"organizationId\": \"-\",\n  \"requestedByUserId\": \"-\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Create an interview and invite the candidate\n\nSoumis à la règle [Créer sans doublon](/reference/interviews-questionnaires#create-without-duplicates) : un appel envoyé deux fois ne crée pas de second entretien."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 201', () => pm.response.to.have.status(201));",
                  "const body = pm.response.json();",
                  "pm.collectionVariables.set('INTERVIEW_ID', body.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Créer des entretiens en lot",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/interviews/batch",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "interviews",
                "batch"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"agentId\": \"{{AGENT_ID}}\",\n  \"organizationId\": \"-\",\n  \"requestedByUserId\": \"-\",\n  \"batchName\": \"Saison été 2026\",\n  \"sendEmail\": true,\n  \"candidates\": [\n    {\n      \"firstname\": \"Lucas\",\n      \"lastname\": \"Petit\",\n      \"candidateEmail\": \"lucas.petit@example.com\"\n    },\n    {\n      \"firstname\": \"Inès\",\n      \"lastname\": \"Moreau\",\n      \"candidateEmail\": \"ines.moreau@example.com\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Create multiple interviews in a batch\n\nSoumis à la règle [Créer sans doublon](/reference/interviews-questionnaires#create-without-duplicates) : un appel envoyé deux fois ne crée pas de second entretien."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 201', () => pm.response.to.have.status(201));"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "4. Suivre les entretiens",
      "item": [
        {
          "name": "Lister les entretiens",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/interviews?agentId={{AGENT_ID}}&status=pending",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "interviews"
              ],
              "query": [
                {
                  "key": "agentId",
                  "value": "{{AGENT_ID}}"
                },
                {
                  "key": "status",
                  "value": "pending"
                }
              ]
            },
            "description": "List interviews\n\nLes champs du [résultat](/integration/result/), sauf `version`, `agentTitle`, `shareLink` et `conditionInterruption` : demandez le lien avec `share-link`. `metadata`, `analysis` et `agentData` sont [hors contrat](/integration/result/#fields-outside-contract) ; `transcript` vaut `null`, sauf si votre organisation a demandé l'envoi de la transcription intégrale."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "Lire un entretien",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/interviews/by-id/{{INTERVIEW_ID}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "interviews",
                "by-id",
                "{{INTERVIEW_ID}}"
              ]
            },
            "description": "Get interview by internal ID (authenticated)\n\nLes champs du [résultat](/integration/result/), sauf `version`, `agentTitle`, `shareLink` et `conditionInterruption` : demandez le lien avec `share-link`. `metadata`, `analysis` et `agentData` sont [hors contrat](/integration/result/#fields-outside-contract) ; `transcript` vaut `null`, sauf si votre organisation a demandé l'envoi de la transcription intégrale."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "5. Relancer le candidat",
      "item": [
        {
          "name": "Renvoyer l'invitation par e-mail",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/interviews/{{INTERVIEW_ID}}/resend-email",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "interviews",
                "{{INTERVIEW_ID}}",
                "resend-email"
              ]
            },
            "description": "Resend interview invitation email to candidate"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "Renvoyer l'invitation par WhatsApp",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/interviews/{{INTERVIEW_ID}}/resend-message",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "interviews",
                "{{INTERVIEW_ID}}",
                "resend-message"
              ]
            },
            "description": "Resend interview invitation message (WhatsApp) to candidate\n\nEnvoie un vrai message WhatsApp au candidat, sur le téléphone de l’entretien : un entretien sans téléphone est refusé (`400`)."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "Redonner une chance au candidat",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/interviews/{{INTERVIEW_ID}}/retry",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "interviews",
                "{{INTERVIEW_ID}}",
                "retry"
              ]
            },
            "description": "Give candidate another chance by resetting interview to pending\n\nSeulement sur un entretien terminé : un entretien en attente est refusé (`400`)."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "6. Obtenir les liens",
      "item": [
        {
          "name": "Obtenir le lien d'invitation",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/interviews/{{INTERVIEW_ID}}/invitation-link",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "interviews",
                "{{INTERVIEW_ID}}",
                "invitation-link"
              ]
            },
            "description": "Generate the invitation link of an interview"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "Partager le compte rendu",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/interviews/{{INTERVIEW_ID}}/share-link",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "interviews",
                "{{INTERVIEW_ID}}",
                "share-link"
              ]
            },
            "description": "Generate public recap share link"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "7. Questionnaires",
      "item": [
        {
          "name": "Créer un questionnaire",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/questionnaires",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "questionnaires"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"agentId\": \"{{QUESTIONNAIRE_AGENT_ID}}\",\n  \"firstname\": \"Hugo\",\n  \"lastname\": \"Lefèvre\",\n  \"candidateEmail\": \"hugo.lefevre@example.com\",\n  \"phone\": \"+33639980101\",\n  \"mode\": \"link\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Create a questionnaire for a phone number\n\nRéservé aux organisations qui ont accès aux questionnaires : sinon, l'appel est refusé (`403`).\n\nSoumis à la règle [Créer sans doublon](/reference/interviews-questionnaires#create-without-duplicates) : un appel envoyé deux fois ne crée pas de second entretien."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 201', () => pm.response.to.have.status(201));",
                  "const body = pm.response.json();",
                  "pm.collectionVariables.set('QUESTIONNAIRE_ID', body.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Lister les questionnaires",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/questionnaires?agentId={{QUESTIONNAIRE_AGENT_ID}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "questionnaires"
              ],
              "query": [
                {
                  "key": "agentId",
                  "value": "{{QUESTIONNAIRE_AGENT_ID}}"
                }
              ]
            },
            "description": "List questionnaires, filtered by verdict and call outcome"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "Envoyer le lien d'un questionnaire",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/questionnaires/{{QUESTIONNAIRE_ID}}/link",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "questionnaires",
                "{{QUESTIONNAIRE_ID}}",
                "link"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"channel\": \"email\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Get the questionnaire link, and send it on WhatsApp or by email when a channel is given"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "Envoyer des liens en lot",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/questionnaires/bulk-send-link",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "questionnaires",
                "bulk-send-link"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"questionnaireIds\": [\n    \"{{QUESTIONNAIRE_ID}}\"\n  ],\n  \"channel\": \"email\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Send the questionnaire link to several people at once"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "Partager le résultat d'un questionnaire",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/questionnaires/{{QUESTIONNAIRE_ID}}/share-link",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "questionnaires",
                "{{QUESTIONNAIRE_ID}}",
                "share-link"
              ]
            },
            "description": "Generate public questionnaire report share link"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "Relancer un questionnaire",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{CLE}}"
              },
              {
                "key": "x-acting-user-id",
                "value": "{{RECRUTEUR_ID}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/partner/questionnaires/{{QUESTIONNAIRE_ID}}/retry",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "partner",
                "questionnaires",
                "{{QUESTIONNAIRE_ID}}",
                "retry"
              ]
            },
            "description": "Reset a completed questionnaire to pending and solicit the person again\n\nSeulement sur un questionnaire terminé : un questionnaire en attente est refusé (`400`)."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Réponse 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}
