> For the complete documentation index, see [llms.txt](https://integrations.impact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integrations.impact.com/brand-api-reference/brand-api-reference-v12/reference/contracts/contracts.md).

# Contracts

## List All Contracts

> Returns a list of contracts for a specific campaign, with options for filtering by date, status, and other attributes.

```json
{"openapi":"3.1.0","info":{"title":"Brand API - Contracts","version":"v12"},"servers":[{"url":"https://api.impact.com"}],"paths":{"/Advertisers/{AccountSID}/Campaigns/{CampaignId}/Contracts":{"get":{"summary":"List All Contracts","description":"Returns a list of contracts for a specific campaign, with options for filtering by date, status, and other attributes.","operationId":"listContracts","tags":["Contracts"],"parameters":[{"name":"AccountSID","in":"path","required":true,"schema":{"type":"string"},"description":"The unique identifier for the account."},{"name":"CampaignId","in":"path","required":true,"schema":{"type":"integer"},"description":"The ID of the campaign (program) to retrieve contracts from."},{"name":"DateLastUpdatedBefore","in":"query","schema":{"type":"string","format":"date-time"},"description":"Return contracts updated before a specific date and time."},{"name":"DateLastUpdatedAfter","in":"query","schema":{"type":"string","format":"date-time"},"description":"Return contracts updated after a specific date and time."},{"name":"StartDateBefore","in":"query","schema":{"type":"string","format":"date-time"},"description":"Return contracts that start before a specific date and time."},{"name":"StartDateAfter","in":"query","schema":{"type":"string","format":"date-time"},"description":"Return contracts that start after a specific date and time."},{"name":"EndDateBefore","in":"query","schema":{"type":"string","format":"date-time"},"description":"Return contracts that end before a specific date and time."},{"name":"EndDateAfter","in":"query","schema":{"type":"string","format":"date-time"},"description":"Return contracts that end after a specific date and time."},{"name":"PartnerId","in":"query","schema":{"type":"integer"},"description":"Filter contracts for a specific partner."},{"name":"Signatory","in":"query","schema":{"type":"string"},"description":"Search for contracts by brand or partner signatory."},{"name":"Status","in":"query","schema":{"type":"string","enum":["ACTIVE","DECLINED","EXPIRED","PENDING","UPCOMING"]},"description":"Filter contracts by status. Defaults to ACTIVE if not specified."},{"name":"TemplateId","in":"query","schema":{"type":"integer"},"description":"Filter contracts by the source Template Terms ID."}],"responses":{"200":{"description":"A paginated list of contract objects.","content":{"application/json":{"schema":{"type":"object","properties":{"Contracts":{"type":"array","description":"The list of contract objects.","items":{"$ref":"#/components/schemas/Contract"}}}}}}}}}}},"components":{"schemas":{"Contract":{"type":"object","properties":{"Id":{"type":"string","description":"The unique identifier for the contract."},"PartnerId":{"type":"integer","description":"The unique identifier of the partner the contract is with."},"PartnerValue1":{"type":"string","description":"A custom value associated with the partner."},"Status":{"type":"string","description":"The current status of the contract.","enum":["ACTIVE","EXPIRED"]},"StartDate":{"type":"string","format":"date-time","description":"The date and time the contract becomes active."},"EndDate":{"type":"string","format":"date-time","nullable":true,"description":"The date and time the contract expires. Null for open-ended contracts."},"BrandSignatory":{"type":"string","description":"The name of the brand representative who signed the contract."},"BrandSignatoryDate":{"type":"string","format":"date-time","description":"The date and time the brand signed the contract."},"PartnerSignatory":{"type":"string","description":"The name of the partner representative who signed the contract."},"PartnerSignatoryDate":{"type":"string","format":"date-time","description":"The date and time the partner signed the contract."},"DateCreated":{"type":"string","format":"date-time","description":"The date and time the contract was created."},"DateLastUpdated":{"type":"string","format":"date-time","description":"The date and time the contract was last updated."},"TemplateTerms":{"$ref":"#/components/schemas/TemplateTerms","description":"The template terms underlying this contract."},"PdfUri":{"type":"string","format":"uri-reference","description":"The URI to download the contract as a PDF."},"Uri":{"type":"string","format":"uri-reference","description":"The unique reference to this contract in the impact.com API."}}},"TemplateTerms":{"type":"object","properties":{"TemplateId":{"type":"integer","description":"Unique identifier for the template terms."},"VersionId":{"type":"string","description":"Version number of the template terms."},"Name":{"type":"string","description":"Display name for the template terms."},"Labels":{"type":"array","description":"Labels assigned to these template terms.","items":{"type":"string"}},"Currency":{"type":"string","description":"Three-letter ISO 4217 currency code for payouts."},"EventPayouts":{"type":"array","description":"Payout configurations per event type.","items":{"$ref":"#/components/schemas/EventPayout"}},"PromotionalTerms":{"type":"array","description":"Additional promotional terms attached to the contract.","items":{"$ref":"#/components/schemas/PromotionalTerm"}},"ChangeNotificationPeriod":{"type":"integer","description":"Number of days notice required before changes take effect."},"ReturnPolicy":{"type":"string","description":"How returns are handled for actions under this contract.","enum":["ALWAYS_OK","MP_APPROVAL_REQ","NO_RETURNS"]},"MaxReturnPercentage":{"type":"integer","description":"Maximum return rate percentage allowed."},"ActionLimit":{"type":"integer","description":"Maximum number of actions allowed within the action limit period."},"ActionLimitPeriod":{"type":"string","description":"The time window for the action limit.","enum":["DAY","WEEK","MONTH","QUARTER","IO_DURATION"]},"SpendLimit":{"type":"number","format":"decimal","description":"Maximum payout spend allowed within the spend limit period."},"SpendLimitPeriod":{"type":"string","description":"The time window for the spend limit.","enum":["DAY","WEEK","MONTH","QUARTER","IO_DURATION"]},"MinEarningPerClick":{"type":"number","format":"decimal","description":"Minimum earnings per click required."},"ContractStartSlottingFee":{"type":"number","format":"decimal","description":"Fee charged to the partner when the contract starts."},"FirstActionSlottingFee":{"type":"number","format":"decimal","nullable":true,"description":"Fee charged to the partner on their first action."},"MonthlySlottingFee":{"type":"number","format":"decimal","nullable":true,"description":"Monthly fee charged to the partner."},"CustomCreativePayer":{"type":"string","description":"Which party pays for custom creative work.","enum":["ADVERTISER","PUBLISHER","NOT_APPLICABLE"]}}},"EventPayout":{"type":"object","properties":{"EventTypeId":{"type":"integer","description":"Unique identifier for the event type."},"EventTypeName":{"type":"string","description":"Display name of the event type."},"EventCategory":{"type":"string","description":"Category of the event.","enum":["LEAD","SALE","DOWNLOAD","PAGE_VISIT","CALL_PER_RING","CALL_PER_DURATION","CALL_PER_CONVERSATION","PARTNER_REFERRAL","DATA_POST","OFFLINE","CLICK","MOBILE_APP"]},"DefaultPayout":{"type":"number","format":"decimal","description":"Default flat payout amount for the event."},"DefaultPayoutRate":{"type":"number","format":"decimal","description":"Default percentage payout rate for the event."},"PayoutLevel":{"type":"string","description":"Whether payout is calculated per item, order, click, or call.","enum":["ITEM","ORDER","CLICK","CALL"]},"PayoutGroups":{"type":"array","description":"Conditional payout groups for this event type.","items":{"$ref":"#/components/schemas/PayoutGroup"}},"PayoutAdjustments":{"type":"array","description":"Payout adjustment rules applied conditionally.","items":{"$ref":"#/components/schemas/PayoutAdjustment"}},"PerformanceBonus":{"$ref":"#/components/schemas/PerformanceBonus","description":"Performance bonus configuration for the event type."},"PayoutRestrictions":{"type":"array","description":"Restrictions that prevent payout when certain conditions are met.","items":{"$ref":"#/components/schemas/PayoutRestriction"}},"Limits":{"type":"array","description":"Payout or volume limits applied to this event.","items":{"$ref":"#/components/schemas/PayoutLimit"}},"Locking":{"$ref":"#/components/schemas/Locking","description":"Locking schedule that determines when payouts are finalized."},"PayoutScheduling":{"$ref":"#/components/schemas/PayoutScheduling","description":"Schedule for when payouts become available."},"CreditPolicy":{"type":"string","description":"How credit is assigned across referrers in the conversion path.","enum":["LAST_REFERRER","FIRST_REFERRER","LAST_TO_CART","FIRST_TO_CART","PARENT_ACTION"]},"ValidReferrals":{"type":"array","description":"Configuration for valid referral types and attribution windows.","items":{"$ref":"#/components/schemas/ValidReferral"}}}},"PayoutGroup":{"type":"object","properties":{"Id":{"type":"string","format":"uuid","description":"Select the option that best describes how you use impact.com"},"Rank":{"type":"integer"},"Rules":{"type":"array","items":{"$ref":"#/components/schemas/PayoutRule"}},"Payout":{"type":"number","format":"decimal"},"PayoutRate":{"type":"number","format":"decimal"},"Limits":{"type":"array","items":{"$ref":"#/components/schemas/PayoutLimit"}},"Tiers":{"type":"array","items":{"$ref":"#/components/schemas/PayoutTier"}}}},"PayoutRule":{"type":"object","properties":{"Variable":{"type":"string"},"Operator":{"type":"string"},"Values":{"type":"array","items":{"type":"string"}}}},"PayoutLimit":{"type":"object","properties":{"Type":{"type":"string","enum":["CLICKS","ITEM","PAYOUT","ACTION","CONCURRENT_CALLS"]},"Subtype":{"type":"string","enum":["SKU","CATEGORY","TEXT2"],"nullable":true},"Value":{"type":"number","format":"decimal"},"LimitBy":{"type":"string","enum":["ITEM","ORDER","CUSTOMER","CLICK","CALLER_ID"]},"Period":{"type":"string","enum":["DAY","WEEK","MONTH","QUARTER","CONTRACT_DURATION"]},"WeekendOverrideValue":{"type":"integer"}}},"PayoutTier":{"type":"object","properties":{"RevenueThreshold":{"type":"number","format":"decimal"},"ActionThreshold":{"type":"integer"},"ParentTier":{"type":"integer"},"Payout":{"type":"number","format":"decimal"},"PayoutRate":{"type":"number","format":"decimal"}}},"PayoutAdjustment":{"type":"object","properties":{"Id":{"type":"string","format":"uuid","description":"Select the option that best describes how you use impact.com"},"Rules":{"type":"array","items":{"$ref":"#/components/schemas/PayoutRule"}},"Direction":{"type":"string","enum":["INCREASE","DECREASE","ADD","SUBTRACT"]},"Amount":{"type":"number","format":"decimal"},"Rate":{"type":"integer"}}},"PerformanceBonus":{"type":"object","properties":{"Type":{"type":"string","enum":["ALL_ACTIONS","SUBSEQUENT_ACTIONS","FIXED"]},"Basis":{"type":"string","enum":["REVENUE","ACTIONS"]},"Period":{"type":"string","enum":["CALENDAR_MONTH"]},"Tiers":{"type":"array","items":{"$ref":"#/components/schemas/PayoutTier"}}}},"PayoutRestriction":{"type":"object","properties":{"Id":{"type":"string","format":"uuid","description":"Select the option that best describes how you use impact.com"},"Rules":{"type":"array","items":{"$ref":"#/components/schemas/PayoutRule"}},"ZeroPayoutHideReport":{"type":"string","enum":["0","1"]}}},"Locking":{"type":"object","properties":{"Basis":{"type":"string","enum":["TRACKED","APPROVED","COMMISSIONABLE"]},"Period":{"type":"string","enum":["DAY","WEEK","HALF_MONTH","MONTH"]},"MonthOffset":{"type":"integer"},"DayOffset":{"type":"integer"},"DayOfMonth":{"type":"integer"},"OpenEndedAutoLockingMode":{"type":"string","enum":["APPROVE","REJECT"]},"MaxMonthsOpenEndedPeriod":{"type":"integer"}}},"PayoutScheduling":{"type":"object","properties":{"Basis":{"type":"string","enum":["LOCKED","INVOICED"]},"Period":{"type":"string","enum":["END_OF_DAY","END_OF_MONTH"]},"MonthOffset":{"type":"integer"},"DayOffset":{"type":"integer"}}},"ValidReferral":{"type":"object","properties":{"Type":{"type":"string","enum":["PARENT_ACTIONS","CLICKS","IMPRESSIONS"]},"Window":{"type":"integer"},"WindowUnit":{"type":"string","enum":["HOUR","DAY"]}}},"PromotionalTerm":{"type":"object","properties":{"TermsName":{"type":"string"},"TermsType":{"type":"string","enum":["CUSTOM","EMAIL","COPYWRITING","PAID_SEARCH","SEO","TRADEMARK","APPROVAL"]},"TermsContent":{"type":"string"},"TermsPdfUri":{"type":"string","format":"uri-reference","nullable":true}}}}}}
```

## Retrieve a Contract

> Retrieves the details of a single, existing contract by its unique ID.

```json
{"openapi":"3.1.0","info":{"title":"Brand API - Contracts","version":"v12"},"servers":[{"url":"https://api.impact.com"}],"paths":{"/Advertisers/{AccountSID}/Campaigns/{CampaignId}/Contracts/{ContractId}":{"get":{"summary":"Retrieve a Contract","description":"Retrieves the details of a single, existing contract by its unique ID.","operationId":"getContractById","tags":["Contracts"],"parameters":[{"name":"AccountSID","in":"path","required":true,"schema":{"type":"string"},"description":"The unique identifier for the account."},{"name":"CampaignId","in":"path","required":true,"schema":{"type":"integer"},"description":"The ID of the campaign (program) the contract belongs to."},{"name":"ContractId","in":"path","required":true,"schema":{"type":"string"},"description":"The unique impact.com ID for the contract."}],"responses":{"200":{"description":"A single contract object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contract"}}}}}}}},"components":{"schemas":{"Contract":{"type":"object","properties":{"Id":{"type":"string","description":"The unique identifier for the contract."},"PartnerId":{"type":"integer","description":"The unique identifier of the partner the contract is with."},"PartnerValue1":{"type":"string","description":"A custom value associated with the partner."},"Status":{"type":"string","description":"The current status of the contract.","enum":["ACTIVE","EXPIRED"]},"StartDate":{"type":"string","format":"date-time","description":"The date and time the contract becomes active."},"EndDate":{"type":"string","format":"date-time","nullable":true,"description":"The date and time the contract expires. Null for open-ended contracts."},"BrandSignatory":{"type":"string","description":"The name of the brand representative who signed the contract."},"BrandSignatoryDate":{"type":"string","format":"date-time","description":"The date and time the brand signed the contract."},"PartnerSignatory":{"type":"string","description":"The name of the partner representative who signed the contract."},"PartnerSignatoryDate":{"type":"string","format":"date-time","description":"The date and time the partner signed the contract."},"DateCreated":{"type":"string","format":"date-time","description":"The date and time the contract was created."},"DateLastUpdated":{"type":"string","format":"date-time","description":"The date and time the contract was last updated."},"TemplateTerms":{"$ref":"#/components/schemas/TemplateTerms","description":"The template terms underlying this contract."},"PdfUri":{"type":"string","format":"uri-reference","description":"The URI to download the contract as a PDF."},"Uri":{"type":"string","format":"uri-reference","description":"The unique reference to this contract in the impact.com API."}}},"TemplateTerms":{"type":"object","properties":{"TemplateId":{"type":"integer","description":"Unique identifier for the template terms."},"VersionId":{"type":"string","description":"Version number of the template terms."},"Name":{"type":"string","description":"Display name for the template terms."},"Labels":{"type":"array","description":"Labels assigned to these template terms.","items":{"type":"string"}},"Currency":{"type":"string","description":"Three-letter ISO 4217 currency code for payouts."},"EventPayouts":{"type":"array","description":"Payout configurations per event type.","items":{"$ref":"#/components/schemas/EventPayout"}},"PromotionalTerms":{"type":"array","description":"Additional promotional terms attached to the contract.","items":{"$ref":"#/components/schemas/PromotionalTerm"}},"ChangeNotificationPeriod":{"type":"integer","description":"Number of days notice required before changes take effect."},"ReturnPolicy":{"type":"string","description":"How returns are handled for actions under this contract.","enum":["ALWAYS_OK","MP_APPROVAL_REQ","NO_RETURNS"]},"MaxReturnPercentage":{"type":"integer","description":"Maximum return rate percentage allowed."},"ActionLimit":{"type":"integer","description":"Maximum number of actions allowed within the action limit period."},"ActionLimitPeriod":{"type":"string","description":"The time window for the action limit.","enum":["DAY","WEEK","MONTH","QUARTER","IO_DURATION"]},"SpendLimit":{"type":"number","format":"decimal","description":"Maximum payout spend allowed within the spend limit period."},"SpendLimitPeriod":{"type":"string","description":"The time window for the spend limit.","enum":["DAY","WEEK","MONTH","QUARTER","IO_DURATION"]},"MinEarningPerClick":{"type":"number","format":"decimal","description":"Minimum earnings per click required."},"ContractStartSlottingFee":{"type":"number","format":"decimal","description":"Fee charged to the partner when the contract starts."},"FirstActionSlottingFee":{"type":"number","format":"decimal","nullable":true,"description":"Fee charged to the partner on their first action."},"MonthlySlottingFee":{"type":"number","format":"decimal","nullable":true,"description":"Monthly fee charged to the partner."},"CustomCreativePayer":{"type":"string","description":"Which party pays for custom creative work.","enum":["ADVERTISER","PUBLISHER","NOT_APPLICABLE"]}}},"EventPayout":{"type":"object","properties":{"EventTypeId":{"type":"integer","description":"Unique identifier for the event type."},"EventTypeName":{"type":"string","description":"Display name of the event type."},"EventCategory":{"type":"string","description":"Category of the event.","enum":["LEAD","SALE","DOWNLOAD","PAGE_VISIT","CALL_PER_RING","CALL_PER_DURATION","CALL_PER_CONVERSATION","PARTNER_REFERRAL","DATA_POST","OFFLINE","CLICK","MOBILE_APP"]},"DefaultPayout":{"type":"number","format":"decimal","description":"Default flat payout amount for the event."},"DefaultPayoutRate":{"type":"number","format":"decimal","description":"Default percentage payout rate for the event."},"PayoutLevel":{"type":"string","description":"Whether payout is calculated per item, order, click, or call.","enum":["ITEM","ORDER","CLICK","CALL"]},"PayoutGroups":{"type":"array","description":"Conditional payout groups for this event type.","items":{"$ref":"#/components/schemas/PayoutGroup"}},"PayoutAdjustments":{"type":"array","description":"Payout adjustment rules applied conditionally.","items":{"$ref":"#/components/schemas/PayoutAdjustment"}},"PerformanceBonus":{"$ref":"#/components/schemas/PerformanceBonus","description":"Performance bonus configuration for the event type."},"PayoutRestrictions":{"type":"array","description":"Restrictions that prevent payout when certain conditions are met.","items":{"$ref":"#/components/schemas/PayoutRestriction"}},"Limits":{"type":"array","description":"Payout or volume limits applied to this event.","items":{"$ref":"#/components/schemas/PayoutLimit"}},"Locking":{"$ref":"#/components/schemas/Locking","description":"Locking schedule that determines when payouts are finalized."},"PayoutScheduling":{"$ref":"#/components/schemas/PayoutScheduling","description":"Schedule for when payouts become available."},"CreditPolicy":{"type":"string","description":"How credit is assigned across referrers in the conversion path.","enum":["LAST_REFERRER","FIRST_REFERRER","LAST_TO_CART","FIRST_TO_CART","PARENT_ACTION"]},"ValidReferrals":{"type":"array","description":"Configuration for valid referral types and attribution windows.","items":{"$ref":"#/components/schemas/ValidReferral"}}}},"PayoutGroup":{"type":"object","properties":{"Id":{"type":"string","format":"uuid","description":"Select the option that best describes how you use impact.com"},"Rank":{"type":"integer"},"Rules":{"type":"array","items":{"$ref":"#/components/schemas/PayoutRule"}},"Payout":{"type":"number","format":"decimal"},"PayoutRate":{"type":"number","format":"decimal"},"Limits":{"type":"array","items":{"$ref":"#/components/schemas/PayoutLimit"}},"Tiers":{"type":"array","items":{"$ref":"#/components/schemas/PayoutTier"}}}},"PayoutRule":{"type":"object","properties":{"Variable":{"type":"string"},"Operator":{"type":"string"},"Values":{"type":"array","items":{"type":"string"}}}},"PayoutLimit":{"type":"object","properties":{"Type":{"type":"string","enum":["CLICKS","ITEM","PAYOUT","ACTION","CONCURRENT_CALLS"]},"Subtype":{"type":"string","enum":["SKU","CATEGORY","TEXT2"],"nullable":true},"Value":{"type":"number","format":"decimal"},"LimitBy":{"type":"string","enum":["ITEM","ORDER","CUSTOMER","CLICK","CALLER_ID"]},"Period":{"type":"string","enum":["DAY","WEEK","MONTH","QUARTER","CONTRACT_DURATION"]},"WeekendOverrideValue":{"type":"integer"}}},"PayoutTier":{"type":"object","properties":{"RevenueThreshold":{"type":"number","format":"decimal"},"ActionThreshold":{"type":"integer"},"ParentTier":{"type":"integer"},"Payout":{"type":"number","format":"decimal"},"PayoutRate":{"type":"number","format":"decimal"}}},"PayoutAdjustment":{"type":"object","properties":{"Id":{"type":"string","format":"uuid","description":"Select the option that best describes how you use impact.com"},"Rules":{"type":"array","items":{"$ref":"#/components/schemas/PayoutRule"}},"Direction":{"type":"string","enum":["INCREASE","DECREASE","ADD","SUBTRACT"]},"Amount":{"type":"number","format":"decimal"},"Rate":{"type":"integer"}}},"PerformanceBonus":{"type":"object","properties":{"Type":{"type":"string","enum":["ALL_ACTIONS","SUBSEQUENT_ACTIONS","FIXED"]},"Basis":{"type":"string","enum":["REVENUE","ACTIONS"]},"Period":{"type":"string","enum":["CALENDAR_MONTH"]},"Tiers":{"type":"array","items":{"$ref":"#/components/schemas/PayoutTier"}}}},"PayoutRestriction":{"type":"object","properties":{"Id":{"type":"string","format":"uuid","description":"Select the option that best describes how you use impact.com"},"Rules":{"type":"array","items":{"$ref":"#/components/schemas/PayoutRule"}},"ZeroPayoutHideReport":{"type":"string","enum":["0","1"]}}},"Locking":{"type":"object","properties":{"Basis":{"type":"string","enum":["TRACKED","APPROVED","COMMISSIONABLE"]},"Period":{"type":"string","enum":["DAY","WEEK","HALF_MONTH","MONTH"]},"MonthOffset":{"type":"integer"},"DayOffset":{"type":"integer"},"DayOfMonth":{"type":"integer"},"OpenEndedAutoLockingMode":{"type":"string","enum":["APPROVE","REJECT"]},"MaxMonthsOpenEndedPeriod":{"type":"integer"}}},"PayoutScheduling":{"type":"object","properties":{"Basis":{"type":"string","enum":["LOCKED","INVOICED"]},"Period":{"type":"string","enum":["END_OF_DAY","END_OF_MONTH"]},"MonthOffset":{"type":"integer"},"DayOffset":{"type":"integer"}}},"ValidReferral":{"type":"object","properties":{"Type":{"type":"string","enum":["PARENT_ACTIONS","CLICKS","IMPRESSIONS"]},"Window":{"type":"integer"},"WindowUnit":{"type":"string","enum":["HOUR","DAY"]}}},"PromotionalTerm":{"type":"object","properties":{"TermsName":{"type":"string"},"TermsType":{"type":"string","enum":["CUSTOM","EMAIL","COPYWRITING","PAID_SEARCH","SEO","TRADEMARK","APPROVAL"]},"TermsContent":{"type":"string"},"TermsPdfUri":{"type":"string","format":"uri-reference","nullable":true}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://integrations.impact.com/brand-api-reference/brand-api-reference-v12/reference/contracts/contracts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
