Skip to content
Ecodia

Documentation

Getting started

Go from nothing to a live REST and SOAP API in about ten minutes. Examples use a project called shop, so replace shop.ecodia.app with your own subdomain.

1. Create a project

Sign in to the panel and choose New project. Give it a name, pick a subdomain and optionally start from a template (blank, e-commerce, blog, to-do, CRM or inventory).

  • Subdomains use lowercase letters, numbers and hyphens, and some names are reserved.
  • The free plan includes one project; Premium includes up to ten.
  • Your API is available immediately at https://shop.ecodia.app.

A new project answers at its root with a small JSON index that links to everything else:

bash
curl https://shop.ecodia.app/

2. Design your schema

A schema is a list of resources (think tables). Each resource has fields, and every resource automatically gets an integer id and, by default, created_at and updated_at timestamps. You can edit it visually, ask the AI builder, or paste JSON:

schema.json
{
  "version": 1,
  "resources": [
    {
      "name": "products",
      "label": "Product",
      "fields": [
        { "name": "title", "type": "string", "required": true, "max_length": 200 },
        { "name": "price", "type": "decimal", "precision": 10, "scale": 2, "min": 0 },
        { "name": "stock", "type": "integer", "default": 0 },
        { "name": "status", "type": "enum", "values": ["draft", "published"], "default": "draft" }
      ],
      "operations": ["list", "get", "create", "update", "delete"],
      "public": ["list", "get"]
    }
  ]
}

Resource names use lowercase letters, numbers and underscores, and become both the table name and the URL segment. Supported field types:

TypeNotes
string, textstring has max_length (default 255); text is unlimited
integer, decimal, floatoptional min / max; decimal has precision and scale
boolean, date, datetimedates as YYYY-MM-DD and ISO-8601
email, url, uuidvalidated strings; uuid can be generated automatically
enumone of values you define
jsonany JSON value
relationreferences another resource with on_delete: cascade, set_null or restrict

Changing a schema shows a preview of the migration first. Destructive changes, such as dropping a column or table, are refused until you explicitly allow them.

Prefer to be told what to build? Open the AI builder and write something like "a blog with posts, authors and comments". Review the proposed tables and apply them when you are happy.

3. Create an API key

Open the project, go to API keys and create one. The full token (it starts with eco_) is shown only once, so copy it somewhere safe. Keys have scopes:

  • read allows list and get operations.
  • write allows create, update and delete.
  • Operations listed under public in the schema work without any key.

Send the key as a bearer token or in X-API-Key. For SOAP you can also use the AuthHeader SOAP header.

bash
Authorization: Bearer eco_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# or
X-API-Key: eco_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

4. Call the REST API

Every resource gets five operations under /api/{resource}:

Method and pathAction
GET /api/productsList (paginated)
POST /api/productsCreate, returns 201
GET /api/products/{id}Get one
PUT /api/products/{id}Replace
PATCH /api/products/{id}Partial update
DELETE /api/products/{id}Delete, returns 204
Create a product
curl -X POST https://shop.ecodia.app/api/products \
  -H "Authorization: Bearer $ECODIA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Espresso beans","price":12.5,"stock":40}'
Response, 201 Created
{
  "data": {
    "id": 1,
    "title": "Espresso beans",
    "price": 12.5,
    "stock": 40,
    "status": "draft",
    "created_at": "2026-11-20T08:15:00Z",
    "updated_at": "2026-11-20T08:15:00Z"
  }
}

Listing, filtering and searching

bash
# page 2, 10 per page, newest first
curl "https://shop.ecodia.app/api/products?page=2&per_page=10&sort=-created_at" -H "X-API-Key: $ECODIA_KEY"

# price >= 10 and published, only two fields
curl "https://shop.ecodia.app/api/products?filter[price][gte]=10&filter[status]=published&fields=id,title" -H "X-API-Key: $ECODIA_KEY"

# full-text style search across searchable fields
curl "https://shop.ecodia.app/api/products?q=espresso" -H "X-API-Key: $ECODIA_KEY"

Filter operators are eq, ne, gt, gte, lt, lte, like, in and null. Lists return a meta object with page, per_page, total and total_pages. Use include=category to expand a relation one level.

5. Prefer XML?

