Create an Ember
POST
https://api.emberline.example/v4 /accounts/{account_id}/embers Creates an Ember from an uploaded module.
Parameters
account_idstringpathrequiredYour account identifier.
Request body application/json
namestringrequiredmainstringrequiredEntry module source.
compatibility_datestring{
"name": "string",
"main": "string",
"compatibility_date": "2026-09-01"
}Code samples
cURL
curl -X POST "https://api.emberline.example/v4/accounts/{account_id}/embers" \
-H "Content-Type: application/json" \
-d '{"name":"string","main":"string","compatibility_date":"2026-09-01"}'TypeScript
const res = await fetch('https://api.emberline.example/v4/accounts/{account_id}/embers', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({"name":"string","main":"string","compatibility_date":"2026-09-01"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.emberline.example/v4/accounts/{account_id}/embers",
headers={
"Content-Type": "application/json",
},
json={"name": "string", "main": "string", "compatibility_date": "2026-09-01"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.emberline.example/v4/accounts/{account_id}/embers", strings.NewReader(`{"name":"string","main":"string","compatibility_date":"2026-09-01"}`))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.emberline.example/v4/accounts/{account_id}/embers');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"name":"string","main":"string","compatibility_date":"2026-09-01"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.emberline.example/v4/accounts/{account_id}/embers')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = 'application/json'
req.body = '{"name":"string","main":"string","compatibility_date":"2026-09-01"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.emberline.example/v4/accounts/{account_id}/embers"))
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"name\":\"string\",\"main\":\"string\",\"compatibility_date\":\"2026-09-01\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Responses
201 Created
{
"id": "emb_7Hq2",
"name": "my-first-ember",
"created_on": "2024-01-01T00:00:00Z",
"routes": [
"example.com/*"
]
}400 Invalid
{
"code": 10007,
"message": "Ember not found"
}Updated
Was this page helpful?