Aller au contenu principal

Développeurs

Documentation de l’API REST

Une API JSON sur HTTPS pour l’IA juridique d’Attorly. Elle exécute les mêmes opérations que le serveur MCP, avec les mêmes clés, autorisations, limites et la même facturation.

Démarrage rapide

Téléversez un contrat et analysez-le en quatre étapes.

  1. 1. Créer une clé

    Créez une clé dans Paramètres › Développeurs et choisissez REST API. La même clé fonctionne pour le serveur MCP. Gardez-la dans une variable d’environnement :

    bash
    export ATTORLY_API_KEY=lbmcp_your_api_key
  2. 2. Téléverser un document

    Envoyez le fichier en multipart/form-data. data.id dans la réponse est l’identifiant du document. analyze=false l’enregistre sans lancer l’analyse en arrière-plan, puisque l’étape suivante en exécute une.

    bash
    curl -X POST https://attorly.ai/api/v1/documents \
      -H "Authorization: Bearer $ATTORLY_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -F "[email protected]" \
      -F "type=NDA" \
      -F "analyze=false"
  3. 3. L’analyser

    Prefer: wait=30 attend jusqu’à 30 secondes le résultat. Une analyse terminée revient en 200 avec le résultat dans data. Si elle prend plus de temps, vous recevez 202 Accepted avec un en-tête Location qui pointe vers l’opération.

    bash
    curl -i -X POST https://attorly.ai/api/v1/documents/$DOCUMENT_ID/analyses \
      -H "Authorization: Bearer $ATTORLY_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Prefer: wait=30" \
      -H "Content-Type: application/json" \
      -d '{ "mode": "full", "options": { "partyRole": "BUYER" } }'
  4. 4. Récupérer le résultat

    Interrogez l’opération jusqu’à ce que son statut soit succeeded ou failed. L’analyse se trouve dans result. Retry-After indique combien de secondes attendre entre deux interrogations.

    bash
    curl https://attorly.ai/api/v1/operations/$OPERATION_ID \
      -H "Authorization: Bearer $ATTORLY_API_KEY"

Authentification

Envoyez un identifiant dans l’en-tête Authorization comme jeton Bearer. Les clés de Paramètres › Développeurs commencent par lbmcp_ et fonctionnent avec Pro et Enterprise, pour l’API REST comme pour le serveur MCP. Les clés d’organisation Enterprise commencent par atly_ (atly_rk_ pour les clés restreintes, atly_test_ pour le mode test) ; les anciennes clés lb_ fonctionnent toujours. Les applications qui agissent pour une personne utilisent OAuth.

http
Authorization: Bearer atly_live_…   # or lbmcp_…, atly_test_…, an OAuth access token

Autorisations (scopes)

Chaque endpoint exige les autorisations indiquées à côté. Une clé qui ne les a pas reçoit 403 insufficient_scope, et requiredScopes dans l’erreur liste toutes les autorisations nécessaires à l’appel. Les clés API d’organisation et OAuth utilisent ces noms :

AutorisationAutorisation de la clé API de l’organisation
DOCUMENTS_READdocuments:read
DOCUMENTS_WRITEdocuments:write
DOCUMENTS_DELETEdocuments:delete
DOCUMENTS_ANALYZEanalysis:create
CLAUSES_READclauses:read
RESEARCH_READresearch:read
REDLINES_GENERATEredlines:write
NEGOTIATIONS_READnegotiations:read
WORKFLOWS_EXECUTEworkflows:execute
DUE_DILIGENCE_FULLdue-diligence:write
TEMPLATES_READtemplates:read
TEMPLATES_DRAFTdrafts:write
CASES_READcases:read
CASES_WRITEcases:write

Erreurs

Toutes les erreurs ont la même forme : un code stable sur lequel brancher votre logique, un message pour les humains et un requestId à communiquer au support.

http
HTTP/1.1 403 Forbidden
Content-Type: application/json
Request-Id: req_7Hq2LmN4pX9sT1vB3cD5eF6g
Attorly-Version: 2026-12-01

{
  "error": {
    "type": "permission_error",
    "code": "insufficient_scope",
    "message": "Insufficient permissions. Missing scope: redlines:write.",
    "requiredScopes": ["redlines:write"],
    "docUrl": "https://attorly.ai/docs/api/errors#insufficient_scope",
    "requestId": "req_7Hq2LmN4pX9sT1vB3cD5eF6g"
  }
}

Chaque code est expliqué, avec la marche à suivre, sur la page des codes d’erreur

Versions

L’API est versionnée par date. Envoyez Attorly-Version pour choisir la version d’une requête ; sans cet en-tête, la requête utilise la version avec laquelle sa clé a été créée (les clés antérieures au versionnement utilisent 2026-10-01). Chaque réponse indique la version qui a répondu. Les changements incompatibles n’arrivent que dans une nouvelle version, et le journal des modifications les liste.

http
curl https://attorly.ai/api/v1/documents \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Attorly-Version: 2026-12-01"

HTTP/1.1 200 OK
Attorly-Version: 2026-12-01
Request-Id: req_…

Idempotence

Envoyez un en-tête Idempotency-Key, par exemple un UUID, sur les requêtes POST, PATCH et DELETE. Une nouvelle tentative avec la même clé et la même requête reçoit la première réponse avec Idempotent-Replayed: true, sans être exécutée ni facturée à nouveau. Une clé réutilisée pour une autre requête reçoit 422 idempotency_key_reused, et une clé encore en cours reçoit 409 ou, pour un appel de longue durée, la même opération. Les erreurs serveur ne sont pas conservées : leur nouvelle tentative s’exécute à nouveau. Les clés sont conservées 24 heures.

bash
curl -X POST https://attorly.ai/api/v1/redlines \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "documentId": "doc_123", "partyRole": "BUYER" }'

# IDEMPOTENCY_KEY=$(uuidgen) once per logical request; a retry with the same key and body:
HTTP/1.1 202 Accepted
Idempotent-Replayed: true

Requêtes longues

À partir de la version 2026-11-01, les analyses complètes, redlines, plans de négociation, workflows, rapports de due diligence et brouillons IA répondent immédiatement 202 Accepted avec une opération. Envoyez Prefer: wait=30 pour attendre d’abord le résultat jusqu’à 30 secondes (60 au maximum), ou Prefer: respond-async pour demander 202 sur n’importe quelle écriture. Interrogez la Location jusqu’à ce que le statut soit succeeded ou failed, ou abonnez-vous à operation.succeeded. Les résultats sont conservés 24 heures. Une organisation exécute au plus 5 opérations IA de longue durée à la fois ; au-delà, vous recevez 429 concurrency_limit_exceeded.

http
HTTP/1.1 202 Accepted
Location: /api/v1/operations/op_abc123
Retry-After: 2

{ "data": { "id": "op_abc123", "object": "operation", "status": "running", "resultUrl": "/api/v1/operations/op_abc123", … } }

Pagination

Les listes renvoient { object: "list", data, hasMore, nextCursor } et acceptent limit (1 à 100, 20 par défaut) et cursor. Pour la page suivante, envoyez nextCursor comme cursor. Sur la dernière page, nextCursor vaut null. Un curseur reste valable même si de nouveaux éléments sont ajoutés.

http
GET /api/v1/documents?limit=2

{
  "object": "list",
  "data": [ { "id": "doc_2", … }, { "id": "doc_1", … } ],
  "hasMore": true,
  "nextCursor": "eyJ0IjoiMjAyNi0xMC0xMVQxMDowMDowMC4wMDBaIiwiaWQiOiJkb2NfMSJ9"
}

GET /api/v1/documents?limit=2&cursor=eyJ0IjoiMjAy…

Limites de requêtes

Une requête est comptée dans plusieurs fenêtres : la limite horaire de la clé, 300 par minute et par personne, 600 par minute et par organisation, une limite par minute et par clé pour les lectures, les écritures et les appels IA, et la limite propre à chaque opération. REST et MCP partagent les mêmes compteurs. Les en-têtes RateLimit-Policy et RateLimit montrent toutes les fenêtres ; X-RateLimit-* montre celle qui est la plus proche d’être épuisée. Au-delà d’une limite, vous recevez 429 avec Retry-After.

