Saltar al contenido principal

Desarrolladores

Documentación de la API REST

Una API JSON sobre HTTPS para la IA jurídica de Attorly. Ejecuta las mismas operaciones que el servidor MCP, con las mismas claves, permisos, límites y facturación.

Inicio rápido

Sube un contrato y analízalo en cuatro pasos.

  1. 1. Crear una clave

    Crea una clave en Ajustes › Desarrolladores y elige REST API. La misma clave sirve para el servidor MCP. Guárdala en una variable de entorno:

    bash
    export ATTORLY_API_KEY=lbmcp_your_api_key
  2. 2. Subir un documento

    Envía el archivo como multipart/form-data. data.id en la respuesta es el id del documento. analyze=false lo guarda sin iniciar el análisis en segundo plano, porque el siguiente paso ejecuta uno.

    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. Analizarlo

    Prefer: wait=30 espera hasta 30 segundos el resultado. Un análisis terminado vuelve como 200 con el resultado en data. Si tarda más, recibes 202 Accepted con una cabecera Location que apunta a la operación.

    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. Recoger el resultado

    Consulta la operación hasta que su estado sea succeeded o failed. El análisis está en result. Retry-After indica cuántos segundos esperar entre consultas.

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

Autenticación

Envía una credencial en la cabecera Authorization como token Bearer. Las claves de Ajustes › Desarrolladores empiezan por lbmcp_ y funcionan en Pro y Enterprise, tanto para la API REST como para el servidor MCP. Las claves de organización de Enterprise empiezan por atly_ (atly_rk_ las restringidas, atly_test_ las de modo de prueba); las antiguas claves lb_ siguen funcionando. Las aplicaciones que actúan en nombre de una persona usan OAuth.

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

Permisos (scopes)

Cada endpoint necesita los permisos indicados a su lado. Una clave sin ellos recibe 403 insufficient_scope, y requiredScopes en el error enumera todos los permisos que necesita la llamada. Las claves de API de organización y OAuth usan estos nombres:

PermisoPermiso de la clave API de la organización
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

Errores

Todos los errores tienen la misma forma: un código estable para tu lógica, un mensaje para personas y un requestId para dar al soporte.

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"
  }
}

Cada código se explica, con qué hacer, en la página de códigos de error

Versiones

La API se versiona por fecha. Envía Attorly-Version para elegir la versión de una solicitud; sin ella, la solicitud usa la versión con la que se creó su clave (las claves anteriores al versionado usan 2026-10-01). Cada respuesta indica qué versión respondió. Los cambios incompatibles solo llegan en una versión nueva, y el registro de cambios los recoge.

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_…

Idempotencia

Envía una cabecera Idempotency-Key, por ejemplo un UUID, en las solicitudes POST, PATCH y DELETE. Un reintento con la misma clave y la misma solicitud recibe la primera respuesta con Idempotent-Replayed: true, y el trabajo no se vuelve a ejecutar ni a cobrar. Una clave reutilizada para otra solicitud recibe 422 idempotency_key_reused, y una que sigue en curso recibe 409 o, en una llamada de larga duración, la misma operación. Los errores del servidor no se guardan, así que su reintento se ejecuta de nuevo. Las claves se conservan 24 horas.

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

Solicitudes largas

Desde la versión 2026-11-01, los análisis completos, redlines, planes de negociación, flujos de trabajo, informes de due diligence y borradores con IA responden al instante 202 Accepted con una operación. Envía Prefer: wait=30 para esperar antes hasta 30 segundos (60 como máximo) al resultado, o Prefer: respond-async para pedir 202 en cualquier escritura. Consulta la Location hasta que el estado sea succeeded o failed, o suscríbete a operation.succeeded. Los resultados se conservan 24 horas. Cada organización ejecuta como máximo 5 operaciones de IA de larga duración a la vez; las demás reciben 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", … } }

Paginación

Las listas devuelven { object: "list", data, hasMore, nextCursor } y aceptan limit (de 1 a 100, 20 por defecto) y cursor. Para la página siguiente, envía nextCursor como cursor. En la última página, nextCursor es null. Un cursor sigue siendo válido aunque se añadan elementos nuevos.

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…

Límites de solicitudes

Cada solicitud cuenta en varias ventanas: el límite por hora de la clave, 300 por minuto por persona, 600 por minuto por organización, un límite por minuto y clave para lecturas, escrituras y llamadas de IA, y el límite propio de cada operación. REST y MCP comparten los mismos contadores. Las cabeceras RateLimit-Policy y RateLimit muestran todas las ventanas; X-RateLimit-* muestra la que está más cerca de agotarse. Al superar un límite recibes 429 con 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

