---
schema_version: "1"
id: d7a289d8897cdbbdb9ba930d2e998767474ed604058cf547739b3422251a6be3
title: Citations Apex Classes
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce/references/citations/citations-reference.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce/references/citations/citations-reference.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 104898c8dbe38f1a02419eb1318aa7b4984040c65ee57149febea74e0d5f45d2
products:
  - Agentforce Developer Guide
  - Agentforce and Einstein Generative AI
---
# Citations Apex Classes

This page contains the reference material for citations in Apex. For a guide on using these classes, see [Get Started with Citations Apex](/docs/ai/agentforce/guide/citations.html). To generate inline citations via the Agent API, see [Agent API Examples](/docs/ai/agentforce/guide/agent-api-examples.html).

## GenAiCitationInput

This class contains the data that an action returns to the Agentforce reasoning engine. The reasoning engine can then use this data if the citations service is called.

| Property  | Type                                          | Description               |
| :-------- | :-------------------------------------------- | :------------------------ |
| inputText | string                                        | The data from the action. |
| sources   | [GenAiSourceReference](#genaisourcereference) | The source information.   |

### GenAiSourceReference

Represents a source of information for generating citations.

| Property | Type                                                  | Description                           |
| :------- | :---------------------------------------------------- | :------------------------------------ |
| id       | string                                                | The ID of the source information.     |
| contents | [GenAiSourceContentInfo](#genaisourcecontentinfo)     | The content of the source information |
| metadata | [GenAiSourceReferenceInfo](#genaisourcereferenceinfo) | Metadata on the source information.   |

#### GenAiSourceContentInfo

Represents specific content from a source that's being cited.

| Property   | Type   | Description                                                    |
| :--------- | :----- | :------------------------------------------------------------- |
| fieldName  | string | Not required. The name of the field from the source.           |
| objectName | string | Not required. The object that the source data originates from. |
| content    | string | The data from the source.                                      |

#### GenAiSourceReferenceInfo

Represents metadata for a source reference.

| Property                | Type   | Description                      |
| :---------------------- | :----- | :------------------------------- |
| link                    | string | A link to the source content.    |
| source_object_record_id | string | The ID for the source object.    |
| source_object_api_name  | string | The API name for the source.     |
| label                   | string | The custom label for the source. |

## GenAiCitationOutput

This class enables actions to directly provide citations for responses without calling the citations service through the Agentforce reasoning engine. This class closely resembles the output of the citations service.

| Property   | Type                                        | Description                |
| :--------- | :------------------------------------------ | :------------------------- |
| references | [GenAiCitedReference](#genaicitedreference) | The reference to a source. |

### GenAiCitedReference

Represents a citation or reference to a source.

| Property | Type                                                | Description                |
| :------- | :-------------------------------------------------- | :------------------------- |
| metadata | [GenAiCitedReferenceInfo](#genaicitedreferenceinfo) | The metadata for a source. |

#### GenAiCitedReferenceInfo

Represents metadata for a cited reference.

| Property                | Type   | Description                         |
| :---------------------- | :----- | :---------------------------------- |
| link                    | string | A link to the cited source content. |
| source_object_record_id | string | The ID for the source object.       |
| source_object_api_name  | string | The API name for the source.        |
| label                   | string | The custom label for the source.    |
