Saltar para o conteúdo principal

Programadores

Documentação da API REST

Uma API JSON sobre HTTPS para a IA jurídica do Attorly. Executa as mesmas operações que o servidor MCP, com as mesmas chaves, âmbitos, limites e faturação.

Início rápido

Carregue um contrato e analise-o em quatro passos.

  1. 1. Criar uma chave

    Crie uma chave em Definições › Programadores e escolha REST API. A mesma chave funciona para o servidor MCP. Guarde-a numa variável de ambiente:

    bash
    export ATTORLY_API_KEY=lbmcp_your_api_key
  2. 2. Carregar um documento

    Envie o ficheiro como multipart/form-data. data.id na resposta é o id do documento. analyze=false guarda-o sem iniciar a análise em segundo plano, porque o passo seguinte executa uma.

    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. Analisá-lo

    Prefer: wait=30 espera até 30 segundos pelo resultado. Uma análise concluída volta como 200 com o resultado em data. Se demorar mais, recebe 202 Accepted com um cabeçalho Location que aponta para a operação.

    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. Obter o resultado

    Consulte a operação até o estado ser succeeded ou failed. A análise está em result. Retry-After indica quantos segundos esperar entre consultas.

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

Autenticação

Envie uma credencial no cabeçalho Authorization como token Bearer. As chaves de Definições › Programadores começam por lbmcp_ e funcionam nos planos Pro e Enterprise, tanto para a API REST como para o servidor MCP. As chaves de organização Enterprise começam por atly_ (atly_rk_ para chaves restritas, atly_test_ para o modo de teste); as antigas chaves lb_ continuam a funcionar. As aplicações que agem em nome de uma pessoa usam OAuth.

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

Âmbitos

Cada endpoint precisa dos âmbitos indicados ao lado. Uma chave sem eles recebe 403 insufficient_scope, e requiredScopes no erro lista todos os âmbitos de que a chamada precisa. As chaves de API de organização e o OAuth usam estes nomes:

ÂmbitoÂmbito da chave de API da organização
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

Erros

Todos os erros têm a mesma forma: um código estável para a sua lógica, uma mensagem para pessoas e um requestId para indicar ao suporte.

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 é explicado, com o que fazer, na página de códigos de erro

Versões

A API tem versões por data. Envie Attorly-Version para escolher a versão de um pedido; sem ele, o pedido usa a versão com que a chave foi criada (as chaves anteriores ao controlo de versões usam 2026-10-01). Cada resposta indica a versão que respondeu. As alterações incompatíveis só chegam numa nova versão, e o registo de alterações enumera-as.

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

Idempotência

Envie um cabeçalho Idempotency-Key, por exemplo um UUID, nos pedidos POST, PATCH e DELETE. Uma nova tentativa com a mesma chave e o mesmo pedido recebe a primeira resposta com Idempotent-Replayed: true, e o trabalho não é executado nem cobrado de novo. Uma chave reutilizada noutro pedido recebe 422 idempotency_key_reused, e uma ainda em curso recebe 409 ou, numa chamada de longa duração, a mesma operação. Os erros do servidor não são guardados, por isso a nova tentativa é executada de novo. As chaves são guardadas durante 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

Pedidos demorados

A partir da versão 2026-11-01, análises completas, redlines, planos de negociação, fluxos de trabalho, relatórios de due diligence e rascunhos com IA respondem de imediato 202 Accepted com uma operação. Envie Prefer: wait=30 para esperar primeiro pelo resultado até 30 segundos (no máximo 60), ou Prefer: respond-async para pedir 202 em qualquer escrita. Consulte a Location até o estado ser succeeded ou failed, ou subscreva operation.succeeded. Os resultados são guardados durante 24 horas. Cada organização executa no máximo 5 operações de IA de longa duração ao mesmo tempo; as restantes recebem 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", … } }

Paginação

As listas devolvem { object: "list", data, hasMore, nextCursor } e aceitam limit (1 a 100, 20 por omissão) e cursor. Para obter a página seguinte, envie nextCursor como cursor. Na última página, nextCursor é null. Um cursor continua válido mesmo quando são adicionados novos itens.

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 pedidos

Cada pedido conta em várias janelas: o limite por hora da chave, 300 por minuto por pessoa, 600 por minuto por organização, um limite por minuto e por chave para leituras, escritas e chamadas de IA, e o limite próprio de cada operação. REST e MCP partilham os mesmos contadores. Os cabeçalhos RateLimit-Policy e RateLimit mostram todas as janelas; X-RateLimit-* mostra a que está mais perto de se esgotar. Acima de um limite recebe 429 com 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