Crea un endpoint con POST /api/v1/webhook-endpoints para recibir un aviso cuando termine un trabajo, en lugar de consultar. Attorly envía un POST con un evento JSON y lo firma según Standard Webhooks con el secreto whsec_ del endpoint. Verifica la firma antes de confiar en el contenido, responde 2xx en menos de 15 segundos y descarta duplicados por webhook-id: las entregas fallidas se reintentan durante 72 horas. Puedes renovar el secreto, enviar un evento de prueba y ver cada entrega.

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.
}

Modo de prueba

Las claves de prueba (atly_test_…) llegan a todos los endpoints, pero trabajan con datos de prueba separados y devuelven resultados de ejemplo fijos: no se ejecuta IA ni se gastan créditos. Una clave de prueba nunca ve datos reales. Escribe un valor mágico como __fail_credits__, __fail_consent__ o __slow__ en cualquier campo de texto para provocar ese error o ese retraso. DELETE /api/v1/test-data borra todo lo que han creado las claves de prueba.

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

Las aplicaciones que actúan en nombre de un usuario de Attorly inician sesión con OAuth 2.1: descubrimiento en /.well-known/oauth-authorization-server, registro dinámico de clientes y el flujo de código de autorización con PKCE (S256). Pide resource=https://attorly.ai/api/v1 para obtener un token para la API REST; un token emitido para el servidor MCP se rechaza aquí. Añade offline_access para obtener un token de actualización. La persona elige la organización y puede limitar los permisos en la pantalla de consentimiento.

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

Facturación

Las operaciones que usan IA consumen los mismos créditos de IA que la aplicación de Attorly, del monedero del propietario de la clave o de su organización, tanto si las llamas por REST como por MCP. Cuando se agotan los créditos recibes 402 insufficient_credits. Las llamadas en modo de prueba son gratuitas.

Planes

La API está incluida en Pro y Enterprise. Si el plan del titular de la clave ya no incluye acceso a la API, o el titular ha salido de la organización, las solicitudes se rechazan con 403.

Referencia

Cada operación, generada a partir del documento OpenAPI que sirve la propia API. Las rutas son relativas a https://attorly.ai. Las respuestas correctas envuelven el resultado en data. Las descripciones de los campos están en inglés.

Documentos

GET/api/v1/documentslistDocuments

Lista los documentos guardados que la clave puede leer, del más reciente al más antiguo.

Permiso:DOCUMENTS_READ
Parámetros de consulta
CampoTipoDescripción
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

Sube un documento como multipart/form-data, o como JSON con contenido en base64 o texto sin formato. Se analiza en segundo plano salvo que analyze sea false.

Permiso:DOCUMENTS_WRITEUsa créditos de IAAcepta subida de archivos
Cuerpo de la solicitud
CampoTipoDescripción
filenameobligatoriostringThe 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
Datos de respuesta (201)
CampoTipoDescripción
idobligatoriostring
nameobligatoriostring
originalNameobligatoriostring
typeobligatorio"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …
sizeobligatoriointeger
statusobligatorio"PENDING" | "PROCESSING" | "ANALYZED" | "FAILED"PENDING until processing starts; ANALYZED once the analysis is stored
analysisQueuedobligatoriobooleantrue when the background analysis was started
createdAtobligatoriostringISO 8601 date-time
urlobligatoriostringWhere 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

Buscar en el texto de los documentos que la clave puede leer, por significado y por palabras exactas.

Permiso:DOCUMENTS_READ
Parámetros de consulta
CampoTipoDescripción
queryobligatoriostringWhat 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

Obtén un documento, su estado de procesamiento y su análisis más reciente.

Permiso:DOCUMENTS_READ
Parámetros de ruta
CampoTipoDescripción
documentIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
idobligatoriostring
nameobligatoriostring
originalNameobligatoriostring
typeobligatorio"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …
mimeTypeobligatoriostring
sizeobligatoriointeger
statusobligatorio"PENDING" | "PROCESSING" | "ANALYZED" | "FAILED"PENDING until processing starts; ANALYZED once the analysis is stored
archivedobligatorioboolean
ownedByYouobligatorioboolean
versionNumberobligatoriointeger | 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.
createdAtobligatoriostringISO 8601 date-time
updatedAtobligatoriostringISO 8601 date-time
fileAvailableobligatoriobooleanfalse when the stored file can no longer be read
governingLawRequiredobligatoriobooleantrue when the analysis is held until a governing law is chosen for the document in Attorly
latestAnalysisobligatorioobject | null
urlobligatoriostringWhere 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

