Passer au contenu principal

Référence de l’API

Lisez et modifiez les données de votre espace de travail depuis vos propres outils : entreprises, contacts, conversations, tâches, projets, factures et plus. L’API échange du JSON en HTTPS, et chaque requête porte un jeton d’API personnel.

Description lisible par machine (OpenAPI 3.1) : OpenAPI JSON

La même description est servie à https://<votre adresse>/api/v1/openapi.json.

Adresse de base

Envoyez les requêtes à l’adresse de votre organisation, par exemple https://your-team.unifydesk.app/api/v1. Chaque jeton appartient à un espace de travail, et chaque requête lit et modifie cet espace seulement.

Authentification

Envoyez le jeton dans l’en-tête Authorization : Authorization: Bearer udk_... Un jeton absent, expiré ou révoqué renvoie 401.

Créer un jeton

Dans UnifyDesk, ouvrez Paramètres > Accès et API. Les propriétaires et administrateurs de l’organisation, ainsi que les gestionnaires de l’espace de travail, y créent les jetons. Créer ou révoquer un jeton demande une vérification en deux étapes de moins de deux heures.

Choisissez les modules et ce que le jeton peut y faire (consulter, créer, modifier, supprimer). Un jeton n’obtient jamais plus que ce que son créateur peut faire. Les taux de facturation des contrats demandent aussi la permission des taux de facturation.

Un jeton expire après 90 jours par défaut, et après 365 jours au plus. Il n’est affiché qu’une fois : conservez-le dans un gestionnaire de secrets. Révoquez-le depuis la même page dès qu’il ne sert plus.

Limites de débit

Chaque jeton peut faire 60 requêtes par minute sauf réglage contraire, et chaque réseau 600. Au-delà, l’API répond 429 avec Retry-After: 60.

Pagination et tri

Les listes renvoient { data, limit, offset, nextCursor }. Utilisez limit (1 à 100, 50 par défaut) et offset (jusqu’à 1000). Au-delà, passez le nextCursor de la page précédente comme cursor jusqu’à ce qu’il soit null. Triez avec order=<champ>.asc ou order=<champ>.desc, et filtrez avec les champs indiqués pour chaque ressource.

Modifications et suppressions

POST et PATCH reçoivent un objet JSON avec seulement les champs que vous fixez ; un champ inconnu renvoie 400. Ajoutez l’en-tête Idempotency-Key (255 caractères au plus) à un POST pour qu’une nouvelle tentative renvoie le premier résultat au lieu de créer deux fois.

Pour les enregistrements qui vont à la corbeille, DELETE demande If-Match: "<updated_at>" tiré de votre dernier GET. Un enregistrement modifié depuis renvoie 412.

Erreurs

Les erreurs renvoient un corps JSON { "error": "..." } avec le statut HTTP : 400 requête invalide, 401 jeton refusé, 403 non autorisé (ou abonnement en lecture seule), 404 introuvable, 409 conflit, 412 version périmée, 428 If-Match ou Idempotency-Key manquant, 429 trop de requêtes.

Remboursements

Enregistrer un remboursement hors ligne demande une personne connectée avec une connexion en deux étapes récente : ce n’est donc pas possible par l’API. Les remboursements restent consultables, et leur motif modifiable.

Ressources

Chaque ressource accepte les méthodes indiquées. La colonne Modifiable indique les méthodes qui acceptent chaque champ. Remplacez l’adresse d’exemple et les identifiants entre chevrons par les vôtres.

activity

  • GET /activity
  • GET /activity/{id}

Filtres : event_type, actor_id, entity_type, entity_id

ChampTypeModifiable
idstring (uuid)
event_typestring
actor_idstring (uuid)
entity_typestring
entity_idstring (uuid)
created_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/activity?limit=20"

assets

  • GET /assets
  • POST /assets
  • GET /assets/{id}
  • PATCH /assets/{id}
  • DELETE /assets/{id}

