> For the complete documentation index, see [llms.txt](https://help.recart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.recart.com/developers/public-api/optin-tool/receive-a-single-a-b-test-experiment.md).

# Receive a single A/B test experiment

Get A/B test experiment by ID. An experiment belonging to another site is not visible and returns 404.

```json
{"openapi":"3.1.0","info":{"title":"Recart API","version":"2023-12"},"tags":[{"name":"OptinTool","description":"Opt-in tools"}],"servers":[{"url":"https://api.recart.com/app-integrations/2023-12","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Recart-API-Key","description":"It can be obtained in Recart account after contacting Support"}},"schemas":{"OptinToolExperiment":{"type":["object"],"required":["type","attributes"],"properties":{"type":{"type":"string","enum":["optin-tool-experiments"]},"attributes":{"type":"object","required":["id","name","status","dateFrom","dateTo","optinToolIds","createdAt","updatedAt"],"properties":{"id":{"type":"string","description":"ID of the experiment"},"name":{"type":"string","description":"Name of the experiment"},"status":{"type":"string","description":"Status of the experiment. `draft` is still being set up in\nthe A/B test wizard, `scheduled` waits for `dateFrom`,\n`cancelled` was called off before it ran. Only a `running`\nor `ended` experiment has statistics; the views of any other\nstatus return 400.\n","enum":["draft","scheduled","running","ended","cancelled"]},"dateFrom":{"type":"string","format":"date-time","description":"Start of the experiment window. UTC date and time in ISO 8601 format"},"dateTo":{"type":"string","format":"date-time","description":"End of the experiment window, exclusive. UTC date and time in\nISO 8601 format. For a running experiment this is the planned\nend; statistics stop at the current time instead.\n"},"optinToolIds":{"type":"array","description":"IDs of the opt-in tools taking part in the experiment — its\nvariants. Statistics views return one entry per ID.\n","items":{"type":"string"}},"variants":{"type":"array","description":"Traffic split of the experiment, one entry per opt-in tool in\n`optinToolIds`. Present for experiments created in the A/B\ntest wizard; older experiments split traffic evenly and have\nno designated control.\n","items":{"$ref":"#/components/schemas/OptinToolExperimentVariant"}},"primaryMetric":{"type":"string","description":"Metric the experiment is decided on. Present for experiments\ncreated in the A/B test wizard; older experiments were decided\non opt-in rate. `emailOptin` and `smsOptin` are opt-in rates,\nthe rest are the `revenue-summary` metrics.\n","enum":["emailOptin","smsOptin","associatedRevenue","orders","averageOrderValue","revenuePerVisitor","orderConversionRate"]},"winnerOptinToolId":{"type":"string","description":"ID of the variant Recart picked as the winner, present once the\nexperiment has ended. Picked on the highest `primaryMetric`\nvalue — opt-in rate when there is none — this is not a\nstatistical significance test.\n"},"winnerMetricValue":{"type":"number","description":"Value of `primaryMetric` for the winning variant, present with\n`winnerOptinToolId`. Rates are fractions (0.0135 = 1.35%),\nrevenue amounts are in USD. For an experiment without a\n`primaryMetric` this is the winner's opt-in rate.\n"},"winnerOptinRate":{"type":"number","description":"Opt-in rate of the winning variant. Set only for experiments\nwithout a `primaryMetric`; `winnerMetricValue` carries the\nsame number for those.\n"},"tags":{"type":"array","description":"Tags the merchant put on the experiment in the A/B test\nwizard, in the order they were added.\n","items":{"$ref":"#/components/schemas/OptinToolExperimentTag"}},"notes":{"type":"string","description":"Free-text notes the merchant wrote on the experiment"},"createdAt":{"type":"string","format":"date-time","description":"Creation time of the experiment. UTC date and time in ISO 8601 format"},"updatedAt":{"type":"string","format":"date-time","description":"Last modification time of the experiment. UTC date and time in ISO 8601 format"}}}}},"OptinToolExperimentVariant":{"type":"object","description":"One variant of an A/B test experiment and its share of traffic.","required":["optinToolId","weight","isControl"],"properties":{"optinToolId":{"type":"string","description":"ID of the opt-in tool shown as this variant"},"weight":{"type":"number","description":"Share of eligible visitors assigned to this variant, as a fraction\nof 1. The weights of an experiment sum to 1.\n","minimum":0,"maximum":1},"isControl":{"type":"boolean","description":"Whether this variant is the control the others are compared\nagainst. Exactly one variant of an experiment is the control.\n"}}},"OptinToolExperimentTag":{"type":"object","description":"A tag attached to an A/B test experiment.","required":["value","label"],"properties":{"value":{"type":"string","description":"Stable key of the tag, unique within the site"},"label":{"type":"string","description":"Display name of the tag as shown in the dashboard"}}},"HttpErrorBody":{"type":"object","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"object","required":["id","code","title","detail"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"}}}}}}},"responses":{"HttpError":{"description":"HTTP Error response","content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/HttpErrorBody"}}}}}},"paths":{"/optin-tool-experiments/{id}":{"get":{"summary":"Receive a single A/B test experiment","tags":["OptinTool"],"operationId":"getOptinToolExperiment","description":"Get A/B test experiment by ID. An experiment belonging to another site\nis not visible and returns 404.\n","parameters":[{"name":"id","in":"path","required":true,"description":"ID of the experiment","schema":{"type":"string"}}],"responses":{"200":{"description":"Ok","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OptinToolExperiment"}}}}}},"4XX":{"$ref":"#/components/responses/HttpError"},"5XX":{"$ref":"#/components/responses/HttpError"}}}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.recart.com/developers/public-api/optin-tool/receive-a-single-a-b-test-experiment.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