Solicita la eliminación de un documento que le pertenece. El documento solo se elimina cuando usted aprueba la eliminación en Attorly.

Permiso:DOCUMENTS_DELETE
Parámetros de ruta
CampoTipoDescripción
documentIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
idobligatoriostring
deletedobligatoriobooleantrue only when the document is gone
statusobligatorio"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

Analiza un documento o un texto enviado en la solicitud. mode es full (documento guardado) o quick.

Permiso:DOCUMENTS_ANALYZEDOCUMENTS_READUsa créditos de IA

El campo mode del cuerpo elige una de: mode: full, mode: quick.

Cuerpo de la solicitud
CampoTipoDescripción
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

Listar los análisis guardados de un documento, de más reciente a más antiguo.

Permiso:DOCUMENTS_READ
Parámetros de ruta
CampoTipoDescripción
documentIdobligatoriostring
Parámetros de consulta
CampoTipoDescripción
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

Analiza un documento guardado.

Permiso:DOCUMENTS_ANALYZEDOCUMENTS_READUsa créditos de IA
Parámetros de ruta
CampoTipoDescripción
documentIdobligatoriostring

El campo mode del cuerpo elige una de: mode: full, mode: quick.

Cuerpo de la solicitud
CampoTipoDescripción
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

Extrae el texto plano de un documento PDF o DOCX guardado.

Permiso:DOCUMENTS_READ
Parámetros de ruta
CampoTipoDescripción
documentIdobligatoriostring
Parámetros de consulta
CampoTipoDescripción
offsetintegerCharacter offset to start from; pass the nextOffset of the previous call to read on
maxCharactersintegerMost characters to return in this call
Datos de respuesta (200)
CampoTipoDescripción
textobligatoriostringThe document text from offset (untrusted content)
documentNameobligatoriostring
documentTypeobligatoriostring
mimeTypeobligatoriostring | null
characterCountobligatoriointegerCharacters in the whole document
wordCountobligatoriointegerWords in the whole document
offsetobligatoriointeger
nextOffsetobligatoriointeger | nullPass as offset to read on; null when the text ends here
truncatedobligatoriobooleantrue 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

Obtener un análisis guardado: resumen, riesgo, términos clave, cláusulas y recomendaciones.

Permiso:DOCUMENTS_READ
Parámetros de ruta
CampoTipoDescripción
analysisIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
idobligatoriostring
documentIdobligatoriostring
documentNameobligatoriostring
summaryobligatoriostring | null
riskLevelobligatorio"LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
riskScoreobligatorionumber
keyTermsobligatorioarray of any
clausesobligatorioarray of any
recommendationsobligatorioarray of any
modeobligatoriostringSINGLE or CONSENSUS
createdAtobligatoriostringISO 8601 date-time
urlobligatoriostring
curl
curl "https://attorly.ai/api/v1/analyses/your_analysisId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/comparisonscreateComparison

Compara dos documentos o textos línea por línea.

Permiso:DOCUMENTS_READ
Cuerpo de la solicitud
CampoTipoDescripción
sourceDocumentIdstring
sourceContentstring
targetDocumentIdstring
targetContentstring
Datos de respuesta (200)
CampoTipoDescripción
differencesobligatorioarray of object
summaryobligatorioobject
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"
}'

Cláusulas

GET/api/v1/clausessearchClauses

Busca en la biblioteca de cláusulas.

Permiso:CLAUSES_READ
Parámetros de consulta
CampoTipoDescripción
queryobligatoriostring
category"INDEMNIFICATION" | "LIABILITY" | "TERMINATION" | "CONFIDENTIALITY" | "INTELLECTUAL_PROPERTY" | "PAYMENT" | …
jurisdictionstring
riskLevel"LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
limitinteger
Datos de respuesta (200)
CampoTipoDescripción
clausesobligatorioarray of object
countobligatoriointeger
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

Evalúa el riesgo de una cláusula.

Permiso:CLAUSES_READ
Cuerpo de la solicitud
CampoTipoDescripción
clauseTextobligatoriostring
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" | …
Datos de respuesta (200)
CampoTipoDescripción
clauseTextstring
clauseTypeobligatoriostring
jurisdictionobligatoriostring
overallRiskScoreobligatorionumber
riskLevelobligatorio"LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
riskFactorsobligatorioarray of object
recommendationsobligatorioarray 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

Compara una cláusula con la redacción estándar del mercado.

