Create a new distributor
POST
/distribution/surveys/{surveyId}
const url = 'https://app.surveyrock.com/api/v1/distribution/surveys/example';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"channel":"web_link","name":"example","settings":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.surveyrock.com/api/v1/distribution/surveys/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "channel": "web_link", "name": "example", "settings": {} }'Create a new distributor. It starts as a draft: activate it to start collecting. The response includes url, the address respondents open once it is active (null for email). The response carries the new resource’s ETag, as the ETag header and as meta.etag.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”surveyId
required
string
Header Parameters
Section titled “Header Parameters”Idempotency-Key
required
string
1 to 128 characters, chosen by the caller. A retry with the same key and body replays the first response instead of applying the write twice; the same key with a different body is a 409
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
channel
required
string
name
string
settings
object
Responses
Section titled “Responses”Distributor created
Headers
Section titled “Headers”ETag
string
Example
"element:abc123:1790690123456789"The resource’s current version, as a strong validator. Opaque: send it back unchanged as If-Match. Also returned as meta.etag in the body, for a client that only sees the body.
Validation error
Survey not found