http
RateLimit-Policy: "key-hour";q=1000;w=3600, "user-minute";q=300;w=60, "org-minute";q=600;w=60, "ai-minute";q=30;w=60, "tool";q=10;w=60
RateLimit: "key-hour";r=998;t=3412, "user-minute";r=297;t=41, "org-minute";r=590;t=41, "ai-minute";r=29;t=41, "tool";r=9;t=41
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 9
X-RateLimit-Reset: 1791720000

Webhooks

Créez un endpoint avec POST /api/v1/webhook-endpoints pour être prévenu quand un travail se termine, au lieu d’interroger l’API. Attorly envoie un POST contenant un événement JSON, signé selon Standard Webhooks avec le secret whsec_ de l’endpoint. Vérifiez la signature avant de faire confiance au contenu, répondez 2xx en moins de 15 secondes et dédoublonnez sur webhook-id : les livraisons échouées sont retentées pendant 72 heures. Vous pouvez renouveler le secret, envoyer un événement de test et consulter chaque livraison.

typescript
import crypto from 'node:crypto';

// Standard Webhooks: verify before you parse. secret is the endpoint's whsec_… value.
export function verifyAttorlyWebhook(rawBody: string, headers: Headers, secret: string): unknown {
  const id = headers.get('webhook-id');
  const timestamp = headers.get('webhook-timestamp');
  const signatures = headers.get('webhook-signature') ?? '';
  if (!id || !timestamp) throw new Error('Missing webhook headers');
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) throw new Error('Timestamp too old');

  const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');
  const expected = crypto.createHmac('sha256', key).update(`${id}.${timestamp}.${rawBody}`).digest();
  const valid = signatures.split(' ').some((entry) => {
    const [version, value] = entry.split(',');
    const given = Buffer.from(value ?? '', 'base64');
    return version === 'v1' && given.length === expected.length && crypto.timingSafeEqual(given, expected);
  });
  if (!valid) throw new Error('Invalid signature');
  return JSON.parse(rawBody); // Deduplicate on webhook-id: a delivery can arrive more than once.
}

Mode test

Les clés de test (atly_test_…) atteignent tous les endpoints, mais travaillent sur des données de test séparées et renvoient des résultats d’exemple fixes : aucune IA ne s’exécute et aucun crédit n’est consommé. Une clé de test ne voit jamais de données réelles. Placez une valeur magique comme __fail_credits__, __fail_consent__ ou __slow__ dans n’importe quel champ texte pour obtenir cet échec ou ce délai. DELETE /api/v1/test-data efface tout ce que les clés de test ont créé.

bash
curl -X POST https://attorly.ai/api/v1/analyses \
  -H "Authorization: Bearer atly_test_…" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "quick", "content": "__fail_credits__" }'

HTTP/1.1 402 Payment Required
{ "error": { "code": "insufficient_credits", "message": "Test mode: the AI credits are used up …" } }

OAuth

Les applications qui agissent pour un utilisateur Attorly se connectent avec OAuth 2.1 : découverte sur /.well-known/oauth-authorization-server, enregistrement dynamique des clients et flux du code d’autorisation avec PKCE (S256). Demandez resource=https://attorly.ai/api/v1 pour obtenir un jeton pour l’API REST ; un jeton émis pour le serveur MCP est refusé ici. Ajoutez offline_access pour obtenir un jeton d’actualisation. La personne choisit l’organisation et peut restreindre les autorisations sur l’écran de consentement.

http
GET https://attorly.ai/.well-known/oauth-protected-resource/api/v1
GET https://attorly.ai/.well-known/oauth-authorization-server

GET https://attorly.ai/api/oauth/authorize?response_type=code&client_id=…&redirect_uri=…
    &code_challenge=…&code_challenge_method=S256&scope=documents:read%20offline_access
    &resource=https://attorly.ai/api/v1&state=…

POST https://attorly.ai/api/oauth/token
grant_type=authorization_code&code=…&code_verifier=…&redirect_uri=…&client_id=…&resource=https://attorly.ai/api/v1

Facturation

Les opérations qui utilisent l’IA consomment les mêmes crédits IA que l’application Attorly, depuis le portefeuille du propriétaire de la clé ou de son organisation, que vous les appeliez via REST ou MCP. Quand les crédits sont épuisés, vous recevez 402 insufficient_credits. Les appels en mode test sont gratuits.

Offres

L’API est incluse dans les offres Pro et Enterprise. Si l’offre du titulaire de la clé n’inclut plus l’accès à l’API, ou si le titulaire a quitté l’organisation, les requêtes sont refusées avec 403.

Référence

Chaque opération, générée à partir du document OpenAPI que l’API sert elle-même. Les chemins sont relatifs à https://attorly.ai. Les réponses réussies placent le résultat dans data. Les descriptions des champs sont en anglais.

Documents

GET/api/v1/documentslistDocuments

Lister les documents enregistrés que la clé peut lire, du plus récent au plus ancien.

Autorisation:DOCUMENTS_READ
Paramètres de requête
ChampTypeDescription
type"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …Only documents of this kind
status"PENDING" | "PROCESSING" | "ANALYZED" | "FAILED"Only documents in this processing state
querystringOnly documents whose name contains this text
includeArchivedbooleanAlso list archived documents (left out by default)
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/documents?limit=20" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/documentsuploadDocument

Téléverser un document en multipart/form-data, ou en JSON avec un contenu base64 ou du texte brut. Il est analysé en arrière-plan sauf si analyze vaut false.

Autorisation:DOCUMENTS_WRITEUtilise des crédits IAAccepte les fichiers
Corps de la requête
ChampTypeDescription
filenameobligatoirestringThe file name with its extension, e.g. "nda.pdf"; the extension decides the file type when mimeType is absent
contentBase64stringThe file, base64-encoded
textstringPlain text to store as a .txt document, instead of contentBase64
mimeTypestringThe file's MIME type; checked against its content
namestringDisplay name; defaults to the file name
type"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …What the document is
urlstring (uri)An https URL Attorly downloads the file from (public hosts only, up to 10 MB), instead of contentBase64 or text
analyzebooleanAnalyse the document in the background after upload, as the app does (uses AI credits). false stores it only
Données de réponse (201)
ChampTypeDescription
idobligatoirestring
nameobligatoirestring
originalNameobligatoirestring
typeobligatoire"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …
sizeobligatoireinteger
statusobligatoire"PENDING" | "PROCESSING" | "ANALYZED" | "FAILED"PENDING until processing starts; ANALYZED once the analysis is stored
analysisQueuedobligatoirebooleantrue when the background analysis was started
createdAtobligatoirestringISO 8601 date-time
urlobligatoirestringWhere the document opens in Attorly
curl
curl -X POST "https://attorly.ai/api/v1/documents" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "filename": "nda.txt",
  "text": "This Mutual Non-Disclosure Agreement is entered into by…",
  "type": "NDA"
}'
GET/api/v1/documents/searchsearchDocuments

Rechercher dans le texte des documents que la clé peut lire, par le sens et par mots exacts.

Autorisation:DOCUMENTS_READ
Paramètres de requête
ChampTypeDescription
queryobligatoirestringWhat to look for, in plain language or exact words
type"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …Only documents of this kind
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/documents/search?query=limitation+of+liability&limit=10" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/documents/{documentId}getDocument

Obtenir un document, son état de traitement et sa dernière analyse.

Autorisation:DOCUMENTS_READ
Paramètres de chemin
ChampTypeDescription
documentIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
idobligatoirestring
nameobligatoirestring
originalNameobligatoirestring
typeobligatoire"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …
mimeTypeobligatoirestring
sizeobligatoireinteger
statusobligatoire"PENDING" | "PROCESSING" | "ANALYZED" | "FAILED"PENDING until processing starts; ANALYZED once the analysis is stored
archivedobligatoireboolean
ownedByYouobligatoireboolean
versionNumberobligatoireinteger | nullThe document's number among its versions you can read ("version 2" — a new version is saved as a new document, never in place); null when it has no other version. documents_list returns the newest version of each document only.
createdAtobligatoirestringISO 8601 date-time
updatedAtobligatoirestringISO 8601 date-time
fileAvailableobligatoirebooleanfalse when the stored file can no longer be read
governingLawRequiredobligatoirebooleantrue when the analysis is held until a governing law is chosen for the document in Attorly
latestAnalysisobligatoireobject | null
urlobligatoirestringWhere the document opens in Attorly
curl
curl "https://attorly.ai/api/v1/documents/doc_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
DELETE/api/v1/documents/{documentId}deleteDocument