Filtres : asset_type_id, assigned_user_id, company_id, status

ChampTypeModifiable
idstring (uuid)
namestringPOST, PATCH
asset_type_idstring (uuid)POST, PATCH
serial_numberstringPOST, PATCH
manufacturerstringPOST, PATCH
modelstringPOST, PATCH
statusstringPOST, PATCH
company_idstring (uuid)POST, PATCH
contact_idstring (uuid)POST, PATCH
assigned_user_idstring (uuid)POST, PATCH
locationstringPOST, PATCH
purchased_atstring (date)POST, PATCH
warranty_untilstring (date)POST, PATCH
notesstringPOST, PATCH
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/assets?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Example"}' "https://your-team.unifydesk.app/api/v1/assets"

companies

  • GET /companies
  • POST /companies
  • GET /companies/{id}
  • PATCH /companies/{id}
  • DELETE /companies/{id}

Filtres : industry

ChampTypeModifiable
idstring (uuid)
namestringPOST, PATCH
domainstringPOST, PATCH
phonestringPOST, PATCH
addressstringPOST, PATCH
industrystringPOST, PATCH
notesstringPOST, PATCH
is_vendorboolean
employee_countnumber
last_interaction_atstring (date-time)
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/companies?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Example"}' "https://your-team.unifydesk.app/api/v1/companies"

contacts

  • GET /contacts
  • POST /contacts
  • GET /contacts/{id}
  • PATCH /contacts/{id}
  • DELETE /contacts/{id}

Filtres : company_id

ChampTypeModifiable
idstring (uuid)
company_idstring (uuid)POST, PATCH
first_namestringPOST, PATCH
last_namestringPOST, PATCH
emailstringPOST, PATCH
phonestringPOST, PATCH
titlestringPOST, PATCH
notesstringPOST, PATCH
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/contacts?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"first_name":"Example","last_name":"Example"}' "https://your-team.unifydesk.app/api/v1/contacts"

contracts

  • GET /contracts
  • POST /contracts
  • GET /contracts/{id}
  • PATCH /contracts/{id}
  • DELETE /contracts/{id}

Filtres : status, company_id, contact_id

ChampTypeModifiable
idstring (uuid)
company_idstring (uuid)POST, PATCH
contact_idstring (uuid)POST, PATCH
contract_numberstring
titlestringPOST, PATCH
statusstring
amountnumberPOST, PATCH
currencystringPOST, PATCH
billing_cyclestringPOST, PATCH
start_datestring (date)POST, PATCH
end_datestring (date)POST, PATCH
start_atstring (date-time)POST, PATCH
end_atstring (date-time)POST, PATCH
is_all_daybooleanPOST, PATCH
renewal_datestring (date)POST, PATCH
descriptionstringPOST, PATCH
rate_per_wordnumberPOST, PATCH
is_defaultboolean
source_quote_idstring (uuid)
signed_by_namestring
signed_atstring (date-time)
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/contracts?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"Example","currency":"USD"}' "https://your-team.unifydesk.app/api/v1/contracts"

conversations

  • GET /conversations
  • POST /conversations
  • GET /conversations/{id}
  • PATCH /conversations/{id}
  • DELETE /conversations/{id}

Filtres : status, priority, assignee_id, company_id, contact_id, project_id, contract_id

ChampTypeModifiable
idstring (uuid)
mailbox_idstring (uuid)POST, PATCH
company_idstring (uuid)POST, PATCH
contact_idstring (uuid)POST, PATCH
project_idstring (uuid)POST, PATCH
contract_idstring (uuid)POST, PATCH
category_idstring (uuid)POST, PATCH
subjectstringPOST, PATCH
statusstringPOST, PATCH
prioritystringPOST, PATCH
assignee_idstring (uuid)POST, PATCH
team_idstring (uuid)POST, PATCH
ticket_numberstring
channelstringPOST, PATCH
first_response_atstring (date-time)
closed_atstring (date-time)
created_atstring (date-time)
updated_atstring (date-time)
resolution_category_idstring (uuid)POST, PATCH
resolution_notestringPOST, PATCH
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/conversations?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"subject":"Example"}' "https://your-team.unifydesk.app/api/v1/conversations"