Crie um endpoint com POST /api/v1/webhook-endpoints para ser avisado quando um trabalho termina, em vez de consultar. O Attorly envia um POST com um evento JSON, assinado segundo Standard Webhooks com o segredo whsec_ do endpoint. Verifique a assinatura antes de confiar no conteúdo, responda 2xx em 15 segundos e elimine duplicados pelo webhook-id: as entregas falhadas são repetidas durante 72 horas. Pode renovar o segredo, enviar um evento de teste e 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 teste

As chaves de teste (atly_test_…) chegam a todos os endpoints, mas trabalham com dados de teste separados e devolvem resultados de exemplo fixos: não é executada IA nem são gastos créditos. Uma chave de teste nunca vê dados reais. Coloque um valor mágico como __fail_credits__, __fail_consent__ ou __slow__ em qualquer campo de texto para obter esse erro ou atraso. DELETE /api/v1/test-data apaga tudo o que as chaves de teste criaram.

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

As aplicações que agem em nome de um utilizador do Attorly iniciam sessão com OAuth 2.1: descoberta em /.well-known/oauth-authorization-server, registo dinâmico de clientes e o fluxo de código de autorização com PKCE (S256). Peça resource=https://attorly.ai/api/v1 para obter um token para a API REST; um token emitido para o servidor MCP é recusado aqui. Adicione offline_access para obter um token de atualização. A pessoa escolhe a organização e pode restringir os âmbitos no ecrã de consentimento.

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

Faturação

As operações que usam IA consomem os mesmos créditos de IA da aplicação Attorly, da carteira do titular da chave ou da sua organização, quer as chame por REST quer por MCP. Quando os créditos se esgotam, recebe 402 insufficient_credits. As chamadas no modo de teste são gratuitas.

Planos

A API está incluída nos planos Pro e Enterprise. Se o plano do titular da chave deixar de incluir acesso à API, ou se o titular tiver saído da organização, os pedidos são recusados com 403.

Referência

Todas as operações, geradas a partir do documento OpenAPI que a própria API serve. Os caminhos são relativos a https://attorly.ai. As respostas bem-sucedidas envolvem o resultado em data. As descrições dos campos estão em inglês.

Documentos

GET/api/v1/documentslistDocuments

Listar os documentos guardados que a chave pode ler, do mais recente para o mais antigo.

Âmbito:DOCUMENTS_READ
Parâmetros de consulta
CampoTipoDescrição
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

Carregar um documento como multipart/form-data, ou como JSON com conteúdo em base64 ou texto simples. É analisado em segundo plano, exceto se analyze for false.

Âmbito:DOCUMENTS_WRITEUsa créditos de IAAceita carregamento de ficheiros
Corpo do pedido
CampoTipoDescrição
filenameobrigatóriostringThe 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
Dados da resposta (201)
CampoTipoDescrição
idobrigatóriostring
nameobrigatóriostring
originalNameobrigatóriostring
typeobrigatório"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …
sizeobrigatóriointeger
statusobrigatório"PENDING" | "PROCESSING" | "ANALYZED" | "FAILED"PENDING until processing starts; ANALYZED once the analysis is stored
analysisQueuedobrigatóriobooleantrue when the background analysis was started
createdAtobrigatóriostringISO 8601 date-time
urlobrigatóriostringWhere 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

Pesquisar no texto dos documentos que a chave pode ler, por significado e por palavras exatas.

Âmbito:DOCUMENTS_READ
Parâmetros de consulta
CampoTipoDescrição
queryobrigatóriostringWhat 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

Obter um documento, o seu estado de processamento e a análise mais recente.

Âmbito:DOCUMENTS_READ
Parâmetros de caminho
CampoTipoDescrição
documentIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
idobrigatóriostring
nameobrigatóriostring
originalNameobrigatóriostring
typeobrigatório"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …
mimeTypeobrigatóriostring
sizeobrigatóriointeger
statusobrigatório"PENDING" | "PROCESSING" | "ANALYZED" | "FAILED"PENDING until processing starts; ANALYZED once the analysis is stored
archivedobrigatórioboolean
ownedByYouobrigatórioboolean
versionNumberobrigatóriointeger | 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.
createdAtobrigatóriostringISO 8601 date-time
updatedAtobrigatóriostringISO 8601 date-time
fileAvailableobrigatóriobooleanfalse when the stored file can no longer be read
governingLawRequiredobrigatóriobooleantrue when the analysis is held until a governing law is chosen for the document in Attorly
latestAnalysisobrigatórioobject | null
urlobrigatóriostringWhere 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

