Request a trial license
POST
CoderSessionTokenheader
Coder-Session-Token<token>Trial license request
application/json- body
attribution_id?stringAttributionID is the ID of the cta_click funnel event that led here, so that a signup can be joined back to the paywall that produced it.
Format
uuidcompany_name*stringLength
2 <= length <= 100country*stringdevelopers*stringemail*stringFormat
emailLength
length <= 254first_name*stringLength
1 <= length <= 60job_title*stringLength
2 <= length <= 100last_name*stringLength
1 <= length <= 60phone_number*stringLength
7 <= length <= 20source?stringSource is the premium paywall the request came from, for telemetry. It is not forwarded to the licensor. Omit it to report "direct".
Value in
"aibridge_session_threads""aibridge_sessions""ai_gateway_keys""ai_governance""appearance""audit_log""browser_only""connection_log""custom_roles""external_auth""groups""idp_org_sync""idp_sync""multiple_organizations""observability""provisioner_keys""provisioners""template_permissions""workspace_proxies""direct"Created
application/json- response
claims?Claims are the JWT claims asserted by the license. Here we use a generic string map to ensure that all data from the server is parsed verbatim, not just the fields this version of Coder understands.
id?integeruploaded_at?stringFormat
date-timeuuid?stringFormat
uuidThe samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X POST \ "$CODER_URL/api/v2/licenses/trial" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "company_name": "Acme Corp", "country": "United States", "developers": "string", "email": "[email protected]", "first_name": "Jane", "job_title": "Engineering Manager", "last_name": "Doe", "phone_number": "+14155552671"}'const { CODER_URL, CODER_SESSION_TOKEN } = process.env;const url = `${CODER_URL}/api/v2/licenses/trial`;const response = await fetch(url, { method: "POST", headers: { "Coder-Session-Token": CODER_SESSION_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ company_name: "Acme Corp", country: "United States", developers: "string", email: "[email protected]", first_name: "Jane", job_title: "Engineering Manager", last_name: "Doe", phone_number: "+14155552671", }),});console.log(response.status, await response.text());import osimport requestsurl = os.environ["CODER_URL"] + "/api/v2/licenses/trial"token = os.environ["CODER_SESSION_TOKEN"]response = requests.post( url, headers={ "Coder-Session-Token": token, }, json={ "company_name": "Acme Corp", "country": "United States", "developers": "string", "email": "[email protected]", "first_name": "Jane", "job_title": "Engineering Manager", "last_name": "Doe", "phone_number": "+14155552671", },)print(response.status_code, response.text)package mainimport ( "fmt" "io" "net/http" "os" "strings")func main() { body := strings.NewReader(`{ "company_name": "Acme Corp", "country": "United States", "developers": "string", "email": "[email protected]", "first_name": "Jane", "job_title": "Engineering Manager", "last_name": "Doe", "phone_number": "+14155552671"}`) url := os.Getenv("CODER_URL") + "/api/v2/licenses/trial" token := os.Getenv("CODER_SESSION_TOKEN") req, err := http.NewRequest(http.MethodPost, url, body) if err != nil { panic(err) } req.Header.Set("Coder-Session-Token", token) req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, err := io.ReadAll(resp.Body) if err != nil { panic(err) } fmt.Println(resp.Status, string(out))}Example Response201
{ "claims": {}, "id": 0, "uploaded_at": "2019-08-24T14:15:22Z", "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f"}