credit_notes

  • GET /credit_notes
  • POST /credit_notes
  • GET /credit_notes/{id}
  • PATCH /credit_notes/{id}
  • DELETE /credit_notes/{id}

Filtres : status, invoice_id

ChampTypeModifiable
idstring (uuid)
credit_numberstring
invoice_idstring (uuid)POST, PATCH
company_idstring (uuid)
contact_idstring (uuid)
amountnumberPOST, PATCH
currencystringPOST, PATCH
statusstring
reasonstringPOST, PATCH
issue_datestring (date)
applied_atstring (date-time)
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/credit_notes?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"invoice_id":"<invoice id>"}' "https://your-team.unifydesk.app/api/v1/credit_notes"

documents

  • GET /documents
  • GET /documents/{id}
  • PATCH /documents/{id}
  • DELETE /documents/{id}

Filtres : folder, company_id, contact_id, project_id

ChampTypeModifiable
idstring (uuid)
company_idstring (uuid)PATCH
contact_idstring (uuid)PATCH
conversation_idstring (uuid)PATCH
project_idstring (uuid)PATCH
contract_idstring (uuid)PATCH
invoice_idstring (uuid)PATCH
task_idstring (uuid)PATCH
namestringPATCH
descriptionstringPATCH
file_typestring
mime_typestring
size_bytesnumber
folderstringPATCH
versionnumber
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/documents?limit=20"

expenses

  • GET /expenses
  • POST /expenses
  • GET /expenses/{id}
  • PATCH /expenses/{id}
  • DELETE /expenses/{id}

Filtres : status, category, company_id, project_id

ChampTypeModifiable
idstring (uuid)
submitted_bystring
approved_bystring
company_idstring (uuid)POST, PATCH
project_idstring (uuid)POST, PATCH
contract_idstring (uuid)POST, PATCH
conversation_idstring (uuid)POST, PATCH
invoice_idstring (uuid)
categorystringPOST, PATCH
descriptionstringPOST, PATCH
amountnumberPOST, PATCH
currencystringPOST, PATCH
expense_datestring (date)POST, PATCH
statusstring
rejection_reasonstring
approved_atstring (date-time)
reimbursed_atstring (date-time)
billablebooleanPOST, PATCH
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/expenses?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"description":"Example","amount":1}' "https://your-team.unifydesk.app/api/v1/expenses"

invoices

  • GET /invoices
  • POST /invoices
  • GET /invoices/{id}
  • PATCH /invoices/{id}
  • DELETE /invoices/{id}

Filtres : status, company_id, contact_id, contract_id

ChampTypeModifiable
idstring (uuid)
company_idstring (uuid)POST, PATCH
contact_idstring (uuid)POST, PATCH
contract_idstring (uuid)POST, PATCH
project_idstring (uuid)POST, PATCH
conversation_idstring (uuid)POST, PATCH
invoice_numberstring
amountnumberPOST, PATCH
currencystringPOST, PATCH
statusstring
issue_datestring (date)POST, PATCH
due_datestring (date)POST, PATCH
paid_datestring (date)
sent_atstring (date-time)
delivered_atstring (date-time)
delivery_methodstring
payment_termsstring
memostring
customer_po_numberstringPOST, PATCH
is_recurringboolean
recurring_frequencystring
recurring_next_atstring (date)
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/invoices?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"currency":"USD"}' "https://your-team.unifydesk.app/api/v1/invoices"

opportunities

  • GET /opportunities
  • POST /opportunities
  • GET /opportunities/{id}
  • PATCH /opportunities/{id}
  • DELETE /opportunities/{id}