Pedir a eliminação de um documento de que é proprietário. O documento só é eliminado quando aprovar a eliminação no Attorly.

Âmbito:DOCUMENTS_DELETE
Parâmetros de caminho
CampoTipoDescrição
documentIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
idobrigatóriostring
deletedobrigatóriobooleantrue only when the document is gone
statusobrigatório"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

Analise um documento ou texto enviado diretamente. mode é full (documento armazenado) ou quick.

Âmbito:DOCUMENTS_ANALYZEDOCUMENTS_READUsa créditos de IA

O campo mode do corpo escolhe uma de: mode: full, mode: quick.

Corpo do pedido
CampoTipoDescrição
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 as análises guardadas de um documento, da mais recente para a mais antiga.

Âmbito:DOCUMENTS_READ
Parâmetros de caminho
CampoTipoDescrição
documentIdobrigatóriostring
Parâmetros de consulta
CampoTipoDescrição
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

Analise um documento armazenado.

Âmbito:DOCUMENTS_ANALYZEDOCUMENTS_READUsa créditos de IA
Parâmetros de caminho
CampoTipoDescrição
documentIdobrigatóriostring

O campo mode do corpo escolhe uma de: mode: full, mode: quick.

Corpo do pedido
CampoTipoDescrição
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

Extraia o texto simples de um documento PDF ou DOCX armazenado.

Âmbito:DOCUMENTS_READ
Parâmetros de caminho
CampoTipoDescrição
documentIdobrigatóriostring
Parâmetros de consulta
CampoTipoDescrição
offsetintegerCharacter offset to start from; pass the nextOffset of the previous call to read on
maxCharactersintegerMost characters to return in this call
Dados da resposta (200)
CampoTipoDescrição
textobrigatóriostringThe document text from offset (untrusted content)
documentNameobrigatóriostring
documentTypeobrigatóriostring
mimeTypeobrigatóriostring | null
characterCountobrigatóriointegerCharacters in the whole document
wordCountobrigatóriointegerWords in the whole document
offsetobrigatóriointeger
nextOffsetobrigatóriointeger | nullPass as offset to read on; null when the text ends here
truncatedobrigatóriobooleantrue 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

Obter uma análise guardada: resumo, risco, termos-chave, cláusulas e recomendações.

Âmbito:DOCUMENTS_READ
Parâmetros de caminho
CampoTipoDescrição
analysisIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
idobrigatóriostring
documentIdobrigatóriostring
documentNameobrigatóriostring
summaryobrigatóriostring | null
riskLevelobrigatório"LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
riskScoreobrigatórionumber
keyTermsobrigatórioarray of any
clausesobrigatórioarray of any
recommendationsobrigatórioarray of any
modeobrigatóriostringSINGLE or CONSENSUS
createdAtobrigatóriostringISO 8601 date-time
urlobrigatóriostring
curl
curl "https://attorly.ai/api/v1/analyses/your_analysisId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/comparisonscreateComparison

Compare dois documentos ou textos linha a linha.

Âmbito:DOCUMENTS_READ
Corpo do pedido
CampoTipoDescrição
sourceDocumentIdstring
sourceContentstring
targetDocumentIdstring
targetContentstring
Dados da resposta (200)
CampoTipoDescrição
differencesobrigatórioarray of object
summaryobrigatórioobject
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

Pesquise na biblioteca de cláusulas.

Âmbito:CLAUSES_READ
Parâmetros de consulta
CampoTipoDescrição
queryobrigatóriostring
category"INDEMNIFICATION" | "LIABILITY" | "TERMINATION" | "CONFIDENTIALITY" | "INTELLECTUAL_PROPERTY" | "PAYMENT" | …
jurisdictionstring
riskLevel"LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
limitinteger
Dados da resposta (200)
CampoTipoDescrição
clausesobrigatórioarray of object
countobrigatóriointeger
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

Avalie o risco de uma cláusula.

Âmbito:CLAUSES_READ
Corpo do pedido
CampoTipoDescrição
clauseTextobrigatóriostring
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" | …
Dados da resposta (200)
CampoTipoDescrição
clauseTextstring
clauseTypeobrigatóriostring
jurisdictionobrigatóriostring
overallRiskScoreobrigatórionumber
riskLevelobrigatório"LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
riskFactorsobrigatórioarray of object
recommendationsobrigatórioarray 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 uma cláusula com a redação habitual do mercado.