Demander la suppression d’un document dont vous êtes propriétaire. Le document n’est supprimé que lorsque vous approuvez la suppression dans Attorly.

Autorisation:DOCUMENTS_DELETE
Paramètres de chemin
ChampTypeDescription
documentIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
idobligatoirestring
deletedobligatoirebooleantrue only when the document is gone
statusobligatoire"deleted" | "declined" | "awaiting_approval"deleted: the owner approved and it is gone; declined: the owner said no in their app, nothing was deleted; awaiting_approval: it is marked and waits for the owner to delete or keep it in Attorly
requestedAtstringWhen the deletion was first asked for (awaiting_approval)
urlstringWhere the owner approves or keeps the document in Attorly (awaiting_approval)
curl
curl -X DELETE "https://attorly.ai/api/v1/documents/doc_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
POST/api/v1/analysescreateAnalysis

Analyse un document ou un texte envoyé dans la requête. mode vaut full (document enregistré) ou quick.

Autorisation:DOCUMENTS_ANALYZEDOCUMENTS_READUtilise des crédits IA

Le champ mode du corps choisit l’une des variantes : mode: full, mode: quick.

Corps de la requête
ChampTypeDescription
mode"full" | "quick"Runs documents_analyze.
documentIdstring
contentstring
mimeTypestring
optionsobject
curl
curl -X POST "https://attorly.ai/api/v1/analyses" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "quick",
  "content": "This Agreement is entered into by and between…"
}'
GET/api/v1/documents/{documentId}/analyseslistDocumentAnalyses

Lister les analyses enregistrées d’un document, les plus récentes d’abord.

Autorisation:DOCUMENTS_READ
Paramètres de chemin
ChampTypeDescription
documentIdobligatoirestring
Paramètres de requête
ChampTypeDescription
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/documents/doc_abc123/analyses" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/documents/{documentId}/analysescreateDocumentAnalysis

Analyse un document enregistré.

Autorisation:DOCUMENTS_ANALYZEDOCUMENTS_READUtilise des crédits IA
Paramètres de chemin
ChampTypeDescription
documentIdobligatoirestring

Le champ mode du corps choisit l’une des variantes : mode: full, mode: quick.

Corps de la requête
ChampTypeDescription
mode"full" | "quick"Runs documents_analyze.
contentstring
mimeTypestring
optionsobject
curl
curl -X POST "https://attorly.ai/api/v1/documents/doc_abc123/analyses" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "full",
  "options": {
    "partyRole": "BUYER"
  }
}'
GET/api/v1/documents/{documentId}/textgetDocumentText

Extrait le texte brut d’un document PDF ou DOCX enregistré.

Autorisation:DOCUMENTS_READ
Paramètres de chemin
ChampTypeDescription
documentIdobligatoirestring
Paramètres de requête
ChampTypeDescription
offsetintegerCharacter offset to start from; pass the nextOffset of the previous call to read on
maxCharactersintegerMost characters to return in this call
Données de réponse (200)
ChampTypeDescription
textobligatoirestringThe document text from offset (untrusted content)
documentNameobligatoirestring
documentTypeobligatoirestring
mimeTypeobligatoirestring | null
characterCountobligatoireintegerCharacters in the whole document
wordCountobligatoireintegerWords in the whole document
offsetobligatoireinteger
nextOffsetobligatoireinteger | nullPass as offset to read on; null when the text ends here
truncatedobligatoirebooleantrue when the text continues past this slice
curl
curl "https://attorly.ai/api/v1/documents/doc_abc123/text" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/analyses/{analysisId}getAnalysis

Obtenir une analyse enregistrée : résumé, risque, termes clés, clauses et recommandations.

Autorisation:DOCUMENTS_READ
Paramètres de chemin
ChampTypeDescription
analysisIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
idobligatoirestring
documentIdobligatoirestring
documentNameobligatoirestring
summaryobligatoirestring | null
riskLevelobligatoire"LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
riskScoreobligatoirenumber
keyTermsobligatoirearray of any
clausesobligatoirearray of any
recommendationsobligatoirearray of any
modeobligatoirestringSINGLE or CONSENSUS
createdAtobligatoirestringISO 8601 date-time
urlobligatoirestring
curl
curl "https://attorly.ai/api/v1/analyses/your_analysisId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/comparisonscreateComparison

Compare deux documents ou textes ligne par ligne.

Autorisation:DOCUMENTS_READ
Corps de la requête
ChampTypeDescription
sourceDocumentIdstring
sourceContentstring
targetDocumentIdstring
targetContentstring
Données de réponse (200)
ChampTypeDescription
differencesobligatoirearray of object
summaryobligatoireobject
curl
curl -X POST "https://attorly.ai/api/v1/comparisons" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "sourceDocumentId": "doc_abc123",
  "targetDocumentId": "doc_def456"
}'

Clauses

GET/api/v1/clausessearchClauses

Recherche dans la bibliothèque de clauses.

Autorisation:CLAUSES_READ
Paramètres de requête
ChampTypeDescription
queryobligatoirestring
category"INDEMNIFICATION" | "LIABILITY" | "TERMINATION" | "CONFIDENTIALITY" | "INTELLECTUAL_PROPERTY" | "PAYMENT" | …
jurisdictionstring
riskLevel"LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
limitinteger
Données de réponse (200)
ChampTypeDescription
clausesobligatoirearray of object
countobligatoireinteger
curl
curl "https://attorly.ai/api/v1/clauses?query=limitation+of+liability&limit=5" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/clauses/risk-assessmentscreateClauseRiskAssessment

Évalue le risque d’une clause.

Autorisation:CLAUSES_READ
Corps de la requête
ChampTypeDescription
clauseTextobligatoirestring
category"INDEMNIFICATION" | "LIABILITY" | "TERMINATION" | "CONFIDENTIALITY" | "INTELLECTUAL_PROPERTY" | "PAYMENT" | …The kind of clause; its risk rules are applied
jurisdictionstringISO 3166-1 alpha-2 country code; defaults to international
contractTypestring
partyRole"BUYER" | "SELLER" | "LANDLORD" | "TENANT" | "EMPLOYER" | "EMPLOYEE" | …
Données de réponse (200)
ChampTypeDescription
clauseTextstring
clauseTypeobligatoirestring
jurisdictionobligatoirestring
overallRiskScoreobligatoirenumber
riskLevelobligatoire"LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
riskFactorsobligatoirearray of object
recommendationsobligatoirearray of string
alternativesarray of object
complianceIssuesarray of object
negotiationTipsarray of string
curl
curl -X POST "https://attorly.ai/api/v1/clauses/risk-assessments" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "clauseText": "The Supplier’s total liability shall not exceed the fees paid in the preceding month.",
  "category": "LIABILITY",
  "partyRole": "BUYER"
}'
POST/api/v1/clauses/market-comparisonscreateClauseMarketComparison

Compare une clause à la rédaction standard du marché.

Autorisation:CLAUSES_READ
Corps de la requête
ChampTypeDescription
clauseTextobligatoirestring
categoryobligatoire"INDEMNIFICATION" | "LIABILITY" | "TERMINATION" | "CONFIDENTIALITY" | "INTELLECTUAL_PROPERTY" | "PAYMENT" | …
contractTypestring
jurisdictionstring
Données de réponse (200)
ChampTypeDescription
inputClauseobligatoirestring
categoryobligatoirestring
marketStandardsobligatoirearray of object
comparisonobligatoireobject
curl
curl -X POST "https://attorly.ai/api/v1/clauses/market-comparisons" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "clauseText": "Either party may terminate this Agreement on 10 days’ written notice.",
  "category": "TERMINATION"
}'
POST/api/v1/clauses/playbook-checkscreateClausePlaybookCheck

Vérifie une clause par rapport à un playbook.

Autorisation:CLAUSES_READ
Corps de la requête
ChampTypeDescription
clauseTextobligatoirestring
playbookIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
playbookNameobligatoirestring
compliantobligatoireboolean
violationsobligatoirearray of string
warningsobligatoirearray of string
rulesCheckedobligatoireinteger
curl
curl -X POST "https://attorly.ai/api/v1/clauses/playbook-checks" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "clauseText": "This Agreement is governed by the laws of England.",
  "playbookId": "pb_abc123"
}'

Recherche

POST/api/v1/research/searchessearchResearch