Permiso:CLAUSES_READ
Cuerpo de la solicitud
CampoTipoDescripción
clauseTextobligatoriostring
categoryobligatorio"INDEMNIFICATION" | "LIABILITY" | "TERMINATION" | "CONFIDENTIALITY" | "INTELLECTUAL_PROPERTY" | "PAYMENT" | …
contractTypestring
jurisdictionstring
Datos de respuesta (200)
CampoTipoDescripción
inputClauseobligatoriostring
categoryobligatoriostring
marketStandardsobligatorioarray of object
comparisonobligatorioobject
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

Comprueba una cláusula frente a un playbook.

Permiso:CLAUSES_READ
Cuerpo de la solicitud
CampoTipoDescripción
clauseTextobligatoriostring
playbookIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
playbookNameobligatoriostring
compliantobligatorioboolean
violationsobligatorioarray of string
warningsobligatorioarray of string
rulesCheckedobligatoriointeger
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"
}'

Investigación

POST/api/v1/research/searchessearchResearch

Busca en fuentes jurídicas como Lovdata, EUR-Lex y CourtListener.

Permiso:RESEARCH_READUsa créditos de IA
Cuerpo de la solicitud
CampoTipoDescripción
queryobligatoriostring
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
Datos de respuesta (200)
CampoTipoDescripción
queryobligatoriostring
jurisdictionobligatoriostring
resultsobligatorioarray of object
totalCountobligatoriointegerResults 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

Consulta una norma por su cita.

Permiso:RESEARCH_READUsa créditos de IA
Parámetros de consulta
CampoTipoDescripción
citationobligatoriostring
jurisdictionobligatoriostringISO 3166-1 alpha-2 country code, or "EU"
Datos de respuesta (200)
CampoTipoDescripción
idobligatoriostring
titleobligatoriostring
sourceobligatoriostring
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"

Propuestas de cambios

POST/api/v1/redlinescreateRedlines

Genera propuestas de cambios para un documento o texto.

Permiso:REDLINES_GENERATEUsa créditos de IA
Cuerpo de la solicitud
CampoTipoDescripción
documentIdstring
contentstring
partyRoleobligatorio"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
Datos de respuesta (200)
CampoTipoDescripción
changesobligatorioarray of object
summaryobject
negotiationNotesarray of string
statisticsobligatorioobject
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

Acepta o rechaza cambios propuestos en un documento.

Permiso:REDLINES_GENERATE
Parámetros de ruta
CampoTipoDescripción
documentIdobligatoriostring
Cuerpo de la solicitud
CampoTipoDescripción
changesobligatorioarray of object
Datos de respuesta (200)
CampoTipoDescripción
acceptedobligatoriointeger
rejectedobligatoriointeger
messageobligatoriostring
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"
    }
  ]
}'

Negociaciones

POST/api/v1/negotiations/position-analysescreateNegotiationPositionAnalysis

Analiza una posición negociadora.

Permiso:NEGOTIATIONS_READUsa créditos de IA
Cuerpo de la solicitud
CampoTipoDescripción
documentIdstring
contentstring
partyRoleobligatorio"BUYER" | "SELLER" | "LANDLORD" | "TENANT" | "EMPLOYER" | "EMPLOYEE"
contextobject
Datos de respuesta (200)
CampoTipoDescripción
overallPositionobligatoriostringFAVORABLE, BALANCED or UNFAVORABLE
positionsobligatorioarray 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

Crea un playbook de negociación a partir de una estrategia.

Permiso:NEGOTIATIONS_READUsa créditos de IA
Cuerpo de la solicitud
CampoTipoDescripción
strategyobligatorioobject
contextobject
Datos de respuesta (200)
CampoTipoDescripción
playbookobligatorioarray of object
anticipatedObjectionsobligatorioarray of object
recommendationsobligatorioarray of string
summaryobligatorioobject
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"
    ]
  }
}'

Flujos de trabajo

GET/api/v1/workflows/templateslistWorkflowTemplates

Lista las plantillas de flujos de trabajo.

Permiso:WORKFLOWS_EXECUTE
Parámetros de consulta
CampoTipoDescripción
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

Listar ejecuciones de flujos de trabajo, de más reciente a más antigua, opcionalmente de un proyecto o estado.

Permiso:WORKFLOWS_EXECUTE
Parámetros de consulta
CampoTipoDescripción
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

Inicia un flujo de trabajo en un proyecto de due diligence.

