> ## Documentation Index
> Fetch the complete documentation index at: https://docs.artanis.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# REST API Overview

> Base URL, project parameters, and response shapes

## Base URL

```
https://app.artanis.ai
```

For self-hosted deployments, substitute your own host.

## Identifying a project

Every list endpoint requires you to identify which project to read from. You can pass either:

| Query parameter | Example                   | When to use                                        |
| --------------- | ------------------------- | -------------------------------------------------- |
| `projectSlug`   | `?projectSlug=my-project` | Most cases — the slug is stable and human-readable |
| `projectId`     | `?projectId=4f8c...`      | When you already have the internal UUID            |

Detail endpoints (e.g. `GET /api/prompts/{id}`) take the resource ID directly in the path and do not need a project parameter.

## Response shape

All endpoints return JSON. List endpoints wrap their results in a top-level key matching the resource name:

```json theme={null}
{
  "prompts": [ ... ]
}
```

Detail endpoints return the resource object directly:

```json theme={null}
{
  "id": "...",
  "stepId": "...",
  ...
}
```

Timestamps are ISO 8601 strings in UTC.

## Errors

| Status | Body                                                | Cause                                         |
| ------ | --------------------------------------------------- | --------------------------------------------- |
| `400`  | `{"error": "projectSlug or projectId is required"}` | Missing required query param                  |
| `401`  | `{"error": "Not authenticated"}`                    | Missing or invalid credentials                |
| `403`  | `{"error": "Forbidden"}`                            | Resource does not belong to your organization |
| `404`  | `{"error": "Not found"}`                            | Resource does not exist                       |

## Endpoints

<CardGroup cols={2}>
  <Card title="Prompts" icon="message" href="/rest-api/prompts">
    Active prompt versions and version history
  </Card>

  <Card title="Knowledge Docs" icon="book" href="/rest-api/knowledge-docs">
    Knowledge base documents and version history
  </Card>

  <Card title="Traces" icon="diagram-project" href="/rest-api/traces">
    Traces, spans, approved outputs, and feedback
  </Card>
</CardGroup>
