Skip to main content

MRT Outlines API

The MRT Outlines API manages Machine-Readable Template (MRT) outlines that structure document content with hierarchical sections.

Get MRT Outline

Retrieve a complete MRT outline with all sections ordered by index.
GET /api/v1/mrt-outlines/{outline_id}

Path Parameters

ParameterTypeRequiredDescription
outline_idstringYesUUID of outline

Request Example

curl -X GET "https://api.artosai.com/api/v1/mrt-outlines/outline-uuid" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

{
  "outline": {
    "outline_id": "outline-uuid",
    "document_metadata": {
      "document_type": "CSR",
      "created_date": "2024-01-25T12:00:00Z"
    },
    "sections": [
      {
        "section_id": "section-1",
        "order_index": 0,
        "level": 1,
        "title": "Executive Summary",
        "content": "Summary content here"
      },
      {
        "section_id": "section-2",
        "order_index": 1,
        "level": 1,
        "title": "Methodology",
        "content": "Methodology content here"
      }
    ],
    "created_at": "2024-01-20T10:00:00Z",
    "updated_at": "2024-01-25T12:00:00Z"
  }
}

Status Codes

  • 200 OK: Outline retrieved successfully
  • 400 Bad Request: Authentication failed or outline not found
  • 403 Forbidden: User not authorized (different organization)
  • 500 Internal Server Error: Database error

Update MRT Outline

Full replacement (PUT) of an MRT outline. All existing sections are deleted and replaced with provided structure.
PUT /api/v1/mrt-outlines/{outline_id}

Path Parameters

ParameterTypeRequiredDescription
outline_idstringYesUUID of outline

Request Body

{
  "document_metadata": {
    "document_type": "CSR",
    "version": "2024-Q1"
  },
  "connector_data_id": "connector-uuid",
  "endpoint_analysis": "Analysis results",
  "rule_type_to_table_like_status": {
    "extraction": "table",
    "summary": "text"
  },
  "sections": [
    {
      "section_id": "section-1",
      "order_index": 0,
      "level": 1,
      "title": "Executive Summary",
      "content": "New content",
      "subsections": []
    },
    {
      "section_id": "section-2",
      "order_index": 1,
      "level": 1,
      "title": "Methodology",
      "content": "Method content"
    }
  ]
}

Request Parameters

ParameterTypeRequiredDescription
document_metadataobjectYesOutline metadata
sectionsarrayYesSection dictionaries (at least one required)
connector_data_idstringNoData connector ID
endpoint_analysisstringNoAnalysis text
rule_type_to_table_like_statusobjectNoRule type mappings

Section Parameters

Each section must include:
ParameterTypeRequiredDescription
section_idstringYesUnique section identifier
order_indexintegerYesPosition in outline
levelintegerYesNesting level
titlestringYesSection title
contentstringNoSection content

Request Example

curl -X PUT "https://api.artosai.com/api/v1/mrt-outlines/outline-uuid" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "document_metadata": {
      "document_type": "CSR"
    },
    "sections": [
      {
        "section_id": "section-1",
        "order_index": 0,
        "level": 1,
        "title": "Executive Summary",
        "content": "Updated content"
      }
    ]
  }'

Python Example

import requests

url = "https://api.artosai.com/api/v1/mrt-outlines/outline-uuid"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json"
}

payload = {
    "document_metadata": {"document_type": "CSR"},
    "sections": [
        {
            "section_id": "section-1",
            "order_index": 0,
            "level": 1,
            "title": "Executive Summary",
            "content": "Updated content"
        }
    ]
}

response = requests.put(url, headers=headers, json=payload)
outline = response.json()
print(f"Updated outline: {outline}")

Response

{
  "outline": {
    "outline_id": "outline-uuid",
    "document_metadata": {
      "document_type": "CSR"
    },
    "sections": [
      {
        "section_id": "section-1",
        "order_index": 0,
        "level": 1,
        "title": "Executive Summary",
        "content": "Updated content"
      }
    ],
    "created_at": "2024-01-20T10:00:00Z",
    "updated_at": "2024-01-25T13:00:00Z"
  }
}

Status Codes

  • 200 OK: Outline updated successfully
  • 400 Bad Request: Invalid outline structure or missing sections
  • 401 Unauthorized: Missing or invalid Bearer token
  • 403 Forbidden: User not authorized
  • 404 Not Found: Outline not found
  • 500 Internal Server Error: Database error

Important Notes

  • Full Replacement: This is a PUT operation, not a PATCH. All sections are replaced.
  • Section Order: order_index must be unique across all sections
  • Hierarchical Structure: Sections support multiple nesting levels via the level parameter
  • Cascading Delete: Old sections and all associated data are deleted before insert