Permiso:WORKFLOWS_EXECUTEUsa créditos de IA
Cuerpo de la solicitud
CampoTipoDescripción
templateIdobligatoriostring
projectIdobligatoriostring
inputsobligatorioobject
optionsobject
Datos de respuesta (202)
CampoTipoDescripción
executionIdobligatoriostring
templateIdobligatoriostring
templateNameobligatoriostring
statusobligatoriostring
startedAtobligatoriostringISO 8601 date-time
messageobligatoriostring
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

Obtiene el estado de la ejecución de un flujo de trabajo.

Permiso:WORKFLOWS_EXECUTE
Parámetros de ruta
CampoTipoDescripción
executionIdobligatoriostring
Parámetros de consulta
CampoTipoDescripción
includeStepsboolean
Datos de respuesta (200)
CampoTipoDescripción
executionIdobligatoriostring
templateNameobligatoriostring
statusobligatoriostring
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

Listar proyectos de due diligence, de más reciente a más antiguo.

Permiso:DUE_DILIGENCE_FULL
Parámetros de consulta
CampoTipoDescripción
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

Crea un proyecto de due diligence.

Permiso:DUE_DILIGENCE_FULL
Cuerpo de la solicitud
CampoTipoDescripción
nameobligatoriostring
dealTypeobligatorio"MA_ACQUISITION" | "MA_MERGER" | "INVESTMENT" | "IPO" | "REAL_ESTATE" | "REGULATORY" | …
targetCompanystring
descriptionstring
settingsobject
Datos de respuesta (201)
CampoTipoDescripción
projectIdobligatoriostring
nameobligatoriostring
projectTypeobligatoriostring
statusobligatoriostring
createdAtobligatoriostringISO 8601 date-time
messageobligatoriostring
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

Obtener un proyecto de due diligence con su número de documentos y hallazgos.

Permiso:DUE_DILIGENCE_FULL
Parámetros de ruta
CampoTipoDescripción
projectIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
idobligatoriostring
nameobligatoriostring
descriptionobligatoriostring | null
projectTypeobligatoriostring
statusobligatoriostring
priorityobligatoriostring
targetCompanyobligatoriostring | null
dueDateobligatoriostring | null
documentCountobligatoriointeger
findingCountobligatoriointeger
createdAtobligatoriostringISO 8601 date-time
updatedAtobligatoriostringISO 8601 date-time
completedAtobligatoriostring | 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

Añade documentos a un proyecto de due diligence.

Permiso:DUE_DILIGENCE_FULL
Parámetros de ruta
CampoTipoDescripción
projectIdobligatoriostring
Cuerpo de la solicitud
CampoTipoDescripción
documentIdsobligatorioarray of string
categorystring
Datos de respuesta (200)
CampoTipoDescripción
projectIdobligatoriostring
documentsAddedobligatoriointeger
totalDocumentsobligatoriointeger
categoryobligatoriostring
messageobligatoriostring
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

Lista los hallazgos de un proyecto de due diligence.

Permiso:DUE_DILIGENCE_FULL
Parámetros de ruta
CampoTipoDescripción
projectIdobligatoriostring
Parámetros de consulta
CampoTipoDescripción
riskLevel"INFO" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
categorystring
limitinteger
Datos de respuesta (200)
CampoTipoDescripción
projectIdobligatoriostring
projectNameobligatoriostring
findingsobligatorioarray of object
riskSummaryobligatorioobjectNumber of findings per severity
totalFindingsobligatoriointeger
pendingProposalsobligatoriointegerRisks 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

Genera un informe de due diligence.

Permiso:DUE_DILIGENCE_FULL
Parámetros de ruta
CampoTipoDescripción
projectIdobligatoriostring
Cuerpo de la solicitud
CampoTipoDescripción
formatobligatorio"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
Datos de respuesta (201)
CampoTipoDescripción
reportIdobligatoriostring
projectIdobligatoriostring
projectNamestring
formatobligatorio"pdf" | "markdown"
statusobligatoriostring
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
markdownobligatoriostring
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"
}'

Plantillas y borradores

GET/api/v1/templateslistTemplates

Lista las plantillas de documentos.

Permiso:TEMPLATES_READ
Parámetros de consulta
CampoTipoDescripción
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

Crea un borrador a partir de una plantilla (mode template) o con IA (mode ai).

Permiso:TEMPLATES_DRAFTUsa créditos de IA

El campo mode del cuerpo elige una de: mode: template, mode: ai.

Cuerpo de la solicitud
CampoTipoDescripción
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"
  }
}'

Casos

GET/api/v1/caseslistCases

Lista tus casos, del modificado más recientemente al más antiguo.

Permiso:CASES_READ
Parámetros de consulta
CampoTipoDescripción
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