Recherche dans des sources juridiques comme Lovdata, EUR-Lex et CourtListener.

Autorisation:RESEARCH_READUtilise des crédits IA
Corps de la requête
ChampTypeDescription
queryobligatoirestring
jurisdictionsarray of stringISO 3166-1 alpha-2 country code to search under, or "EU"; the first entry is used. Defaults to the key owner's country.
sourcesarray of "lovdata" | "eurlex" | "legislation_uk" | "congress_gov" | "courtlistener" | "finlex"Keep only results from these publishers
dateFromstringKeep only dated results on or after this day
dateTostringKeep only dated results on or before this day
limitinteger
Données de réponse (200)
ChampTypeDescription
queryobligatoirestring
jurisdictionobligatoirestring
resultsobligatoirearray of object
totalCountobligatoireintegerResults matching the filters, before limit
sourcesstring
curl
curl -X POST "https://attorly.ai/api/v1/research/searches" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "notice period for terminating a commercial lease",
  "jurisdictions": [
    "NO"
  ],
  "limit": 5
}'
GET/api/v1/research/statutesgetStatute

Recherche un texte de loi par sa référence.

Autorisation:RESEARCH_READUtilise des crédits IA
Paramètres de requête
ChampTypeDescription
citationobligatoirestring
jurisdictionobligatoirestringISO 3166-1 alpha-2 country code, or "EU"
Données de réponse (200)
ChampTypeDescription
idobligatoirestring
titleobligatoirestring
sourceobligatoirestring
jurisdictionstring
citationstring
urlstring
datestring
excerptstring
relevanceScorenumber
attributionstring
asOfstring
consolidatedAsOfstringISO date the stored text is "as amended through", as its publisher states
inForceTostringISO date the act stops/stopped being in force, when the publisher states one
repealedAtstringISO date the act was repealed, when it was
lawDatesReadbooleanTrue when the publisher's dates were read for the act; a missing consolidatedAsOf then means an unamended text
curl
curl "https://attorly.ai/api/v1/research/statutes?citation=LOV-1999-03-26-17&jurisdiction=NO" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"

Propositions de modification

POST/api/v1/redlinescreateRedlines

Génère des propositions de modification pour un document ou un texte.

Autorisation:REDLINES_GENERATEUtilise des crédits IA
Corps de la requête
ChampTypeDescription
documentIdstring
contentstring
partyRoleobligatoire"BUYER" | "SELLER" | "LANDLORD" | "TENANT" | "EMPLOYER" | "EMPLOYEE"
riskTolerance"CONSERVATIVE" | "MODERATE" | "AGGRESSIVE"
focusAreasarray of string
playbookIdstringRedline against this playbook's position ladders (own, organisation, system or shared playbooks)
side"OUR_PAPER" | "THEIR_PAPER" | "EITHER"Whose paper the document is, to pick the playbook positions that apply
Données de réponse (200)
ChampTypeDescription
changesobligatoirearray of object
summaryobject
negotiationNotesarray of string
statisticsobligatoireobject
curl
curl -X POST "https://attorly.ai/api/v1/redlines" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "documentId": "doc_abc123",
  "partyRole": "BUYER",
  "riskTolerance": "CONSERVATIVE"
}'
POST/api/v1/documents/{documentId}/redlines/resolutionsresolveRedlines

Accepte ou rejette les modifications proposées dans un document.

Autorisation:REDLINES_GENERATE
Paramètres de chemin
ChampTypeDescription
documentIdobligatoirestring
Corps de la requête
ChampTypeDescription
changesobligatoirearray of object
Données de réponse (200)
ChampTypeDescription
acceptedobligatoireinteger
rejectedobligatoireinteger
messageobligatoirestring
curl
curl -X POST "https://attorly.ai/api/v1/documents/doc_abc123/redlines/resolutions" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "changes": [
    {
      "id": "chg_1",
      "action": "accept"
    },
    {
      "id": "chg_2",
      "action": "reject"
    }
  ]
}'

Négociations

POST/api/v1/negotiations/position-analysescreateNegotiationPositionAnalysis

Analyse une position de négociation.

Autorisation:NEGOTIATIONS_READUtilise des crédits IA
Corps de la requête
ChampTypeDescription
documentIdstring
contentstring
partyRoleobligatoire"BUYER" | "SELLER" | "LANDLORD" | "TENANT" | "EMPLOYER" | "EMPLOYEE"
contextobject
Données de réponse (200)
ChampTypeDescription
overallPositionobligatoirestringFAVORABLE, BALANCED or UNFAVORABLE
positionsobligatoirearray of object
prioritizedConcessionsarray of string
dealBreakersarray of string
suggestedApproachstring
estimatedOutcomeobject
curl
curl -X POST "https://attorly.ai/api/v1/negotiations/position-analyses" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "documentId": "doc_abc123",
  "partyRole": "BUYER"
}'
POST/api/v1/negotiations/playbookscreateNegotiationPlaybook

Élabore un playbook de négociation à partir d’une stratégie.

Autorisation:NEGOTIATIONS_READUtilise des crédits IA
Corps de la requête
ChampTypeDescription
strategyobligatoireobject
contextobject
Données de réponse (200)
ChampTypeDescription
playbookobligatoirearray of object
anticipatedObjectionsobligatoirearray of object
recommendationsobligatoirearray of string
summaryobligatoireobject
curl
curl -X POST "https://attorly.ai/api/v1/negotiations/playbooks" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "strategy": {
    "overallPosition": "collaborative",
    "priorities": [
      "Cap liability at 12 months of fees",
      "Keep Norwegian law"
    ]
  }
}'

Flux de travail

GET/api/v1/workflows/templateslistWorkflowTemplates

Liste les modèles de flux de travail.

Autorisation:WORKFLOWS_EXECUTE
Paramètres de requête
ChampTypeDescription
category"MA_ACQUISITION" | "MA_MERGER" | "INVESTMENT" | "IPO" | "REAL_ESTATE" | "REGULATORY" | …Due diligence project type the template is built for
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/workflows/templates?limit=20" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/workflows/executionslistWorkflowExecutions

Lister les exécutions de workflows, les plus récentes d’abord, éventuellement pour un projet ou un statut.

Autorisation:WORKFLOWS_EXECUTE
Paramètres de requête
ChampTypeDescription
projectIdstringOnly executions on this due diligence project
status"PENDING" | "RUNNING" | "WAITING_FOR_INPUT" | "WAITING_FOR_APPROVAL" | "PAUSED" | "COMPLETED" | …
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/workflows/executions?status=COMPLETED&limit=20" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/workflows/executionscreateWorkflowExecution

Lance un flux de travail sur un projet de due diligence.

Autorisation:WORKFLOWS_EXECUTEUtilise des crédits IA
Corps de la requête
ChampTypeDescription
templateIdobligatoirestring
projectIdobligatoirestring
inputsobligatoireobject
optionsobject
Données de réponse (202)
ChampTypeDescription
executionIdobligatoirestring
templateIdobligatoirestring
templateNameobligatoirestring
statusobligatoirestring
startedAtobligatoirestringISO 8601 date-time
messageobligatoirestring
curl
curl -X POST "https://attorly.ai/api/v1/workflows/executions" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "templateId": "wft_abc123",
  "projectId": "ddp_abc123",
  "inputs": {}
}'
GET/api/v1/workflows/executions/{executionId}getWorkflowExecution

Récupère le statut de l’exécution d’un flux de travail.

Autorisation:WORKFLOWS_EXECUTE
Paramètres de chemin
ChampTypeDescription
executionIdobligatoirestring
Paramètres de requête
ChampTypeDescription
includeStepsboolean
Données de réponse (200)
ChampTypeDescription
executionIdobligatoirestring
templateNameobligatoirestring
statusobligatoirestring
startedAtstringISO 8601 date-time
completedAtstringISO 8601 date-time
variablesobject
errorstring | null
stepsarray of object
curl
curl "https://attorly.ai/api/v1/workflows/executions/wfx_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"

Due Diligence

GET/api/v1/due-diligence/projectslistDueDiligenceProjects

Lister les projets de due diligence, les plus récents d’abord.

Autorisation:DUE_DILIGENCE_FULL
Paramètres de requête
ChampTypeDescription
status"NOT_STARTED" | "IN_PROGRESS" | "UNDER_REVIEW" | "COMPLETED" | "ON_HOLD" | "CANCELLED"Only projects in this state
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/due-diligence/projects?limit=20" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/due-diligence/projectscreateDueDiligenceProject

