openapi: 3.0.0 info: title: AB Crusher API version: 0.0.1 servers: - url: /api/v1 paths: /tests: get: summary: Returns a list of current and past tests tags: - Tests responses: '200': description: A JSON array of TestSummary objects content: application/json: schema: type: array items: $ref: '#/components/schemas/TestSummary' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' post: summary: Create a new Test tags: - Tests requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Test' responses: '200': description: Created content: application/json: schema: $ref: '#/components/schemas/Test' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' '/test/{testId}': get: summary: Return data for a single Test tags: - Tests parameters: - in: path name: testId schema: type: string required: true responses: '200': description: A single Test object content: application/json: schema: $ref: '#/components/schemas/Test' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' put: summary: Update a Test tags: - Tests parameters: - in: path name: testId schema: type: string required: true requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Test' responses: '200': description: A single Test object content: application/json: schema: $ref: '#/components/schemas/Test' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' delete: summary: Delete a Test tags: - Tests parameters: - in: path name: testId schema: type: string required: true responses: '200': description: Deleted default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' '/test/{testId}/snapshots': get: summary: Return data snapshots for a test tags: - Tests parameters: - in: path name: testId schema: type: string required: true responses: '200': description: An array of data snapshots content: application/json: schema: type: array items: $ref: '#/components/schemas/Snapshot' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' post: summary: Create a new snapshot for a test tags: - Tests parameters: - in: path name: testId schema: type: string required: true responses: '200': description: The snapshot created content: application/json: schema: $ref: '#/components/schemas/Snapshot' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' /events: get: summary: Get a list of events tags: - Events responses: '200': description: An array of events content: application/json: schema: type: array items: $ref: '#/components/schemas/Event' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' '/event/{eventId}': get: summary: Get a single Event tags: - Events parameters: - in: path name: eventId schema: type: string required: true responses: '200': description: The event content: application/json: schema: $ref: '#/components/schemas/Event' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' /insights: get: summary: Returns a list of insights tags: - Insights responses: '200': description: A JSON array of Insight objects content: application/json: schema: type: array items: $ref: '#/components/schemas/Insight' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' post: summary: Create a new Insight tags: - Insights requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Insight' responses: '200': description: Created content: application/json: schema: $ref: '#/components/schemas/Insight' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' '/insight/{insightId}': get: summary: Return data for a single Insight tags: - Insights parameters: - in: path name: insightId schema: type: string required: true responses: '200': description: A single Insight object content: application/json: schema: $ref: '#/components/schemas/Insight' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' put: summary: Update a Insight tags: - Insights parameters: - in: path name: insightId schema: type: string required: true requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Insight' responses: '200': description: A single Insight object content: application/json: schema: $ref: '#/components/schemas/Insight' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' delete: summary: Delete a Insight tags: - Insights parameters: - in: path name: insightId schema: type: string required: true responses: '200': description: Deleted default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' components: schemas: Error: type: object required: - type - message properties: type: type: string enum: - invalid_request_error - authentication_error - api_error - api_connection_error - rate_limit_error message: type: string example: "An unknown error occurred" param: type: string example: "some_param" Insight: type: object required: - id - insight - links - votes properties: id: type: string example: i_123abc links: type: array items: type: object required: - display - url properties: display: type: string example: "Signup Button Color" url: type: string format: uri example: "/test/t_123abc" insight: type: string example: Green buttons get higher click throughs than Red buttons votes: type: integer Event: type: object required: - timestamp - user - event - objectId properties: timestamp: type: string format: date-time user: type: string example: u_123abc event: type: string example: insight.updated objectId: type: string example: i_123abc data: type: object example: previousProps: insight: This was the old insight newProps: insight: This is the new insight Metric: type: object required: - name - type properties: name: type: string example: "Clicks" type: type: string enum: - BINOMIAL - NORMAL - POISSON - NPS SnapshotVariation: type: object required: - variation - samples - metrics properties: variation: type: integer samples: type: integer example: 800 requiredSamples: type: integer example: 1200 data: type: object required: - value - enoughData properties: value: type: number example: 0.23 rawData: type: object enoughData: type: boolean confidenceLow: type: number example: -0.03 confidenceHigh: type: number example: 0.12 Snapshot: type: object required: - id - testId - created - metrics properties: id: type: string example: s_123abc testId: type: string example: t_123abc created: type: string format: date-time metrics: type: array items: type: object required: - metric - variations properties: metric: $ref: '#/components/schemas/Metric' variations: type: array items: $ref: '#/components/schemas/SnapshotVariation' example: - variation: 0 samples: 1002 requiredSamples: 1600 data: value: 0.23 enoughData: true - variation: 1 samples: 1025 requiredSamples: 1400 data: value: 0.25 enoughData: true confidenceLow: -0.03 confidenceHigh: 0.12 - variation: 2 samples: 905 requiredSamples: 1500 data: value: 0.24 enoughData: false confidenceLow: -0.16 confidenceHigh: 0.18 TestStatus: type: string enum: - RUNNING - DRAFT - PENDING - STOPPED Variation: type: object required: - variation - name - weight - active - images properties: variation: type: integer name: type: string example: Baseline weight: type: number minimum: 0 maximum: 1 example: 0.5 active: type: boolean images: type: array items: type: object required: - path - width - height properties: path: type: string example: '/img/screenshots/pricing-button-baseline.png' width: type: integer example: 800 height: type: integer example: 600 TestSummary: type: object required: - id - name - status - description - hypothesis - variations - outcome - created_at - updated_at - started_at - stopped_at properties: id: type: string example: t_123abc name: type: string example: Signup Button Color status: $ref: '#/components/schemas/TestStatus' description: type: string example: Seeing if a green button performs better than a red button hypothesis: type: string example: A green button will draw user's attention more and cause click-through to increase variations: type: array items: type: object required: - variation - name properties: variation: type: integer name: type: string example: - variation: 0 name: Baseline - variation: 1 name: Green Buttons - variation: 2 name: Blue Buttons outcome: type: string enum: - WIN - LOSS - DRAW - DNF created_at: type: string format: date-time updated_at: type: string format: date-time started_at: type: string format: date-time stopped_at: type: string format: date-time Test: type: object required: - id - name - status - description - hypothesis - variations - metrics - results - created_at - updated_at - started_at - stopped_at properties: id: type: string example: t_123abc name: type: string example: Signup Button Color status: $ref: '#/components/schemas/TestStatus' description: type: string example: Seeing if a green button performs better than a red button hypothesis: type: string example: A green button will draw user's attention more and cause click-through to increase variations: type: array items: $ref: '#/components/schemas/Variation' example: - variation: 0 name: Baseline weight: 0.34 active: true images: - path: /img/screenshots/pricing-button-baseline.png width: 1047 height: 577 - variation: 1 name: Green Buttons weight: 0.33 active: true images: - path: /img/screenshots/pricing-button-green.png width: 1041 height: 577 - variation: 1 name: Blue Buttons weight: 0.33 active: true images: - path: /img/screenshots/pricing-button-blue.png width: 1033 height: 567 metrics: type: array items: $ref: '#/components/schemas/Metric' results: type: object required: - summary - analysis - outcome - future_baseline properties: summary: type: string example: Green had a significantly higher CTR analysis: type: string example: 'Noticed a slight decrease in bounce rate as well, but not sure if related' outcome: type: string enum: - WIN - LOSS - DRAW - DNF future_baseline: type: string example: Switching to green going forward created_at: type: string format: date-time example: 2019-11-06T00:00:00Z updated_at: type: string format: date-time started_at: type: string format: date-time stopped_at: type: string format: date-time