Âmbito:CLAUSES_READ
Corpo do pedido
CampoTipoDescrição
clauseTextobrigatóriostring
categoryobrigatório"INDEMNIFICATION" | "LIABILITY" | "TERMINATION" | "CONFIDENTIALITY" | "INTELLECTUAL_PROPERTY" | "PAYMENT" | …
contractTypestring
jurisdictionstring
Dados da resposta (200)
CampoTipoDescrição
inputClauseobrigatóriostring
categoryobrigatóriostring
marketStandardsobrigatórioarray of object
comparisonobrigatórioobject
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

Verifique uma cláusula face a um playbook.

Âmbito:CLAUSES_READ
Corpo do pedido
CampoTipoDescrição
clauseTextobrigatóriostring
playbookIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
playbookNameobrigatóriostring
compliantobrigatórioboolean
violationsobrigatórioarray of string
warningsobrigatórioarray of string
rulesCheckedobrigatóriointeger
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"
}'

Pesquisa

POST/api/v1/research/searchessearchResearch

Pesquise fontes jurídicas como Lovdata, EUR-Lex e CourtListener.

Âmbito:RESEARCH_READUsa créditos de IA
Corpo do pedido
CampoTipoDescrição
queryobrigatóriostring
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
Dados da resposta (200)
CampoTipoDescrição
queryobrigatóriostring
jurisdictionobrigatóriostring
resultsobrigatórioarray of object
totalCountobrigatóriointegerResults 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

Consulte um diploma legal pela sua referência.

Âmbito:RESEARCH_READUsa créditos de IA
Parâmetros de consulta
CampoTipoDescrição
citationobrigatóriostring
jurisdictionobrigatóriostringISO 3166-1 alpha-2 country code, or "EU"
Dados da resposta (200)
CampoTipoDescrição
idobrigatóriostring
titleobrigatóriostring
sourceobrigatóriostring
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"

Propostas de alteração

POST/api/v1/redlinescreateRedlines

Gere propostas de alteração para um documento ou texto.

Âmbito:REDLINES_GENERATEUsa créditos de IA
Corpo do pedido
CampoTipoDescrição
documentIdstring
contentstring
partyRoleobrigatório"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
Dados da resposta (200)
CampoTipoDescrição
changesobrigatórioarray of object
summaryobject
negotiationNotesarray of string
statisticsobrigatórioobject
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

Aceite ou rejeite alterações num documento.

Âmbito:REDLINES_GENERATE
Parâmetros de caminho
CampoTipoDescrição
documentIdobrigatóriostring
Corpo do pedido
CampoTipoDescrição
changesobrigatórioarray of object
Dados da resposta (200)
CampoTipoDescrição
acceptedobrigatóriointeger
rejectedobrigatóriointeger
messageobrigatóriostring
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"
    }
  ]
}'

Negociações

POST/api/v1/negotiations/position-analysescreateNegotiationPositionAnalysis

Analise uma posição negocial.

Âmbito:NEGOTIATIONS_READUsa créditos de IA
Corpo do pedido
CampoTipoDescrição
documentIdstring
contentstring
partyRoleobrigatório"BUYER" | "SELLER" | "LANDLORD" | "TENANT" | "EMPLOYER" | "EMPLOYEE"
contextobject
Dados da resposta (200)
CampoTipoDescrição
overallPositionobrigatóriostringFAVORABLE, BALANCED or UNFAVORABLE
positionsobrigatórioarray 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

Crie um playbook de negociação a partir de uma estratégia.

Âmbito:NEGOTIATIONS_READUsa créditos de IA
Corpo do pedido
CampoTipoDescrição
strategyobrigatórioobject
contextobject
Dados da resposta (200)
CampoTipoDescrição
playbookobrigatórioarray of object
anticipatedObjectionsobrigatórioarray of object
recommendationsobrigatórioarray of string
summaryobrigatórioobject
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"
    ]
  }
}'

Fluxos de trabalho

GET/api/v1/workflows/templateslistWorkflowTemplates

Liste os modelos de fluxo de trabalho.

Âmbito:WORKFLOWS_EXECUTE
Parâmetros de consulta
CampoTipoDescrição
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 execuções de fluxos de trabalho, da mais recente, opcionalmente de um projeto ou estado.

Âmbito:WORKFLOWS_EXECUTE
Parâmetros de consulta
CampoTipoDescrição
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

Inicie um fluxo de trabalho num projeto de due diligence.

Âmbito:WORKFLOWS_EXECUTEUsa créditos de IA
Corpo do pedido
CampoTipoDescrição
templateIdobrigatóriostring
projectIdobrigatóriostring
inputsobrigatórioobject
optionsobject
Dados da resposta (202)
CampoTipoDescrição
executionIdobrigatóriostring
templateIdobrigatóriostring
templateNameobrigatóriostring
statusobrigatóriostring
startedAtobrigatóriostringISO 8601 date-time
messageobrigatóriostring
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