Crée un projet de due diligence.

Autorisation:DUE_DILIGENCE_FULL
Corps de la requête
ChampTypeDescription
nameobligatoirestring
dealTypeobligatoire"MA_ACQUISITION" | "MA_MERGER" | "INVESTMENT" | "IPO" | "REAL_ESTATE" | "REGULATORY" | …
targetCompanystring
descriptionstring
settingsobject
Données de réponse (201)
ChampTypeDescription
projectIdobligatoirestring
nameobligatoirestring
projectTypeobligatoirestring
statusobligatoirestring
createdAtobligatoirestringISO 8601 date-time
messageobligatoirestring
curl
curl -X POST "https://attorly.ai/api/v1/due-diligence/projects" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Project Falcon",
  "dealType": "MA_ACQUISITION",
  "targetCompany": "Target AS"
}'
GET/api/v1/due-diligence/projects/{projectId}getDueDiligenceProject

Obtenir un projet de due diligence avec son nombre de documents et de constats.

Autorisation:DUE_DILIGENCE_FULL
Paramètres de chemin
ChampTypeDescription
projectIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
idobligatoirestring
nameobligatoirestring
descriptionobligatoirestring | null
projectTypeobligatoirestring
statusobligatoirestring
priorityobligatoirestring
targetCompanyobligatoirestring | null
dueDateobligatoirestring | null
documentCountobligatoireinteger
findingCountobligatoireinteger
createdAtobligatoirestringISO 8601 date-time
updatedAtobligatoirestringISO 8601 date-time
completedAtobligatoirestring | null
curl
curl "https://attorly.ai/api/v1/due-diligence/projects/ddp_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/due-diligence/projects/{projectId}/documentsaddDueDiligenceDocuments

Ajoute des documents à un projet de due diligence.

Autorisation:DUE_DILIGENCE_FULL
Paramètres de chemin
ChampTypeDescription
projectIdobligatoirestring
Corps de la requête
ChampTypeDescription
documentIdsobligatoirearray of string
categorystring
Données de réponse (200)
ChampTypeDescription
projectIdobligatoirestring
documentsAddedobligatoireinteger
totalDocumentsobligatoireinteger
categoryobligatoirestring
messageobligatoirestring
curl
curl -X POST "https://attorly.ai/api/v1/due-diligence/projects/ddp_abc123/documents" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "documentIds": [
    "doc_abc123",
    "doc_def456"
  ]
}'
GET/api/v1/due-diligence/projects/{projectId}/findingslistDueDiligenceFindings

Liste les constats d’un projet de due diligence.

Autorisation:DUE_DILIGENCE_FULL
Paramètres de chemin
ChampTypeDescription
projectIdobligatoirestring
Paramètres de requête
ChampTypeDescription
riskLevel"INFO" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
categorystring
limitinteger
Données de réponse (200)
ChampTypeDescription
projectIdobligatoirestring
projectNameobligatoirestring
findingsobligatoirearray of object
riskSummaryobligatoireobjectNumber of findings per severity
totalFindingsobligatoireinteger
pendingProposalsobligatoireintegerRisks the AI proposed that wait for a reviewer: not findings, not listed, not in any report
curl
curl "https://attorly.ai/api/v1/due-diligence/projects/ddp_abc123/findings?riskLevel=HIGH" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/due-diligence/projects/{projectId}/reportscreateDueDiligenceReport

Génère un rapport de due diligence.

Autorisation:DUE_DILIGENCE_FULL
Paramètres de chemin
ChampTypeDescription
projectIdobligatoirestring
Corps de la requête
ChampTypeDescription
formatobligatoire"pdf" | "markdown""markdown" returns the report text; "pdf" also returns the formatted PDF (base64)
sectionsarray of "executive_summary" | "risk_overview" | "findings_detail" | "document_analysis" | "recommendations"
includeRecommendationsboolean
Données de réponse (201)
ChampTypeDescription
reportIdobligatoirestring
projectIdobligatoirestring
projectNamestring
formatobligatoire"pdf" | "markdown"
statusobligatoirestring
sectionsarray of string
documentCountinteger
findingCountinteger
pendingProposalsintegerRisks the AI proposed that wait for a reviewer when the report was made: left out of it, and counted at its top
markdownobligatoirestring
attachmentobject
messagestring
curl
curl -X POST "https://attorly.ai/api/v1/due-diligence/projects/ddp_abc123/reports" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "format": "markdown"
}'

Modèles et brouillons

GET/api/v1/templateslistTemplates

Liste les modèles de documents.

Autorisation:TEMPLATES_READ
Paramètres de requête
ChampTypeDescription
category"NDA" | "EMPLOYMENT" | "SERVICE_AGREEMENT" | "LEASE" | "REAL_ESTATE" | "CORPORATE" | …
jurisdictionstringISO 3166-1 alpha-2 country code (e.g. "NO", "GB"); jurisdiction-neutral templates are always included
languagestringISO 639-1 language code of the template text (e.g. "en", "nb")
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/templates?limit=20" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/draftscreateDraft

Crée un brouillon à partir d’un modèle (mode template) ou avec l’IA (mode ai).

Autorisation:TEMPLATES_DRAFTUtilise des crédits IA

Le champ mode du corps choisit l’une des variantes : mode: template, mode: ai.

Corps de la requête
ChampTypeDescription
mode"template" | "ai"Runs templates_draft.
templateIdstring
variablesobject
optionsobject
documentTypestring
requirementsstring
contextobject
curl
curl -X POST "https://attorly.ai/api/v1/drafts" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "template",
  "templateId": "tpl_abc123",
  "variables": {
    "partyA": "Acme AS",
    "partyB": "Beta AB"
  }
}'

Dossiers

GET/api/v1/caseslistCases

Lister vos dossiers, du plus récemment modifié au plus ancien.

Autorisation:CASES_READ
Paramètres de requête
ChampTypeDescription
status"ACTIVE" | "CLOSED" | "ARCHIVED"Only cases in this state; all states when absent
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/cases?status=ACTIVE&limit=20" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/cases/{caseId}/timelinegetCaseTimeline

Obtenir la chronologie d’un dossier : chaque événement avec sa date, ses preuves et la position de la partie adverse.

Autorisation:CASES_READ
Paramètres de chemin
ChampTypeDescription
caseIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
caseobligatoireobject
eventsobligatoirearray of objectIn date order
countobligatoireinteger
needsReviewCountobligatoireintegerEvents an AI added that no person has confirmed
deletionRequestedCountobligatoireintegerEvents waiting for the owner to approve their deletion
curl
curl "https://attorly.ai/api/v1/cases/case_abc123/timeline" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/cases/{caseId}/timeline/eventscreateTimelineEvent

Ajouter un événement à la chronologie d’un dossier.

Autorisation:CASES_WRITE
Paramètres de chemin
ChampTypeDescription
caseIdobligatoirestring
Corps de la requête
ChampTypeDescription
titleobligatoirestringWhat happened, in one line (at most 300 characters)
descriptionstring | nullMore detail, or null to clear it
whenobligatoireobjectWhen it happened, as precisely as it is known. precision TIME: start "YYYY-MM-DD" and time "HH:MM" (24-hour, in the case's time zone). DAY: start "YYYY-MM-DD". MONTH: start "YYYY-MM". YEAR: start "YYYY". PERIOD: start and end "YYYY-MM-DD", end after start. approximate: true when the date is an estimate; it is then written "c. …".
category"CONTRACT" | "DEADLINE" | "INCIDENT" | "FILING" | "CORRESPONDENCE" | "COURT_DATE" | …What kind of event it is; OTHER when absent
importantbooleanMarks a key event; exports can be limited to key events
agreement"UNMARKED" | "AGREED" | "DISPUTED"Whether the other side agrees that it happened this way: AGREED, DISPUTED, or UNMARKED (not assessed)
opposingVersionstring | nullThe other side's account of a DISPUTED event. Kept only while agreement is DISPUTED
commentstring | nullThe owner's private note. Exports print it only when asked to
confidentialbooleanLeave this event out whenever the timeline is shared or exported
sourcesarray of objectThe case documents that evidence the event, with an optional page or section ("p. 3"). Each documentId must be a document of this case. On update, the list replaces the event's sources
Données de réponse (201)
ChampTypeDescription
caseIdobligatoirestring
eventobligatoireobject
curl
curl -X POST "https://attorly.ai/api/v1/cases/case_abc123/timeline/events" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Landlord gave written notice of termination",
  "when": {
    "precision": "DAY",
    "start": "2026-03-02"
  },
  "category": "CORRESPONDENCE",
  "important": true,
  "agreement": "DISPUTED",
  "opposingVersion": "The landlord says the notice was handed over on 27 February.",
  "sources": [
    {
      "documentId": "doc_abc123",
      "locator": "p. 1"
    }
  ]
}'
PATCH/api/v1/cases/{caseId}/timeline/events/{eventId}updateTimelineEvent

