Skip to main content
POST
Create experiment

Authorizations

Authorization
string
header
required

Biscuit-based bearer token. Obtain tokens from the Adaptyv Portal or via the /tokens endpoint. Tokens encode organization membership and role-based capabilities; the API verifies the token's cryptographic signature and authorization claims before processing requests. Use /tokens/attenuate to create restricted tokens for delegation.

Body

application/json

Request payload for creating a new experiment.

Created experiments start in Draft status. Use PATCH /experiments/{id} to modify existing experiments.

experiment_spec
object
required

Structured experiment definition (type, target, sequences, parameters)

name
string
required

Human-readable name for the experiment

Example:

"PD-L1 affinity panel"

auto_accept_quote
boolean
default:false

Atomic create-and-pay: accept the quote and initiate payment in the same request.

When true, after creating the experiment and its Stripe quote the server immediately accepts the quote and finalizes the invoice. It is non-settling for machine rails: create-and-pay never settles or emits a payment 402; the client settles at /invoices/{id}/pay.

  • No header / async_invoice — the quote is accepted and a draft invoice is created (today's behaviour). Responds 201 Created with stripe_invoice_id and stripe_hosted_invoice_url.
  • A machine rail (mpp-spt / x402-exact) — the (open, unpaid) invoice is finalized and the response is 200 OK with the accepted-quote body plus a HATEOAS payment pointer to /invoices/{invoice_id}/pay. Follow it to answer the 402 challenge and settle.

On a failure after the invoice was created, the invoice is compensated (voided) so the experiment can be retried. Implies skip_draft: true. A quote must be creatable (target_id + full pricing available), otherwise the request is rejected with 400.

payment
null | object

Optional create-time payment-method selector — the request-body equivalent of the X-Adaptyv-Payment-Method header.

Absent (the default) selects nothing here; the method is then resolved from the header, or from the caller's payment policy, exactly as before. When present it pins the experiment's payment rail (and Stripe account tier) for its whole lifetime. If the header is also present, the two must agree, otherwise the request is rejected 400 (payment_method_selector_conflict).

skip_draft
boolean

Bypass Draft status and submit directly for processing.

When true, the experiment is created in "Waiting for confirmation" status instead of Draft, skipping the manual review step. Use this for automated pipelines with pre-validated payloads.

When an experiment is submitted with skip_draft: true and the target has existing inventory materials, those materials are automatically linked to expedite processing.

webhook_url
string | null

HTTPS URL for push notifications. Once set, Adaptyv POSTs an experiment_update event to this URL for every customer-facing update on the experiment — the same updates that trigger an email notification. Deliveries are signed with X-Adaptyv-Signature (HMAC-SHA256).

Example:

"https://example.com/webhook"

Response

Atomic create-and-pay for a machine rail (auto_accept_quote): the (open, unpaid) invoice is finalized and the payment block points at /invoices/{id}/pay where the client settles. Never settles or challenges at create.

Response after accepting a quote

Confirms the quote acceptance and provides invoice information if applicable.

id
string
required

Quote ID that was accepted

status
enum<string>
required

New status (accepted after confirmation)

Available options:
draft,
open,
accepted,
canceled,
stale
hosted_invoice_url
string | null

Stripe-hosted URL where the customer can view and pay the generated invoice

Example:

"https://invoice.stripe.com/i/acct_1234/test_5678"

invoice_id
string | null

ID of the invoice generated from this quote (if applicable)

payment
null | object

Hypermedia pointer to where and how to pay the finalized (open, unpaid) invoice. Present on the non-settling confirm response — hosted_invoice for an async-invoice quote, machine for a machine rail. Absent on other uses of this DTO (e.g. an already-settled response).