Obtener la cronología de un caso: cada evento con su fecha, sus pruebas y la posición de la otra parte.

Permiso:CASES_READ
Parámetros de ruta
CampoTipoDescripción
caseIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
caseobligatorioobject
eventsobligatorioarray of objectIn date order
countobligatoriointeger
needsReviewCountobligatoriointegerEvents an AI added that no person has confirmed
deletionRequestedCountobligatoriointegerEvents 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

Añadir un evento a la cronología de un caso.

Permiso:CASES_WRITE
Parámetros de ruta
CampoTipoDescripción
caseIdobligatoriostring
Cuerpo de la solicitud
CampoTipoDescripción
titleobligatoriostringWhat happened, in one line (at most 300 characters)
descriptionstring | nullMore detail, or null to clear it
whenobligatorioobjectWhen 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
Datos de respuesta (201)
CampoTipoDescripción
caseIdobligatoriostring
eventobligatorioobject
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

Cambiar un evento de la cronología de un caso, o confirmar uno añadido por la IA.

Permiso:CASES_WRITE
Parámetros de ruta
CampoTipoDescripción
caseIdobligatoriostring
eventIdobligatoriostring
Cuerpo de la solicitud
CampoTipoDescripción
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
Datos de respuesta (200)
CampoTipoDescripción
caseIdobligatoriostring
eventobligatorioobject
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

Solicitar la eliminación de un evento de la cronología de un caso. El evento solo se elimina cuando el propietario lo aprueba en Attorly.

Permiso:CASES_WRITE
Parámetros de ruta
CampoTipoDescripción
caseIdobligatoriostring
eventIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
caseIdobligatoriostring
idobligatoriostring
deletedobligatoriobooleantrue only when the event is gone
statusobligatorio"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

Exportar la cronología de un caso como archivo PDF, Word, ODT, Excel o PowerPoint.

Permiso:CASES_READ
Parámetros de ruta
CampoTipoDescripción
caseIdobligatoriostring
Cuerpo de la solicitud
CampoTipoDescripción
layoutobligatorio"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
formatobligatorio"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
Datos de respuesta (200)
CampoTipoDescripción
caseIdobligatoriostring
layoutobligatorio"overview" | "chronology" | "numbered" | "visual"
formatobligatorio"pdf" | "docx" | "odt" | "xlsx" | "pptx"
localeobligatoriostringThe language the file is written in
eventCountobligatoriointegerEvents in the file
exhibitCountobligatoriointegerDocuments in the exhibit list (chronology and numbered layouts)
leftOutConfidentialobligatoriointegerEvents left out because they are marked confidential
attachmentobligatorioobject
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

Lista los plazos de un caso, del más próximo al más lejano, con de quién es cada plazo y si está cumplido o vencido.

Permiso:CASES_READ
Parámetros de ruta
CampoTipoDescripción
caseIdobligatoriostring
Parámetros de consulta
CampoTipoDescripción
status"open" | "completed"open: not yet marked done; completed: marked done; both when absent
Datos de respuesta (200)
CampoTipoDescripción
caseobligatorioobject
deadlinesobligatorioarray of objectSoonest first
countobligatoriointeger
overdueCountobligatoriointeger
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

Añadir un plazo a un caso, en una fecha dada o contado desde un hecho registrado.

Permiso:CASES_WRITE
Parámetros de ruta
CampoTipoDescripción
caseIdobligatoriostring
Cuerpo de la solicitud
CampoTipoDescripción
titleobligatoriostringWhat 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
Datos de respuesta (201)
CampoTipoDescripción
caseIdobligatoriostring
deadlineobligatorioobject
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

Cambiar un plazo de un caso, o marcarlo como cumplido o abierto de nuevo.

Permiso:CASES_WRITE
Parámetros de ruta
CampoTipoDescripción
caseIdobligatoriostring
deadlineIdobligatoriostring
Cuerpo de la solicitud
CampoTipoDescripción
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
Datos de respuesta (200)
CampoTipoDescripción
caseIdobligatoriostring
deadlineobligatorioobject
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

Lista los hechos registrados en un caso, con su fuente, y los hechos que el caso aún necesita.

Permiso:CASES_READ
Parámetros de ruta
CampoTipoDescripción
caseIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
caseobligatorioobject
factsobligatorioarray of object
countobligatoriointeger
caseReadsobligatorioobject | 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

Registrar un hecho en un caso, o corregirlo. Los plazos contados desde él se mueven con él.

