# Export evidence

Exports evidence based on date range.

Endpoint: POST /export/evidences
Version: 1.0.0
Security: ApiToken

## Request fields (application/json):

  - `createdAtStart` (string)
    ISO 8601 date string.
    Example: "2024-12-01T00:00:00.000Z"

  - `createdAtEnd` (string)
    ISO 8601 date string.
    Example: "2024-12-26T00:00:00.000Z"

## Response 200 fields (application/json):

  - `evidences` (array)

  - `evidences.id` (string)
    Unique Bagel ID for the evidence
    Example: "evid123"

  - `evidences.title` (string)
    The title of the evidence
    Example: "Evidence for Compliance"

  - `evidences.origin` (string)
    The source system where this evidence was created (can be Bagel or external apps like Salesforce, Zendesk, etc.)
    Example: "System"

  - `evidences.origin_id` (string)
    Optional ID of the item that this evidence originated from in the external system
    Example: "orig5678"

  - `evidences.description` (string)
    The description of the evidence
    Example: "Supporting evidence for compliance case."

  - `evidences.priority` (string)
    The priority of the evidence, usually set to default and can be selected when evidences are created from GTM apps
    Example: "Medium"

  - `evidences.domain` (string)
    Broad business domains that are often connected to several product areas. These represent the main domains of the company.
    Example: "Legal"

  - `evidences.product_area` (string)
    More specific area of the business product related to the idea
    Example: "Risk Management"

  - `evidences.product_sub_area` (string)
    Further refines the product categorization
    Example: "Fraud Detection"

  - `evidences.type` (string)
    The type of evidence. Can be either 'gap' or 'request'.
- 'gap': Evidence automatically extracted from various data sources such as:
  * Support calls and interactions
  * Customer surveys
  * Customer feedback
  * And other customer touchpoint data
  These represent identified gaps.

- 'request': Evidence created and submitted primarily by GTM teams using their apps (Salesforce, Zendesk) or created inside Bagel platform by Bagel users.
    Enum: "gap", "request", null

  - `evidences.state` (string)
    The state of the evidence (formerly known as status). Only applicable for evidence of type 'request' as these go through a review process.
Evidence of type 'gap' are considered connected to an idea simply by having an ideaId or not.

Possible states:
- 'inReview': The evidence request is waiting for review
- 'assigned': The evidence has been assigned to idea
- 'dismissed': The evidence request has been dismissed/rejected
- null: state for 'gap' evidence
    Enum: "inReview", "assigned", "dismissed", null

  - `evidences.business_name` (string)
    The business name of the evidence
    Example: "Acme Corp"

  - `evidences.source` (string)
    The source of the evidence
    Example: "Internal Audit"

  - `evidences.owner` (object)
    A Bagel user who is set as the owner of this evidence. Ownership is typically assigned automatically 
based on the evidence's product area - each product area in Bagel settings has a designated owner, 
and when evidence is created or assigned to a product area, its owner is set to match that area's owner.

  - `evidences.owner.id` (string)
    The owner's unique identifier in Bagel
    Example: "owner123"

  - `evidences.owner.name` (string)
    The owner's name
    Example: "John Smith"

  - `evidences.owner.email` (string)
    The owner's email address
    Example: "john.smith@example.com"

  - `evidences.delivery_item` (object)
    External item (usually a Jira issue) that is inherited from the associated idea. 
This field is present when the evidence has either:
- ideaId: Direct connection to an idea
- gtmIdeaId: Connection to an idea suggested by GTM team during request submission

The delivery item details mirror those of the connected idea's delivery item.

  - `evidences.delivery_item.id` (string)
    The delivery item Bagel ID
    Example: "delivery567"

  - `evidences.delivery_item.origin` (string)
    The source system of this delivery item
    Example: "jira"

  - `evidences.delivery_item.origin_id` (string)
    The ID of the delivery item in the external system
    Example: "JIRA-123"

  - `evidences.delivery_item.title` (string)
    The title of the delivery item
    Example: "2FA Implementation"

  - `evidences.delivery_item.description` (string)
    The description of the delivery item
    Example: "Implement 2FA for all users with support for Google Authenticator, Microsoft Authenticator, and SMS. should support setting policy for different roles."

  - `evidences.delivery_item.status` (string)
    The current status of the linked external item/issue
    Example: "Completed"

  - `evidences.delivery_item.link` (string)
    Direct link to access the item/issue in the external system
    Example: "https://delivery.example.com/item/567"

  - `evidences.origin_object` (object)

  - `evidences.origin_object.id` (string)
    The related item Id
    Example: "12345"

  - `evidences.origin_object.origin` (string)
    The related item origin
    Example: "salesforce"

  - `evidences.origin_object.origin_id` (string)
    The related item Id at origin
    Example: "sFOpportunity123"

  - `evidences.origin_object.title` (string)
    The title of the item
    Example: "Opportunity Title"

  - `evidences.origin_object.description` (string)
    The description of the item
    Example: "Opportunity Description"

  - `evidences.origin_object.type` (string)
    The type of the item
    Example: "opportunity"

  - `evidences.origin_object.link` (string)
    The link of item
    Example: "https://example.salforce.com/item/567"

  - `evidences.gtm_idea` (object)
    Represents an idea that was suggested by the GTM team during evidence submission.