Filtres : stage_id, company_id, contact_id, owner_id

ChampTypeModifiable
idstring (uuid)
stage_idstring (uuid)POST, PATCH
company_idstring (uuid)POST, PATCH
contact_idstring (uuid)POST, PATCH
owner_idstring (uuid)POST, PATCH
namestringPOST, PATCH
descriptionstringPOST, PATCH
amountnumberPOST, PATCH
currencystringPOST, PATCH
expected_close_datestring (date)POST, PATCH
closed_atstring (date-time)
probability_snapshotnumber
sourcestringPOST, PATCH
lost_reason_idstring (uuid)POST, PATCH
lost_reason_notestringPOST, PATCH
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/opportunities?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Example"}' "https://your-team.unifydesk.app/api/v1/opportunities"

pipeline

  • GET /pipeline
  • POST /pipeline
  • GET /pipeline/{id}
  • PATCH /pipeline/{id}
  • DELETE /pipeline/{id}

Filtres : stage_id, company_id, contact_id, owner_id

ChampTypeModifiable
idstring (uuid)
stage_idstring (uuid)POST, PATCH
company_idstring (uuid)POST, PATCH
contact_idstring (uuid)POST, PATCH
owner_idstring (uuid)POST, PATCH
namestringPOST, PATCH
descriptionstringPOST, PATCH
amountnumberPOST, PATCH
currencystringPOST, PATCH
expected_close_datestring (date)POST, PATCH
closed_atstring (date-time)
probability_snapshotnumber
sourcestringPOST, PATCH
lost_reason_idstring (uuid)POST, PATCH
lost_reason_notestringPOST, PATCH
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/pipeline?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Example"}' "https://your-team.unifydesk.app/api/v1/pipeline"

projects

  • GET /projects
  • POST /projects
  • GET /projects/{id}
  • PATCH /projects/{id}
  • DELETE /projects/{id}

Filtres : status, company_id, owner_id, contact_id, health_status

ChampTypeModifiable
idstring (uuid)
company_idstring (uuid)POST, PATCH
contact_idstring (uuid)POST, PATCH
project_type_idstring (uuid)
stage_idstring (uuid)
namestringPOST, PATCH
descriptionstringPOST, PATCH
statusstringPOST, PATCH
start_datestring (date)POST, PATCH
end_datestring (date)POST, PATCH
start_atstring (date-time)POST, PATCH
end_atstring (date-time)POST, PATCH
is_all_daybooleanPOST, PATCH
owner_idstring (uuid)POST, PATCH
budget_amountnumberPOST, PATCH
budget_currencystringPOST, PATCH
budget_typestringPOST, PATCH
budget_alert_threshold_pctnumberPOST, PATCH
health_statusstringPOST, PATCH
source_word_countnumberPOST, PATCH
target_word_countnumberPOST, PATCH
word_count_updated_atstring (date-time)
memsource_project_uidstringPOST, PATCH
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/projects?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Example"}' "https://your-team.unifydesk.app/api/v1/projects"

purchase_orders

  • GET /purchase_orders
  • GET /purchase_orders/{id}
  • PATCH /purchase_orders/{id}
  • DELETE /purchase_orders/{id}

Filtres : status, vendor_id, project_id

ChampTypeModifiable
idstring (uuid)
po_numberstring
vendor_idstring (uuid)PATCH
contact_idstring (uuid)PATCH
project_idstring (uuid)PATCH
contract_idstring (uuid)PATCH
statusstring
total_amountnumber
currencystringPATCH
order_datestring (date)PATCH
expected_datestring (date)PATCH
received_datestring (date)
notesstringPATCH
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/purchase_orders?limit=20"

quotes

  • GET /quotes
  • POST /quotes
  • GET /quotes/{id}
  • PATCH /quotes/{id}
  • DELETE /quotes/{id}

Filtres : status, company_id, contact_id, opportunity_id