Obtenha o estado da execução de um fluxo de trabalho.

Âmbito:WORKFLOWS_EXECUTE
Parâmetros de caminho
CampoTipoDescrição
executionIdobrigatóriostring
Parâmetros de consulta
CampoTipoDescrição
includeStepsboolean
Dados da resposta (200)
CampoTipoDescrição
executionIdobrigatóriostring
templateNameobrigatóriostring
statusobrigatóriostring
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"

Auditoria jurídica (due diligence)

GET/api/v1/due-diligence/projectslistDueDiligenceProjects

Listar projetos de due diligence, do mais recente para o mais antigo.

Âmbito:DUE_DILIGENCE_FULL
Parâmetros de consulta
CampoTipoDescrição
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

Crie um projeto de due diligence.

Âmbito:DUE_DILIGENCE_FULL
Corpo do pedido
CampoTipoDescrição
nameobrigatóriostring
dealTypeobrigatório"MA_ACQUISITION" | "MA_MERGER" | "INVESTMENT" | "IPO" | "REAL_ESTATE" | "REGULATORY" | …
targetCompanystring
descriptionstring
settingsobject
Dados da resposta (201)
CampoTipoDescrição
projectIdobrigatóriostring
nameobrigatóriostring
projectTypeobrigatóriostring
statusobrigatóriostring
createdAtobrigatóriostringISO 8601 date-time
messageobrigatóriostring
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

Obter um projeto de due diligence com o número de documentos e constatações.

Âmbito:DUE_DILIGENCE_FULL
Parâmetros de caminho
CampoTipoDescrição
projectIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
idobrigatóriostring
nameobrigatóriostring
descriptionobrigatóriostring | null
projectTypeobrigatóriostring
statusobrigatóriostring
priorityobrigatóriostring
targetCompanyobrigatóriostring | null
dueDateobrigatóriostring | null
documentCountobrigatóriointeger
findingCountobrigatóriointeger
createdAtobrigatóriostringISO 8601 date-time
updatedAtobrigatóriostringISO 8601 date-time
completedAtobrigatóriostring | 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

Adicione documentos a um projeto de due diligence.

Âmbito:DUE_DILIGENCE_FULL
Parâmetros de caminho
CampoTipoDescrição
projectIdobrigatóriostring
Corpo do pedido
CampoTipoDescrição
documentIdsobrigatórioarray of string
categorystring
Dados da resposta (200)
CampoTipoDescrição
projectIdobrigatóriostring
documentsAddedobrigatóriointeger
totalDocumentsobrigatóriointeger
categoryobrigatóriostring
messageobrigatóriostring
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 as conclusões de um projeto de due diligence.

Âmbito:DUE_DILIGENCE_FULL
Parâmetros de caminho
CampoTipoDescrição
projectIdobrigatóriostring
Parâmetros de consulta
CampoTipoDescrição
riskLevel"INFO" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
categorystring
limitinteger
Dados da resposta (200)
CampoTipoDescrição
projectIdobrigatóriostring
projectNameobrigatóriostring
findingsobrigatórioarray of object
riskSummaryobrigatórioobjectNumber of findings per severity
totalFindingsobrigatóriointeger
pendingProposalsobrigatóriointegerRisks 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

Gere um relatório de due diligence.

Âmbito:DUE_DILIGENCE_FULL
Parâmetros de caminho
CampoTipoDescrição
projectIdobrigatóriostring
Corpo do pedido
CampoTipoDescrição
formatobrigatório"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
Dados da resposta (201)
CampoTipoDescrição
reportIdobrigatóriostring
projectIdobrigatóriostring
projectNamestring
formatobrigatório"pdf" | "markdown"
statusobrigatóriostring
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
markdownobrigatóriostring
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"
}'

Modelos e minutas

GET/api/v1/templateslistTemplates

Liste os modelos de documentos.

Âmbito:TEMPLATES_READ
Parâmetros de consulta
CampoTipoDescrição
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

Crie uma minuta a partir de um modelo (mode template) ou com IA (mode ai).

Âmbito:TEMPLATES_DRAFTUsa créditos de IA

O campo mode do corpo escolhe uma de: mode: template, mode: ai.

Corpo do pedido
CampoTipoDescrição
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

Listar os seus casos, do alterado mais recentemente para o mais antigo.

Âmbito:CASES_READ
Parâmetros de consulta
CampoTipoDescrição
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