When GTM teams submit evidence through their apps (like Salesforce or Zendesk),
they can suggest an existing idea that this evidence should be connected to.
This is different from a direct idea connection and serves as a suggestion
that can be reviewed by the evidence owner.

  - `evidences.gtm_idea.id` (string)
    The ID of the suggested idea
    Example: "idea789"

  - `evidences.gtm_idea.status` (string)
    The current status of the suggested idea
    Example: "Implemented"

  - `evidences.gtm_idea.title` (string)
    The title of the suggested idea
    Example: "Streamlined Workflow"

  - `evidences.submitter` (object)
    Information about the user who submitted the request. Only present for evidence of type 'request'.
Not applicable for evidence of type 'gap'.

  - `evidences.submitter.id` (string)
    The submitter's unique identifier in bagel
    Example: "submit123"

  - `evidences.submitter.name` (string)
    The submitter's name
    Example: "Alice Johnson"

  - `evidences.submitter.email` (string)
    The submitter's email address
    Example: "alice.johnson@example.com"

  - `evidences.company` (object)
    The company/account linked to this evidence. The connection is established differently based on evidence type and origin:
- For Salesforce submissions: Automatically set based on the account from which the evidence was submitted
- For Zendesk/Chrome extension: Manually set during submission
- For 'gap' type evidence: Set to the account connected to the item from which the gap was extracted

Company IDs from different systems are stored to maintain proper linking across integrations.
Currently supports Salesforce and Zendesk as primary sources.

  - `evidences.company.external_id` (string)
    Generic external identifier for the company
    Example: "comp123"

  - `evidences.company.name` (string)
    The company's display name
    Example: "Tech Solutions Inc."

  - `evidences.company.intercom_id` (string)
    The company's Intercom identifier
    Example: "intercom567"

  - `evidences.company.sf_id` (string)
    The company's Salesforce account ID
    Example: "sf789"

  - `evidences.company.zendesk_id` (string)
    The company's Zendesk organization ID
    Example: "zendesk456"

  - `evidences.company.crm_id` (string)
    The company's CRM identifier (typically matches Salesforce ID)
    Example: "001Rt000001i4OsTQZ"

  - `evidences.reject_info` (object)
    Information about the rejection of an evidence request. This is only present when a GTM-submitted evidence 
has been rejected by a Product Manager during the review process. This helps track why and by whom 
the evidence request was rejected.

  - `evidences.reject_info.reason` (string)
    The reason category selected for rejecting the evidence request
    Example: "Insufficient data"

  - `evidences.reject_info.comment` (string)
    Additional explanation provided by the PM for the rejection
    Example: "Please provide additional supporting documents."

  - `evidences.reject_info.rejected_at` (string)
    Timestamp when the evidence was rejected by the PM
    Example: "2023-12-01T00:00:00.000Z"

  - `evidences.reject_info.rejecting_user` (object)
    Information about the Product Manager who rejected the evidence

  - `evidences.reject_info.rejecting_user.id` (string)
    The PM's unique identifier in bagel
    Example: "rejectuser123"

  - `evidences.reject_info.rejecting_user.name` (string)
    The PM's name
    Example: "Bob Carter"

  - `evidences.reject_info.rejecting_user.email` (string)
    The PM's email address
    Example: "bob.carter@example.com"

  - `evidences.createdAt` (string)
    The creation date of the evidence
    Example: "2023-12-01T10:00:00.000Z"

  - `evidences.updatedAt` (string)
    The last updated date of the evidence
    Example: "2023-12-05T15:00:00.000Z"


## Response 400 fields

## Response 401 fields

## Response 500 fields
