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

# Get Artifact

Retrieve a single artifact by ID.

## Request

<ParamField path="id" type="string" required>
  The artifact ID (format: `art_xxx`)
</ParamField>

## Response

<ResponseField name="id" type="string">
  Unique artifact ID
</ResponseField>

<ResponseField name="template" type="string">
  Template type used
</ResponseField>

<ResponseField name="title" type="string">
  Display title
</ResponseField>

<ResponseField name="description" type="string">
  Description text
</ResponseField>

<ResponseField name="content" type="object">
  The artifact's content object
</ResponseField>

<ResponseField name="status" type="string">
  Current status: `active`, `expired`, `deleted`
</ResponseField>

<ResponseField name="metadata" type="object">
  Custom metadata key-value pairs
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 creation timestamp
</ResponseField>

<ResponseField name="updatedAt" type="string">
  ISO 8601 last update timestamp
</ResponseField>

<ResponseField name="expiresAt" type="string">
  ISO 8601 expiration timestamp (if set)
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "art_abc123",
    "template": "markdown",
    "title": "My Document",
    "description": "A sample document",
    "content": {
      "text": "# Hello World\n\nThis is my artifact."
    },
    "status": "active",
    "metadata": {
      "author": "john@example.com"
    },
    "createdAt": "2024-01-15T12:00:00Z",
    "updatedAt": "2024-01-15T12:00:00Z",
    "expiresAt": "2024-01-22T12:00:00Z"
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "not_found",
      "message": "Artifact not found"
    }
  }
  ```
</ResponseExample>

## Code Examples

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

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

  artifact_id = "art_abc123"
  response = requests.get(
      f"https://genui.sh/api/artifacts/{artifact_id}",
      headers={"Authorization": f"Bearer {os.environ['GENUI_API_KEY']}"}
  )
  artifact = response.json()
  print(f"Title: {artifact['title']}")
  print(f"Status: {artifact['status']}")
  ```

  ```javascript JavaScript theme={null}
  const artifactId = 'art_abc123';
  const response = await fetch(`https://genui.sh/api/artifacts/${artifactId}`, {
    headers: {
      'Authorization': `Bearer ${process.env.GENUI_API_KEY}`
    }
  });
  const artifact = await response.json();
  console.log(`Title: ${artifact.title}`);
  console.log(`Status: ${artifact.status}`);
  ```

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

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

  var artifact map[string]interface{}
  json.NewDecoder(resp.Body).Decode(&artifact)
  fmt.Printf("Title: %s\n", artifact["title"])
  ```

  ```ruby Ruby theme={null}
  artifact_id = 'art_abc123'
  uri = URI("https://genui.sh/api/artifacts/#{artifact_id}")

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

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

  ```rust Rust theme={null}
  let artifact_id = "art_abc123";
  let response = client
      .get(format!("https://genui.sh/api/artifacts/{}", artifact_id))
      .header("Authorization", format!("Bearer {}", api_key))
      .send()
      .await?;

  let artifact: serde_json::Value = response.json().await?;
  println!("Title: {}", artifact["title"]);
  ```

  ```csharp .NET theme={null}
  var artifactId = "art_abc123";
  var response = await client.GetAsync($"https://genui.sh/api/artifacts/{artifactId}");
  var artifact = await response.Content.ReadFromJsonAsync<JsonElement>();
  Console.WriteLine($"Title: {artifact.GetProperty("title")}");
  ```
</CodeGroup>