Obter a cronologia de um caso: cada evento com a data, as provas e a posição da outra parte.

Âmbito:CASES_READ
Parâmetros de caminho
CampoTipoDescrição
caseIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
caseobrigatórioobject
eventsobrigatórioarray of objectIn date order
countobrigatóriointeger
needsReviewCountobrigatóriointegerEvents an AI added that no person has confirmed
deletionRequestedCountobrigatóriointegerEvents 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

Adicionar um evento à cronologia de um caso.

Âmbito:CASES_WRITE
Parâmetros de caminho
CampoTipoDescrição
caseIdobrigatóriostring
Corpo do pedido
CampoTipoDescrição
titleobrigatóriostringWhat happened, in one line (at most 300 characters)
descriptionstring | nullMore detail, or null to clear it
whenobrigatórioobjectWhen 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
Dados da resposta (201)
CampoTipoDescrição
caseIdobrigatóriostring
eventobrigatórioobject
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

Alterar um evento da cronologia de um caso, ou confirmar um evento adicionado pela IA.

Âmbito:CASES_WRITE
Parâmetros de caminho
CampoTipoDescrição
caseIdobrigatóriostring
eventIdobrigatóriostring
Corpo do pedido
CampoTipoDescrição
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
Dados da resposta (200)
CampoTipoDescrição
caseIdobrigatóriostring
eventobrigatórioobject
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

Pedir a eliminação de um evento da cronologia de um caso. O evento só é eliminado quando o proprietário o aprovar no Attorly.

Âmbito:CASES_WRITE
Parâmetros de caminho
CampoTipoDescrição
caseIdobrigatóriostring
eventIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
caseIdobrigatóriostring
idobrigatóriostring
deletedobrigatóriobooleantrue only when the event is gone
statusobrigatório"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 a cronologia de um caso como ficheiro PDF, Word, ODT, Excel ou PowerPoint.

Âmbito:CASES_READ
Parâmetros de caminho
CampoTipoDescrição
caseIdobrigatóriostring
Corpo do pedido
CampoTipoDescrição
layoutobrigatório"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
formatobrigatório"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
Dados da resposta (200)
CampoTipoDescrição
caseIdobrigatóriostring
layoutobrigatório"overview" | "chronology" | "numbered" | "visual"
formatobrigatório"pdf" | "docx" | "odt" | "xlsx" | "pptx"
localeobrigatóriostringThe language the file is written in
eventCountobrigatóriointegerEvents in the file
exhibitCountobrigatóriointegerDocuments in the exhibit list (chronology and numbered layouts)
leftOutConfidentialobrigatóriointegerEvents left out because they are marked confidential
attachmentobrigatórioobject
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

Listar os prazos de um caso, do mais próximo ao mais distante, com a indicação de quem é cada prazo e se foi cumprido ou ultrapassado.

Âmbito:CASES_READ
Parâmetros de caminho
CampoTipoDescrição
caseIdobrigatóriostring
Parâmetros de consulta
CampoTipoDescrição
status"open" | "completed"open: not yet marked done; completed: marked done; both when absent
Dados da resposta (200)
CampoTipoDescrição
caseobrigatórioobject
deadlinesobrigatórioarray of objectSoonest first
countobrigatóriointeger
overdueCountobrigatóriointeger
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

Adicionar um prazo a um caso, numa data indicada ou contado a partir de um facto registado.

Âmbito:CASES_WRITE
Parâmetros de caminho
CampoTipoDescrição
caseIdobrigatóriostring
Corpo do pedido
CampoTipoDescrição
titleobrigatóriostringWhat 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
Dados da resposta (201)
CampoTipoDescrição
caseIdobrigatóriostring
deadlineobrigatórioobject
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

Alterar um prazo de um caso, ou marcá-lo como cumprido ou novamente em aberto.

Âmbito:CASES_WRITE
Parâmetros de caminho
CampoTipoDescrição
caseIdobrigatóriostring
deadlineIdobrigatóriostring
Corpo do pedido
CampoTipoDescrição
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
Dados da resposta (200)
CampoTipoDescrição
caseIdobrigatóriostring
deadlineobrigatórioobject
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

Listar os factos registados num caso, com a respetiva fonte, e os factos de que o caso ainda precisa.

Âmbito:CASES_READ
Parâmetros de caminho
CampoTipoDescrição
caseIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
caseobrigatórioobject
factsobrigatórioarray of object
countobrigatóriointeger
caseReadsobrigatórioobject | 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

Registar um facto num caso, ou corrigi-lo. Os prazos contados a partir dele acompanham a alteração.