Modifier un événement de la chronologie d’un dossier, ou confirmer un événement ajouté par l’IA.

Autorisation:CASES_WRITE
Paramètres de chemin
ChampTypeDescription
caseIdobligatoirestring
eventIdobligatoirestring
Corps de la requête
ChampTypeDescription
titlestringWhat happened, in one line (at most 300 characters)
descriptionstring | nullMore detail, or null to clear it
whenobjectWhen it happened, as precisely as it is known. precision TIME: start "YYYY-MM-DD" and time "HH:MM" (24-hour, in the case's time zone). DAY: start "YYYY-MM-DD". MONTH: start "YYYY-MM". YEAR: start "YYYY". PERIOD: start and end "YYYY-MM-DD", end after start. approximate: true when the date is an estimate; it is then written "c. …".
category"CONTRACT" | "DEADLINE" | "INCIDENT" | "FILING" | "CORRESPONDENCE" | "COURT_DATE" | …What kind of event it is; OTHER when absent
importantbooleanMarks a key event; exports can be limited to key events
agreement"UNMARKED" | "AGREED" | "DISPUTED"Whether the other side agrees that it happened this way: AGREED, DISPUTED, or UNMARKED (not assessed)
opposingVersionstring | nullThe other side's account of a DISPUTED event. Kept only while agreement is DISPUTED
commentstring | nullThe owner's private note. Exports print it only when asked to
confidentialbooleanLeave this event out whenever the timeline is shared or exported
sourcesarray of objectThe case documents that evidence the event, with an optional page or section ("p. 3"). Each documentId must be a document of this case. On update, the list replaces the event's sources
Données de réponse (200)
ChampTypeDescription
caseIdobligatoirestring
eventobligatoireobject
curl
curl -X PATCH "https://attorly.ai/api/v1/cases/case_abc123/timeline/events/your_eventId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
DELETE/api/v1/cases/{caseId}/timeline/events/{eventId}deleteTimelineEvent

Demander la suppression d’un événement de la chronologie d’un dossier. L’événement n’est supprimé qu’après approbation du propriétaire dans Attorly.

Autorisation:CASES_WRITE
Paramètres de chemin
ChampTypeDescription
caseIdobligatoirestring
eventIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
caseIdobligatoirestring
idobligatoirestring
deletedobligatoirebooleantrue only when the event is gone
statusobligatoire"deleted" | "declined" | "awaiting_approval"deleted: the owner approved and it is gone; declined: the owner said no in their app, nothing was deleted; awaiting_approval: it is marked and waits for the owner to delete or keep it in Attorly
requestedAtstringWhen the deletion was first asked for (awaiting_approval)
urlstringWhere the owner approves or keeps the event in Attorly (awaiting_approval)
curl
curl -X DELETE "https://attorly.ai/api/v1/cases/case_abc123/timeline/events/your_eventId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
POST/api/v1/cases/{caseId}/timeline/exportexportCaseTimeline

Exporter la chronologie d’un dossier en fichier PDF, Word, ODT, Excel ou PowerPoint.

Autorisation:CASES_READ
Paramètres de chemin
ChampTypeDescription
caseIdobligatoirestring
Corps de la requête
ChampTypeDescription
layoutobligatoire"overview" | "chronology" | "numbered" | "visual"overview: date and what happened, for the other party, a complaints board or a lawyer. chronology: numbered table with sources and an exhibit list, for a court. numbered: one numbered paragraph per event with exhibit references, for the facts section of a filing. visual: the time axis on one landscape page
formatobligatoire"pdf" | "docx" | "odt" | "xlsx" | "pptx"The file type. overview and chronology: pdf, docx, odt, xlsx or pptx. numbered: pdf, docx or odt. visual: pdf or pptx
optionsobject
localestringLanguage of the file's headings, dates and file name, as a locale Attorly ships (e.g. "en", "nb", "de"); the account's language when absent or not offered
Données de réponse (200)
ChampTypeDescription
caseIdobligatoirestring
layoutobligatoire"overview" | "chronology" | "numbered" | "visual"
formatobligatoire"pdf" | "docx" | "odt" | "xlsx" | "pptx"
localeobligatoirestringThe language the file is written in
eventCountobligatoireintegerEvents in the file
exhibitCountobligatoireintegerDocuments in the exhibit list (chronology and numbered layouts)
leftOutConfidentialobligatoireintegerEvents left out because they are marked confidential
attachmentobligatoireobject
curl
curl -X POST "https://attorly.ai/api/v1/cases/case_abc123/timeline/export" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "layout": "chronology",
  "format": "docx",
  "options": {
    "markAgreement": true
  },
  "locale": "en"
}'
GET/api/v1/cases/{caseId}/deadlineslistCaseDeadlines

Lister les échéances d’un dossier, de la plus proche à la plus lointaine, avec à qui chacune incombe et si elle est respectée ou dépassée.

Autorisation:CASES_READ
Paramètres de chemin
ChampTypeDescription
caseIdobligatoirestring
Paramètres de requête
ChampTypeDescription
status"open" | "completed"open: not yet marked done; completed: marked done; both when absent
Données de réponse (200)
ChampTypeDescription
caseobligatoireobject
deadlinesobligatoirearray of objectSoonest first
countobligatoireinteger
overdueCountobligatoireinteger
curl
curl "https://attorly.ai/api/v1/cases/case_abc123/deadlines?status=open" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/cases/{caseId}/deadlinescreateCaseDeadline

Ajouter une échéance à un dossier, à une date donnée ou calculée à partir d’un fait enregistré.

Autorisation:CASES_WRITE
Paramètres de chemin
ChampTypeDescription
caseIdobligatoirestring
Corps de la requête
ChampTypeDescription
titleobligatoirestringWhat must be done by then, in one line (at most 200 characters)
dueAtstring (date) | string (date-time)The due date. A day "YYYY-MM-DD" is due at the end of that day where the case applies (its country, else the owner's); a moment ("2026-03-02T09:00:00+01:00", a hearing) is kept as given
derivedFromobjectCount the date from a recorded date fact instead of giving dueAt: due = the fact's date + offsetDays days, or + offsetMonths calendar months. The deadline moves with the fact when the fact is corrected. Record the fact first with facts_record
kind"HEARING" | "FILING" | "DISCOVERY" | "STATUTE_OF_LIMITATIONS" | "CUSTOM"What kind of deadline it is; CUSTOM when absent
party"SELF" | "COUNTERPARTY"SELF: the owner must act by then. COUNTERPARTY: a window the other side set; SELF when absent
notesstring | nullA short note shown with the deadline and in its reminders (at most 500 characters), or null to clear it
Données de réponse (201)
ChampTypeDescription
caseIdobligatoirestring
deadlineobligatoireobject
curl
curl -X POST "https://attorly.ai/api/v1/cases/case_abc123/deadlines" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Protest the termination in writing to the landlord",
  "derivedFrom": {
    "factKey": "receivedAt",
    "offsetMonths": 1
  },
  "kind": "FILING",
  "party": "SELF",
  "notes": "Husleieloven § 9-8 (1): one month from receipt"
}'
PATCH/api/v1/cases/{caseId}/deadlines/{deadlineId}updateCaseDeadline

Modifier une échéance d’un dossier, ou la marquer comme accomplie ou à nouveau ouverte.