Permiso:CASES_WRITE
Parámetros de ruta
CampoTipoDescripción
caseIdobligatoriostring
Cuerpo de la solicitud
CampoTipoDescripción
keyobligatoriostringThe 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
valueobligatoriostringThe 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)
Datos de respuesta (200)
CampoTipoDescripción
caseIdobligatoriostring
outcomeobligatorio"recorded" | "corrected" | "unchanged"recorded: a new fact; corrected: a new value replaced the old one; unchanged: it already held this value
factobligatorioobject
movedDeadlinesobligatorioarray of objectOpen deadlines counted from the fact that moved with the correction, due days before and after
urlobligatoriostringWhere 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

Lista las partes de un caso y los roles que ofrece el caso.

Permiso:CASES_READ
Parámetros de ruta
CampoTipoDescripción
caseIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
caseobligatorioobject
partiesobligatorioarray of object
countobligatoriointeger
rolesobligatorioarray 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

Añadir una parte a un caso, en uno de sus roles.

Permiso:CASES_WRITE
Parámetros de ruta
CampoTipoDescripción
caseIdobligatoriostring
Cuerpo de la solicitud
CampoTipoDescripción
roleKeyobligatoriostringThe role the party has in the case, as one of the roles parties_list returns (e.g. "landlord")
partyTypeobligatorio"PERSON" | "ENTITY"PERSON for a person, ENTITY for a company or public body
nameobligatoriostringThe 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
Datos de respuesta (201)
CampoTipoDescripción
caseIdobligatoriostring
partyobligatorioobject
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

Cambiar los datos de una parte de un caso.

Permiso:CASES_WRITE
Parámetros de ruta
CampoTipoDescripción
caseIdobligatoriostring
partyIdobligatoriostring
Cuerpo de la solicitud
CampoTipoDescripción
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
Datos de respuesta (200)
CampoTipoDescripción
caseIdobligatoriostring
partyobligatorioobject
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)"

Operaciones

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

Obtén el estado y el resultado de una solicitud enviada con Prefer o Idempotency-Key.

Parámetros de ruta
CampoTipoDescripción
operationIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
idobligatoriostringop_…
objectobligatorio"operation"
operationIdobligatoriostringThe REST operation that was called, e.g. createRedlines
statusobligatorio"running" | "awaiting_approval" | "succeeded" | "failed"
livemodeobligatorioboolean
idempotencyKeystring | null
resultUrlobligatoriostringWhere to poll: /api/v1/operations/{id}
createdAtobligatoriostring (date-time)
completedAtobligatoriostring (date-time) | null
expiresAtobligatoriostring (date-time)
httpStatusobligatoriointeger | null
resultobligatorioanyThe data of the successful call
metaobject
errorobligatorioobject | null
curl
curl "https://attorly.ai/api/v1/operations/op_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"

Webhooks

GET/api/v1/webhook-endpointslistWebhookEndpoints

Listar los endpoints de webhook de la organización y el modo de la clave.

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

Crear un endpoint de webhook. La respuesta incluye su secreto de firma, que se muestra una sola vez.