Âmbito:CASES_WRITE
Parâmetros de caminho
CampoTipoDescrição
caseIdobrigatóriostring
Corpo do pedido
CampoTipoDescrição
keyobrigatóriostringThe 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
valueobrigatóriostringThe 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)
Dados da resposta (200)
CampoTipoDescrição
caseIdobrigatóriostring
outcomeobrigatório"recorded" | "corrected" | "unchanged"recorded: a new fact; corrected: a new value replaced the old one; unchanged: it already held this value
factobrigatórioobject
movedDeadlinesobrigatórioarray of objectOpen deadlines counted from the fact that moved with the correction, due days before and after
urlobrigatóriostringWhere 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

Listar as partes de um caso e os papéis que o caso prevê.

Âmbito:CASES_READ
Parâmetros de caminho
CampoTipoDescrição
caseIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
caseobrigatórioobject
partiesobrigatórioarray of object
countobrigatóriointeger
rolesobrigatórioarray 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

Adicionar uma parte a um caso, num dos seus papéis.

Âmbito:CASES_WRITE
Parâmetros de caminho
CampoTipoDescrição
caseIdobrigatóriostring
Corpo do pedido
CampoTipoDescrição
roleKeyobrigatóriostringThe role the party has in the case, as one of the roles parties_list returns (e.g. "landlord")
partyTypeobrigatório"PERSON" | "ENTITY"PERSON for a person, ENTITY for a company or public body
nameobrigatóriostringThe 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
Dados da resposta (201)
CampoTipoDescrição
caseIdobrigatóriostring
partyobrigatórioobject
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

Alterar os dados de uma parte de um caso.

Âmbito:CASES_WRITE
Parâmetros de caminho
CampoTipoDescrição
caseIdobrigatóriostring
partyIdobrigatóriostring
Corpo do pedido
CampoTipoDescrição
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
Dados da resposta (200)
CampoTipoDescrição
caseIdobrigatóriostring
partyobrigatórioobject
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)"

Operações

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

Obter o estado e o resultado de um pedido enviado com Prefer ou Idempotency-Key.

Parâmetros de caminho
CampoTipoDescrição
operationIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
idobrigatóriostringop_…
objectobrigatório"operation"
operationIdobrigatóriostringThe REST operation that was called, e.g. createRedlines
statusobrigatório"running" | "awaiting_approval" | "succeeded" | "failed"
livemodeobrigatórioboolean
idempotencyKeystring | null
resultUrlobrigatóriostringWhere to poll: /api/v1/operations/{id}
createdAtobrigatóriostring (date-time)
completedAtobrigatóriostring (date-time) | null
expiresAtobrigatóriostring (date-time)
httpStatusobrigatóriointeger | null
resultobrigatórioanyThe data of the successful call
metaobject
errorobrigatórioobject | null
curl
curl "https://attorly.ai/api/v1/operations/op_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"

Webhooks

GET/api/v1/webhook-endpointslistWebhookEndpoints

Listar os endpoints de webhook da organização e do modo da chave.

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

Criar um endpoint de webhook. A resposta contém o segredo de assinatura, mostrado uma única vez.