Ask for XML with an Accept header or with ?format=xml. XML request bodies are accepted too.

bash
curl "https://shop.ecodia.app/api/products/1" \
  -H "Accept: application/xml" -H "X-API-Key: $ECODIA_KEY"
xml
<response>
  <data>
    <id>1</id>
    <title>Espresso beans</title>
    <price>12.5</price>
    <stock>40</stock>
  </data>
</response>
Create with an XML body
curl -X POST https://shop.ecodia.app/api/products \
  -H "X-API-Key: $ECODIA_KEY" -H "Content-Type: application/xml" \
  -d '<record><title>Filter coffee</title><price>9</price></record>'

6. SOAP from C# and .NET

Each project publishes a WSDL 1.1 (document/literal wrapped) at /soap?wsdl and a SOAP 1.1 and 1.2 endpoint at /soap. For a resource Product you get the operations ListProducts, GetProducts, CreateProducts, UpdateProducts and DeleteProducts.

Visual Studio

Right-click your project, choose Add, Connected Service, then WCF Web Service Reference Provider, and paste https://shop.ecodia.app/soap?wsdl. The classic Add Service Reference dialog works on .NET Framework projects.

Command line with dotnet-svcutil

bash
dotnet tool install --global dotnet-svcutil
dotnet-svcutil https://shop.ecodia.app/soap?wsdl --namespace "*,Ecodia.Shop" --outputDir ./Connected
Program.cs
using System.ServiceModel;
using System.ServiceModel.Channels;

var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
var endpoint = new EndpointAddress("https://shop.ecodia.app/soap");
var client = new Ecodia.Shop.ShopPortClient(binding, endpoint);

using (new OperationContextScope(client.InnerChannel))
{
    var headers = new HttpRequestMessageProperty();
    headers.Headers["X-API-Key"] = Environment.GetEnvironmentVariable("ECODIA_KEY");
    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = headers;

    var result = await client.ListProductsAsync(new ListProductsRequest { page = 1, per_page = 10 });
    foreach (var p in result.items)
        Console.WriteLine($"{p.id}: {p.title}");
}

The generated client class names depend on your project and the tool version. Open the generated file in ./Connected to see the exact names; the operations always follow the List, Get, Create, Update, Delete pattern.

Failures are returned as SOAP Faults with the same error code in faultcode and detail, for example insufficient_scope or validation_failed.

7. Swagger and OpenAPI

Open https://shop.ecodia.app/docs for interactive Swagger UI with a try-it-out button. Paste your API key with Authorize. The raw OpenAPI 3.0 document lives at /openapi.json, and a Postman v2.1 collection at /postman.json.

bash
# generate a typed TypeScript client
npx openapi-typescript https://shop.ecodia.app/openapi.json -o shop.d.ts

8. Rate limits and throttling

Every response carries headers so a client can adapt:

HeaderMeaning
X-RateLimit-LimitRequests allowed per minute
X-RateLimit-RemainingRequests left in the current window
X-RateLimit-ResetWhen the window resets
X-Ecodia-ThrottleFree plan only, for example 600ms, the deliberate delay added to this response
X-Request-IdCorrelation id to quote when you contact support

When you exceed the per-minute limit you receive 429 rate_limited; when the monthly quota is used up you receive 429 quota_exceeded. Back off and retry after the reset time. Premium removes the response delay and raises both limits.

The free-plan throttle is intentional. If your API feels slow, check for the X-Ecodia-Throttle header before debugging your own code.

9. Error codes

Errors use one envelope in JSON, with the same shape in XML:

json
{
  "error": {
    "code": "validation_failed",
    "message": "The title field is required.",
    "details": { "title": ["The title field is required."] }
  }
}
StatusCodeWhen
401unauthenticatedMissing or invalid API key
403insufficient_scopeKey scope does not allow this operation
404not_foundUnknown resource or record
405operation_disabledThe operation is switched off for this resource
422validation_failedBody failed validation; see details per field
423project_read_onlyProject is read-only (for example after a downgrade)
429rate_limited / quota_exceededPer-minute rate or monthly quota reached
503project_suspendedProject is suspended
507storage_limitStorage limit reached for the plan

Stuck?

Tell us what you are building and we will point you the right way.

Contact us