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

# List Artifacts

Retrieve a list of artifacts for your account.

## Request

<ParamField query="limit" type="integer">
  Number of artifacts to return (default: 20, max: 100)
</ParamField>

<ParamField query="offset" type="integer">
  Number of artifacts to skip for pagination
</ParamField>

<ParamField query="template" type="string">
  Filter by template type: `markdown`, `chart`, `table`, `pdf`
</ParamField>

<ParamField query="status" type="string">
  Filter by status: `active`, `expired`, `deleted`
</ParamField>

<ParamField query="sort" type="string">
  Sort order: `createdAt`, `-createdAt` (default: `-createdAt`)
</ParamField>

## Response

<ResponseField name="data" type="array">
  Array of artifact objects
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination metadata with `total`, `limit`, `offset`, `hasMore`
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": [
      {
        "id": "art_abc123",
        "template": "markdown",
        "title": "My Document",
        "status": "active",
        "createdAt": "2024-01-15T12:00:00Z"
      },
      {
        "id": "art_def456",
        "template": "chart",
        "title": "Sales Report",
        "status": "active",
        "createdAt": "2024-01-14T10:00:00Z"
      }
    ],
    "pagination": {
      "total": 42,
      "limit": 20,
      "offset": 0,
      "hasMore": true
    }
  }
  ```
</ResponseExample>

## Code Examples

<CodeGroup>
  ```bash curl theme={null}
  curl -X GET "https://genui.sh/api/artifacts?limit=10&template=markdown" \
    -H "Authorization: Bearer $GENUI_API_KEY"
  ```

  ```python Python theme={null}
  import requests
  import os

  response = requests.get(
      "https://genui.sh/api/artifacts",
      headers={"Authorization": f"Bearer {os.environ['GENUI_API_KEY']}"},
      params={"limit": 10, "template": "markdown"}
  )
  data = response.json()
  for artifact in data["data"]:
      print(f"{artifact['id']}: {artifact['title']}")
  ```

  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({ limit: '10', template: 'markdown' });
  const response = await fetch(`https://genui.sh/api/artifacts?${params}`, {
    headers: {
      'Authorization': `Bearer ${process.env.GENUI_API_KEY}`
    }
  });
  const { data, pagination } = await response.json();
  data.forEach(artifact => console.log(`${artifact.id}: ${artifact.title}`));
  ```

  ```go Go theme={null}
  req, _ := http.NewRequest("GET", "https://genui.sh/api/artifacts?limit=10&template=markdown", nil)
  req.Header.Set("Authorization", "Bearer "+os.Getenv("GENUI_API_KEY"))

  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()

  var result map[string]interface{}
  json.NewDecoder(resp.Body).Decode(&result)
  ```

  ```ruby Ruby theme={null}
  uri = URI('https://genui.sh/api/artifacts')
  uri.query = URI.encode_www_form(limit: 10, template: 'markdown')

  request = Net::HTTP::Get.new(uri)
  request['Authorization'] = "Bearer #{ENV['GENUI_API_KEY']}"

  response = http.request(request)
  data = JSON.parse(response.body)
  data['data'].each { |artifact| puts "#{artifact['id']}: #{artifact['title']}" }
  ```

  ```rust Rust theme={null}
  let response = client
      .get("https://genui.sh/api/artifacts")
      .header("Authorization", format!("Bearer {}", api_key))
      .query(&[("limit", "10"), ("template", "markdown")])
      .send()
      .await?;

  let data: serde_json::Value = response.json().await?;
  ```

  ```csharp .NET theme={null}
  var response = await client.GetAsync("https://genui.sh/api/artifacts?limit=10&template=markdown");
  var data = await response.Content.ReadFromJsonAsync<JsonElement>();

  foreach (var artifact in data.GetProperty("data").EnumerateArray())
  {
      Console.WriteLine($"{artifact.GetProperty("id")}: {artifact.GetProperty("title")}");
  }
  ```
</CodeGroup>