Autorisation:CASES_WRITE
Paramètres de chemin
ChampTypeDescription
caseIdobligatoirestring
deadlineIdobligatoirestring
Corps de la requête
ChampTypeDescription
titlestringWhat must be done by then, in one line (at most 200 characters)
dueAtstring (date) | string (date-time)The due date. A day "YYYY-MM-DD" is due at the end of that day where the case applies (its country, else the owner's); a moment ("2026-03-02T09:00:00+01:00", a hearing) is kept as given
derivedFromobjectCount the date from a recorded date fact instead of giving dueAt: due = the fact's date + offsetDays days, or + offsetMonths calendar months. The deadline moves with the fact when the fact is corrected. Record the fact first with facts_record
kind"HEARING" | "FILING" | "DISCOVERY" | "STATUTE_OF_LIMITATIONS" | "CUSTOM"What kind of deadline it is; CUSTOM when absent
party"SELF" | "COUNTERPARTY"SELF: the owner must act by then. COUNTERPARTY: a window the other side set; SELF when absent
notesstring | nullA short note shown with the deadline and in its reminders (at most 500 characters), or null to clear it
completedbooleantrue marks the deadline done; false reopens it
Données de réponse (200)
ChampTypeDescription
caseIdobligatoirestring
deadlineobligatoireobject
curl
curl -X PATCH "https://attorly.ai/api/v1/cases/case_abc123/deadlines/dl_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
GET/api/v1/cases/{caseId}/factslistCaseFacts

Lister les faits enregistrés dans un dossier, avec leur source, et les faits dont le dossier a encore besoin.

Autorisation:CASES_READ
Paramètres de chemin
ChampTypeDescription
caseIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
caseobligatoireobject
factsobligatoirearray of object
countobligatoireinteger
caseReadsobligatoireobject | nullThe facts the case's rule reads, under exactly these keys; null when it reads none
curl
curl "https://attorly.ai/api/v1/cases/case_abc123/facts" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/cases/{caseId}/factsrecordCaseFact

Enregistrer un fait dans un dossier, ou le corriger. Les échéances calculées à partir de ce fait sont déplacées avec lui.

Autorisation:CASES_WRITE
Paramètres de chemin
ChampTypeDescription
caseIdobligatoirestring
Corps de la requête
ChampTypeDescription
keyobligatoirestringThe fact, as a camelCase key. facts_list names the facts this case reads, with their format; use one of those, or another camelCase key only for a fact none of them covers
valueobligatoirestringThe value, in the format its key takes (a date fact: YYYY-MM-DD). It is stored in canonical form, so the result can differ from what was sent ("Lissabon" becomes LIS)
Données de réponse (200)
ChampTypeDescription
caseIdobligatoirestring
outcomeobligatoire"recorded" | "corrected" | "unchanged"recorded: a new fact; corrected: a new value replaced the old one; unchanged: it already held this value
factobligatoireobject
movedDeadlinesobligatoirearray of objectOpen deadlines counted from the fact that moved with the correction, due days before and after
urlobligatoirestringWhere the case opens in Attorly
curl
curl -X POST "https://attorly.ai/api/v1/cases/case_abc123/facts" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "key": "receivedAt",
  "value": "2026-03-04"
}'
GET/api/v1/cases/{caseId}/partieslistCaseParties

Lister les parties d’un dossier et les rôles que le dossier prévoit.

Autorisation:CASES_READ
Paramètres de chemin
ChampTypeDescription
caseIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
caseobligatoireobject
partiesobligatoirearray of object
countobligatoireinteger
rolesobligatoirearray of objectThe roles the case offers; empty when it has no case type with roles
curl
curl "https://attorly.ai/api/v1/cases/case_abc123/parties" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/cases/{caseId}/partiescreateCaseParty

Ajouter une partie à un dossier, dans l’un de ses rôles.

Autorisation:CASES_WRITE
Paramètres de chemin
ChampTypeDescription
caseIdobligatoirestring
Corps de la requête
ChampTypeDescription
roleKeyobligatoirestringThe role the party has in the case, as one of the roles parties_list returns (e.g. "landlord")
partyTypeobligatoire"PERSON" | "ENTITY"PERSON for a person, ENTITY for a company or public body
nameobligatoirestringThe party's name (at most 200 characters)
isSelfbooleantrue when this party is the person the connection acts for; false removes that link
orgNumberstringOrganisation number of an ENTITY
personalIdNumberstringNational identity number of a PERSON. Add it only when the owner gave it for this case
emailstring (email)E-mail address
phonestringPhone number
addressstringPostal address
representedBystringThe lawyer or representative acting for the party
notesstringThe owner's note about the party (at most 1000 characters)
positionintegerOrder within its role, 0 first
Données de réponse (201)
ChampTypeDescription
caseIdobligatoirestring
partyobligatoireobject
curl
curl -X POST "https://attorly.ai/api/v1/cases/case_abc123/parties" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "roleKey": "landlord",
  "partyType": "ENTITY",
  "name": "Fjord Eiendom AS",
  "orgNumber": "999999999",
  "email": "[email protected]"
}'
PATCH/api/v1/cases/{caseId}/parties/{partyId}updateCaseParty

Modifier les informations d’une partie d’un dossier.

Autorisation:CASES_WRITE
Paramètres de chemin
ChampTypeDescription
caseIdobligatoirestring
partyIdobligatoirestring
Corps de la requête
ChampTypeDescription
partyType"PERSON" | "ENTITY"PERSON for a person, ENTITY for a company or public body
namestringThe party's name (at most 200 characters)
isSelfbooleantrue when this party is the person the connection acts for; false removes that link
orgNumberstring | null
personalIdNumberstring | null
emailstring (email) | null
phonestring | null
addressstring | null
representedBystring | null
notesstring | null
positionintegerOrder within its role, 0 first
Données de réponse (200)
ChampTypeDescription
caseIdobligatoirestring
partyobligatoireobject
curl
curl -X PATCH "https://attorly.ai/api/v1/cases/case_abc123/parties/party_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Opérations

GET/api/v1/operations/{operationId}getOperation

Obtenir l'état et le résultat d'une requête envoyée avec Prefer ou Idempotency-Key.

Paramètres de chemin
ChampTypeDescription
operationIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
idobligatoirestringop_…
objectobligatoire"operation"
operationIdobligatoirestringThe REST operation that was called, e.g. createRedlines
statusobligatoire"running" | "awaiting_approval" | "succeeded" | "failed"
livemodeobligatoireboolean
idempotencyKeystring | null
resultUrlobligatoirestringWhere to poll: /api/v1/operations/{id}
createdAtobligatoirestring (date-time)
completedAtobligatoirestring (date-time) | null
expiresAtobligatoirestring (date-time)
httpStatusobligatoireinteger | null
resultobligatoireanyThe data of the successful call
metaobject
errorobligatoireobject | null
curl
curl "https://attorly.ai/api/v1/operations/op_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"

Webhooks

GET/api/v1/webhook-endpointslistWebhookEndpoints

Lister les endpoints webhook de l’organisation et du mode de la clé.

curl
curl "https://attorly.ai/api/v1/webhook-endpoints" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/webhook-endpointscreateWebhookEndpoint

Créer un endpoint webhook. La réponse contient son secret de signature, affiché une seule fois.

Corps de la requête
ChampTypeDescription
urlobligatoirestring (uri)HTTPS URL that receives the events
descriptionstring
enabledEventsobligatoirearray of stringEvent types to receive, or ["*"] for all
includeSnapshotsbooleanSend object snapshots instead of thin { id, object } payloads, for operations made with organization API keys (calls made with personal keys and connected apps always send thin payloads). Organization owners and admins only.
Données de réponse (201)
ChampTypeDescription
idobligatoirestringwe_…
objectobligatoire"webhook_endpoint"
urlobligatoirestring
descriptionstring | null
enabledEventsobligatoirearray of string
statusobligatoire"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemodeobligatoireboolean
includeSnapshotsobligatoireboolean
apiVersionobligatoirestring
failingSincestring (date-time) | null
createdAtobligatoirestring (date-time)
updatedAtobligatoirestring (date-time)
secretstringwhsec_… — only when the endpoint is created or its secret rolled
curl
curl -X POST "https://attorly.ai/api/v1/webhook-endpoints" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://example.com/attorly/webhooks",
  "description": "Production receiver",
  "enabledEvents": [
    "analysis.completed",
    "operation.succeeded",
    "operation.failed"
  ]
}'
GET/api/v1/webhook-endpoints/{endpointId}getWebhookEndpoint

Obtenir un endpoint webhook.