Cuerpo de la solicitud
CampoTipoDescripción
urlobligatoriostring (uri)HTTPS URL that receives the events
descriptionstring
enabledEventsobligatorioarray 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.
Datos de respuesta (201)
CampoTipoDescripción
idobligatoriostringwe_…
objectobligatorio"webhook_endpoint"
urlobligatoriostring
descriptionstring | null
enabledEventsobligatorioarray of string
statusobligatorio"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemodeobligatorioboolean
includeSnapshotsobligatorioboolean
apiVersionobligatoriostring
failingSincestring (date-time) | null
createdAtobligatoriostring (date-time)
updatedAtobligatoriostring (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

Obtener un endpoint de webhook.

Parámetros de ruta
CampoTipoDescripción
endpointIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
idobligatoriostringwe_…
objectobligatorio"webhook_endpoint"
urlobligatoriostring
descriptionstring | null
enabledEventsobligatorioarray of string
statusobligatorio"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemodeobligatorioboolean
includeSnapshotsobligatorioboolean
apiVersionobligatoriostring
failingSincestring (date-time) | null
createdAtobligatoriostring (date-time)
updatedAtobligatoriostring (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

Cambiar la URL, los eventos o las instantáneas de un endpoint, o desactivarlo y activarlo.

Parámetros de ruta
CampoTipoDescripción
endpointIdobligatoriostring
Cuerpo de la solicitud
CampoTipoDescripción
urlstring (uri)
descriptionstring | null
enabledEventsarray of string
includeSnapshotsboolean
status"enabled" | "disabled"Disable to pause deliveries; enable to resume
Datos de respuesta (200)
CampoTipoDescripción
idobligatoriostringwe_…
objectobligatorio"webhook_endpoint"
urlobligatoriostring
descriptionstring | null
enabledEventsobligatorioarray of string
statusobligatorio"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemodeobligatorioboolean
includeSnapshotsobligatorioboolean
apiVersionobligatoriostring
failingSincestring (date-time) | null
createdAtobligatoriostring (date-time)
updatedAtobligatoriostring (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

Eliminar un endpoint de webhook y su historial de entregas.

Parámetros de ruta
CampoTipoDescripción
endpointIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
idobligatoriostring
objectobligatorio"webhook_endpoint"
deletedobligatoriotrue
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

Sustituir el secreto de firma. El antiguo sigue firmando durante 24 horas.

Parámetros de ruta
CampoTipoDescripción
endpointIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
idobligatoriostringwe_…
objectobligatorio"webhook_endpoint"
urlobligatoriostring
descriptionstring | null
enabledEventsobligatorioarray of string
statusobligatorio"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemodeobligatorioboolean
includeSnapshotsobligatorioboolean
apiVersionobligatoriostring
failingSincestring (date-time) | null
createdAtobligatoriostring (date-time)
updatedAtobligatoriostring (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

Enviar un evento webhook_endpoint.test solo a este endpoint.

Parámetros de ruta
CampoTipoDescripción
endpointIdobligatoriostring
Datos de respuesta (202)
CampoTipoDescripción
eventIdobligatoriostring
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

Listar las entregas de un endpoint, de más reciente a más antigua, con sus intentos y resultado.

Parámetros de ruta
CampoTipoDescripción
endpointIdobligatoriostring
Parámetros de consulta
CampoTipoDescripción
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"

Eventos

GET/api/v1/eventslistEvents

Listar los eventos de los últimos 30 días, de más reciente a más antiguo.

Parámetros de consulta
CampoTipoDescripción
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

Obtener un evento tal como lo reciben los endpoints de webhook.

Parámetros de ruta
CampoTipoDescripción
eventIdobligatoriostring
Datos de respuesta (200)
CampoTipoDescripción
idobligatoriostringevt_… — also sent as the webhook-id header; deduplicate on it
objectobligatorio"event"
typeobligatorio"analysis.completed" | "analysis.failed" | "redlines.generated" | "due_diligence.report.completed" | "operation.succeeded" | "operation.failed" | …
apiVersionobligatoriostring
createdAtobligatoriostring (date-time)
livemodeobligatorioboolean
dataobligatorioobject
curl
curl "https://attorly.ai/api/v1/events/your_eventId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/events/{eventId}/redeliveriesredeliverEvent

Volver a enviar un evento, a un endpoint o a todos los suscritos a él.

Parámetros de ruta
CampoTipoDescripción
eventIdobligatoriostring
Cuerpo de la solicitud
CampoTipoDescripción
endpointIdstringOnly this endpoint; default every endpoint subscribed to the event
Datos de respuesta (202)
CampoTipoDescripción
eventIdobligatoriostring
deliveriesScheduledobligatoriointeger
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"
}'

Cuenta, uso y registros

GET/api/v1/organizationgetOrganization

La organización de la clave: plan, créditos de IA, jurisdicción por defecto y lo que puede hacer la clave.

Datos de respuesta (200)
CampoTipoDescripción
organizationobligatorioobject
userobligatorioobject
planobligatoriostringSTANDARD, PRO or ENTERPRISE
billingobligatorioobject
defaultJurisdictionobligatoriostring | nullISO 3166-1 alpha-2 country used when a document names no governing law
credentialobligatorioobject
appUrlobligatoriostring
curl
curl "https://attorly.ai/api/v1/organization" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/usagegetUsage

Solicitudes por día, clave y operación, con número de errores, por REST y MCP.

Parámetros de consulta
CampoTipoDescripción
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

Listar las solicitudes a la API de la organización de los últimos 30 días, de más reciente a más antigua.

Parámetros de consulta
CampoTipoDescripción
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én llamó a qué, cuándo y con qué clave. Para propietarios y administradores de la organización.

Parámetros de consulta
CampoTipoDescripción
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

Eliminar todos los objetos, eventos y operaciones del modo de prueba de la organización. Solo claves de prueba.

Datos de respuesta (200)
CampoTipoDescripción
objectobligatorio"test_data_purge"
deletedobligatorioobject
curl
curl -X DELETE "https://attorly.ai/api/v1/test-data" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"