ChampTypeModifiable
idstring (uuid)
company_idstring (uuid)POST, PATCH
contact_idstring (uuid)POST, PATCH
opportunity_idstring (uuid)POST, PATCH
quote_numberstring
titlestringPOST, PATCH
statusstring
amountnumber
currencystringPOST, PATCH
valid_untilstring (date)POST, PATCH
line_itemsjsonPOST, PATCH
termsstring
notesstringPOST, PATCH
sent_atstring (date-time)
accepted_atstring (date-time)
accepted_by_namestring
declined_atstring (date-time)
invoice_idstring (uuid)
project_idstring (uuid)POST, PATCH
contract_idstring (uuid)POST, PATCH
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/quotes?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"Example","currency":"USD"}' "https://your-team.unifydesk.app/api/v1/quotes"

refunds

  • GET /refunds
  • GET /refunds/{id}
  • PATCH /refunds/{id}
  • DELETE /refunds/{id}

La création n’est pas offerte par l’API (voir Remboursements).

Filtres : invoice_id, credit_note_id

ChampTypeModifiable
idstring (uuid)
invoice_idstring (uuid)
credit_note_idstring (uuid)
amountnumber
currencystring
reasonstringPATCH
statusstring
refunded_atstring (date-time)
refunded_bystring
created_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/refunds?limit=20"

reports

  • GET /reports
  • GET /reports/{id}
ChampTypeModifiable
idstring (uuid)
namestring
descriptionstring
sourcestring
columnsjson
filtersjson
group_bystring
aggregatestring
aggregate_fieldstring
sort_bystring
sort_dirstring
created_bystring
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/reports?limit=20"

tasks

  • GET /tasks
  • POST /tasks
  • GET /tasks/{id}
  • PATCH /tasks/{id}
  • DELETE /tasks/{id}

Filtres : status, priority, assignee_id, company_id, contact_id, project_id, parent_task_id

ChampTypeModifiable
idstring (uuid)
conversation_idstring (uuid)POST, PATCH
project_idstring (uuid)POST, PATCH
company_idstring (uuid)POST, PATCH
contact_idstring (uuid)POST, PATCH
contract_idstring (uuid)POST, PATCH
invoice_idstring (uuid)POST, PATCH
parent_task_idstring (uuid)POST, PATCH
titlestringPOST, PATCH
descriptionstringPOST, PATCH
statusstringPOST, PATCH
prioritystringPOST, PATCH
assignee_idstring (uuid)POST, PATCH
due_datestring (date)POST, PATCH
due_atstring (date-time)POST, PATCH
is_all_daybooleanPOST, PATCH
recurrence_rulestringPOST, PATCH
estimated_hoursnumberPOST, PATCH
estimate_minutesnumberPOST, PATCH
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/tasks?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"Example"}' "https://your-team.unifydesk.app/api/v1/tasks"

time_entries

  • GET /time_entries
  • POST /time_entries
  • GET /time_entries/{id}
  • PATCH /time_entries/{id}
  • DELETE /time_entries/{id}

Filtres : entity_type, entity_id, user_id, billable

ChampTypeModifiable
idstring (uuid)
entity_idstring (uuid)POST, PATCH
entity_typestringPOST, PATCH
user_idstring (uuid)
duration_minutesintegerPOST, PATCH
descriptionstringPOST, PATCH
billablebooleanPOST, PATCH
started_atstring (date-time)POST, PATCH
is_runningboolean
approval_statusstring
submitted_atstring (date-time)
approved_atstring (date-time)
approved_bystring
rejection_reasonstring
created_atstring (date-time)
updated_atstring (date-time)
curl -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  "https://your-team.unifydesk.app/api/v1/time_entries?limit=20"

curl -X POST -H "Authorization: Bearer $UNIFYDESK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"entity_type":"conversation","entity_id":"<conversation id>","duration_minutes":1}' "https://your-team.unifydesk.app/api/v1/time_entries"

Une question ? Écrivez-nous.