Paramètres de chemin
ChampTypeDescription
endpointIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
idobligatoirestringwe_…
objectobligatoire"webhook_endpoint"
urlobligatoirestring
descriptionstring | null
enabledEventsobligatoirearray of string
statusobligatoire"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemodeobligatoireboolean
includeSnapshotsobligatoireboolean
apiVersionobligatoirestring
failingSincestring (date-time) | null
createdAtobligatoirestring (date-time)
updatedAtobligatoirestring (date-time)
secretstringwhsec_… — only when the endpoint is created or its secret rolled
curl
curl "https://attorly.ai/api/v1/webhook-endpoints/your_endpointId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
PATCH/api/v1/webhook-endpoints/{endpointId}updateWebhookEndpoint

Modifier l’URL, les événements ou les instantanés d’un endpoint, ou le désactiver et le réactiver.

Paramètres de chemin
ChampTypeDescription
endpointIdobligatoirestring
Corps de la requête
ChampTypeDescription
urlstring (uri)
descriptionstring | null
enabledEventsarray of string
includeSnapshotsboolean
status"enabled" | "disabled"Disable to pause deliveries; enable to resume
Données de réponse (200)
ChampTypeDescription
idobligatoirestringwe_…
objectobligatoire"webhook_endpoint"
urlobligatoirestring
descriptionstring | null
enabledEventsobligatoirearray of string
statusobligatoire"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemodeobligatoireboolean
includeSnapshotsobligatoireboolean
apiVersionobligatoirestring
failingSincestring (date-time) | null
createdAtobligatoirestring (date-time)
updatedAtobligatoirestring (date-time)
secretstringwhsec_… — only when the endpoint is created or its secret rolled
curl
curl -X PATCH "https://attorly.ai/api/v1/webhook-endpoints/your_endpointId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
DELETE/api/v1/webhook-endpoints/{endpointId}deleteWebhookEndpoint

Supprimer un endpoint webhook et son historique de livraisons.

Paramètres de chemin
ChampTypeDescription
endpointIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
idobligatoirestring
objectobligatoire"webhook_endpoint"
deletedobligatoiretrue
curl
curl -X DELETE "https://attorly.ai/api/v1/webhook-endpoints/your_endpointId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
POST/api/v1/webhook-endpoints/{endpointId}/secret-rollsrollWebhookEndpointSecret

Remplacer le secret de signature. L’ancien continue de signer pendant 24 heures.

Paramètres de chemin
ChampTypeDescription
endpointIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
idobligatoirestringwe_…
objectobligatoire"webhook_endpoint"
urlobligatoirestring
descriptionstring | null
enabledEventsobligatoirearray of string
statusobligatoire"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemodeobligatoireboolean
includeSnapshotsobligatoireboolean
apiVersionobligatoirestring
failingSincestring (date-time) | null
createdAtobligatoirestring (date-time)
updatedAtobligatoirestring (date-time)
secretstringwhsec_… — only when the endpoint is created or its secret rolled
curl
curl -X POST "https://attorly.ai/api/v1/webhook-endpoints/your_endpointId/secret-rolls" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
POST/api/v1/webhook-endpoints/{endpointId}/test-eventssendWebhookTestEvent

Envoyer un événement webhook_endpoint.test à cet endpoint uniquement.

Paramètres de chemin
ChampTypeDescription
endpointIdobligatoirestring
Données de réponse (202)
ChampTypeDescription
eventIdobligatoirestring
curl
curl -X POST "https://attorly.ai/api/v1/webhook-endpoints/your_endpointId/test-events" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
GET/api/v1/webhook-endpoints/{endpointId}/deliverieslistWebhookDeliveries

Lister les livraisons d’un endpoint, les plus récentes d’abord, avec leurs tentatives et leur résultat.

Paramètres de chemin
ChampTypeDescription
endpointIdobligatoirestring
Paramètres de requête
ChampTypeDescription
limitintegerItems per page, 1–100 (default 20)
cursorstringThe nextCursor of the previous page
status"pending" | "succeeded" | "failed"Only deliveries in this state
curl
curl "https://attorly.ai/api/v1/webhook-endpoints/your_endpointId/deliveries" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"

Événements

GET/api/v1/eventslistEvents

Lister les événements des 30 derniers jours, les plus récents d’abord.

Paramètres de requête
ChampTypeDescription
limitintegerItems per page, 1–100 (default 20)
cursorstringThe nextCursor of the previous page
typestringOnly events of this type, e.g. analysis.completed
curl
curl "https://attorly.ai/api/v1/events" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/events/{eventId}getEvent

Obtenir un événement tel que les endpoints webhook le reçoivent.

Paramètres de chemin
ChampTypeDescription
eventIdobligatoirestring
Données de réponse (200)
ChampTypeDescription
idobligatoirestringevt_… — also sent as the webhook-id header; deduplicate on it
objectobligatoire"event"
typeobligatoire"analysis.completed" | "analysis.failed" | "redlines.generated" | "due_diligence.report.completed" | "operation.succeeded" | "operation.failed" | …
apiVersionobligatoirestring
createdAtobligatoirestring (date-time)
livemodeobligatoireboolean
dataobligatoireobject
curl
curl "https://attorly.ai/api/v1/events/your_eventId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/events/{eventId}/redeliveriesredeliverEvent

Renvoyer un événement, à un endpoint ou à tous ceux qui y sont abonnés.

Paramètres de chemin
ChampTypeDescription
eventIdobligatoirestring
Corps de la requête
ChampTypeDescription
endpointIdstringOnly this endpoint; default every endpoint subscribed to the event
Données de réponse (202)
ChampTypeDescription
eventIdobligatoirestring
deliveriesScheduledobligatoireinteger
curl
curl -X POST "https://attorly.ai/api/v1/events/your_eventId/redeliveries" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "endpointId": "we_abc123"
}'

Compte, utilisation et journaux

GET/api/v1/organizationgetOrganization

L’organisation de la clé : offre, crédits IA, juridiction par défaut et ce que la clé peut faire.

Données de réponse (200)
ChampTypeDescription
organizationobligatoireobject
userobligatoireobject
planobligatoirestringSTANDARD, PRO or ENTERPRISE
billingobligatoireobject
defaultJurisdictionobligatoirestring | nullISO 3166-1 alpha-2 country used when a document names no governing law
credentialobligatoireobject
appUrlobligatoirestring
curl
curl "https://attorly.ai/api/v1/organization" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/usagegetUsage

Requêtes par jour, clé et opération, avec le nombre d’erreurs, via REST et MCP.

Paramètres de requête
ChampTypeDescription
fromanyISO 8601 date; default 30 days ago (requests are kept 30 days)
toanyISO 8601 date, exclusive; default now
curl
curl "https://attorly.ai/api/v1/usage" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/request-logslistRequestLogs

Lister les requêtes API de l’organisation des 30 derniers jours, les plus récentes d’abord.

Paramètres de requête
ChampTypeDescription
limitintegerItems per page, 1–100 (default 20)
cursorstringThe nextCursor of the previous page
statusstring2xx, 4xx, 5xx, or an exact status
credentialIdstringOnly requests made with this key (apikey:<id>, or an MCP connection id)
operationIdstringOnly calls of this operation, e.g. createRedlines
requestIdstringOne request, by its Request-Id
sinceanyISO 8601; only requests at or after this time
untilanyISO 8601; only requests before this time
curl
curl "https://attorly.ai/api/v1/request-logs" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/audit-eventslistAuditEvents

Qui a appelé quoi, quand et avec quelle clé. Pour les propriétaires et administrateurs de l’organisation.

Paramètres de requête
ChampTypeDescription
limitintegerItems per page, 1–100 (default 20)
cursorstringThe nextCursor of the previous page
statusstring2xx, 4xx, 5xx, or an exact status
credentialIdstringOnly requests made with this key (apikey:<id>, or an MCP connection id)
operationIdstringOnly calls of this operation, e.g. createRedlines
requestIdstringOne request, by its Request-Id
sinceanyISO 8601; only requests at or after this time
untilanyISO 8601; only requests before this time
curl
curl "https://attorly.ai/api/v1/audit-events" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
DELETE/api/v1/test-datadeleteTestData

Supprimer tous les objets, événements et opérations du mode test de l’organisation. Clés de test uniquement.

Données de réponse (200)
ChampTypeDescription
objectobligatoire"test_data_purge"
deletedobligatoireobject
curl
curl -X DELETE "https://attorly.ai/api/v1/test-data" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"