Corpo do pedido
CampoTipoDescrição
urlobrigatóriostring (uri)HTTPS URL that receives the events
descriptionstring
enabledEventsobrigatórioarray 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.
Dados da resposta (201)
CampoTipoDescrição
idobrigatóriostringwe_…
objectobrigatório"webhook_endpoint"
urlobrigatóriostring
descriptionstring | null
enabledEventsobrigatórioarray of string
statusobrigatório"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemodeobrigatórioboolean
includeSnapshotsobrigatórioboolean
apiVersionobrigatóriostring
failingSincestring (date-time) | null
createdAtobrigatóriostring (date-time)
updatedAtobrigatóriostring (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

Obter um endpoint de webhook.

Parâmetros de caminho
CampoTipoDescrição
endpointIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
idobrigatóriostringwe_…
objectobrigatório"webhook_endpoint"
urlobrigatóriostring
descriptionstring | null
enabledEventsobrigatórioarray of string
statusobrigatório"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemodeobrigatórioboolean
includeSnapshotsobrigatórioboolean
apiVersionobrigatóriostring
failingSincestring (date-time) | null
createdAtobrigatóriostring (date-time)
updatedAtobrigatóriostring (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

Alterar o URL, os eventos ou os instantâneos de um endpoint, ou desativá-lo e reativá-lo.

Parâmetros de caminho
CampoTipoDescrição
endpointIdobrigatóriostring
Corpo do pedido
CampoTipoDescrição
urlstring (uri)
descriptionstring | null
enabledEventsarray of string
includeSnapshotsboolean
status"enabled" | "disabled"Disable to pause deliveries; enable to resume
Dados da resposta (200)
CampoTipoDescrição
idobrigatóriostringwe_…
objectobrigatório"webhook_endpoint"
urlobrigatóriostring
descriptionstring | null
enabledEventsobrigatórioarray of string
statusobrigatório"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemodeobrigatórioboolean
includeSnapshotsobrigatórioboolean
apiVersionobrigatóriostring
failingSincestring (date-time) | null
createdAtobrigatóriostring (date-time)
updatedAtobrigatóriostring (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 um endpoint de webhook e o respetivo histórico de entregas.

Parâmetros de caminho
CampoTipoDescrição
endpointIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
idobrigatóriostring
objectobrigatório"webhook_endpoint"
deletedobrigatóriotrue
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

Substituir o segredo de assinatura. O antigo continua a assinar durante 24 horas.

Parâmetros de caminho
CampoTipoDescrição
endpointIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
idobrigatóriostringwe_…
objectobrigatório"webhook_endpoint"
urlobrigatóriostring
descriptionstring | null
enabledEventsobrigatórioarray of string
statusobrigatório"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemodeobrigatórioboolean
includeSnapshotsobrigatórioboolean
apiVersionobrigatóriostring
failingSincestring (date-time) | null
createdAtobrigatóriostring (date-time)
updatedAtobrigatóriostring (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 um evento webhook_endpoint.test apenas para este endpoint.

Parâmetros de caminho
CampoTipoDescrição
endpointIdobrigatóriostring
Dados da resposta (202)
CampoTipoDescrição
eventIdobrigatóriostring
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 as entregas de um endpoint, da mais recente, com tentativas e resultado.

Parâmetros de caminho
CampoTipoDescrição
endpointIdobrigatóriostring
Parâmetros de consulta
CampoTipoDescrição
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 os eventos dos últimos 30 dias, do mais recente para o mais antigo.

Parâmetros de consulta
CampoTipoDescrição
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

Obter um evento tal como os endpoints de webhook o recebem.

Parâmetros de caminho
CampoTipoDescrição
eventIdobrigatóriostring
Dados da resposta (200)
CampoTipoDescrição
idobrigatóriostringevt_… — also sent as the webhook-id header; deduplicate on it
objectobrigatório"event"
typeobrigatório"analysis.completed" | "analysis.failed" | "redlines.generated" | "due_diligence.report.completed" | "operation.succeeded" | "operation.failed" | …
apiVersionobrigatóriostring
createdAtobrigatóriostring (date-time)
livemodeobrigatórioboolean
dataobrigatórioobject
curl
curl "https://attorly.ai/api/v1/events/your_eventId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/events/{eventId}/redeliveriesredeliverEvent

Enviar novamente um evento, para um endpoint ou para todos os que o subscrevem.

Parâmetros de caminho
CampoTipoDescrição
eventIdobrigatóriostring
Corpo do pedido
CampoTipoDescrição
endpointIdstringOnly this endpoint; default every endpoint subscribed to the event
Dados da resposta (202)
CampoTipoDescrição
eventIdobrigatóriostring
deliveriesScheduledobrigatóriointeger
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"
}'

Conta, utilização e registos

GET/api/v1/organizationgetOrganization

A organização da chave: plano, créditos de IA, jurisdição predefinida e o que a chave pode fazer.

Dados da resposta (200)
CampoTipoDescrição
organizationobrigatórioobject
userobrigatórioobject
planobrigatóriostringSTANDARD, PRO or ENTERPRISE
billingobrigatórioobject
defaultJurisdictionobrigatóriostring | nullISO 3166-1 alpha-2 country used when a document names no governing law
credentialobrigatórioobject
appUrlobrigatóriostring
curl
curl "https://attorly.ai/api/v1/organization" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/usagegetUsage

Pedidos por dia, chave e operação, com o número de erros, por REST e MCP.

Parâmetros de consulta
CampoTipoDescrição
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 os pedidos à API da organização dos últimos 30 dias, do mais recente para o mais antigo.

Parâmetros de consulta
CampoTipoDescrição
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

Quem chamou o quê, quando e com que chave. Para proprietários e administradores da organização.

Parâmetros de consulta
CampoTipoDescrição
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 os objetos, eventos e operações do modo de teste da organização. Apenas chaves de teste.

Dados da resposta (200)
CampoTipoDescrição
objectobrigatório"test_data_purge"
deletedobrigatórioobject
curl
curl -X DELETE "https://attorly.ai/api/v1/test-data" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"