Skip to content
Website

Create Agenda

Create a folder and check currency, country and email-alias requirements.

POST/api/v1_2/agendas

Create one folder (called an agenda in the API). Create the first folder and select your plan in the Datamolino web app before creating further folders through the API.

Send one object in the agendas array. The response returns the new folder’s ID.

Field requirements

Field Requirements
home_currency Send the currency explicitly, for example EUR. Use a three-letter uppercase ISO 4217 currency code.
country Supply address.country as an ISO 3166-1 alpha-2 country code. Lowercase input is converted to uppercase.
email_alias Unique; 5–32 characters. Start and end with a letter or digit. Letters, digits, periods, underscores and hyphens are allowed between them. The prefixes files., purchases. and sales. are reserved.
external_id Unique within the account; maximum 64 characters.
email_whitelist Comma-separated valid email addresses, used by the folder spam filter.
client_id Your client identifier; maximum 255 characters.

The email alias uses the pattern ^[a-zA-Z\d][a-zA-Z\d._-]*[a-zA-Z\d]$ and is stored in lowercase. Reserved prefixes are checked separately.

Headers

Name Example Description
Content-Type application/json -

Request body

{
  "agendas": [
    {
      "name": "Demo Trading Ltd",
      "address": {
        "street": "Street name",
        "building_no": "6 - 8",
        "city": "Bratislava",
        "postal_code": "811 03",
        "country": "sk"
      },
      "company_id": "12345678",
      "company_tax_id": "1002003000",
      "company_vat_id": null,
      "home_currency": "EUR",
      "client_id": "demo_client_id"
    }
  ]
}

Code examples

cURL

curl --request POST 'https://app.datamolino.com/api/v1_2/agendas' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer demo_access_token' \
  --data '{
  "agendas": [
    {
      "name": "Demo Trading Ltd",
      "address": {
        "street": "Street name",
        "building_no": "6 - 8",
        "city": "Bratislava",
        "postal_code": "811 03",
        "country": "sk"
      },
      "company_id": "12345678",
      "company_tax_id": "1002003000",
      "company_vat_id": null,
      "home_currency": "EUR",
      "client_id": "demo_client_id"
    }
  ]
}'

HTTP

POST /api/v1_2/agendas HTTP/1.1
Host: app.datamolino.com
Content-Type: application/json
Authorization: Bearer demo_access_token

{
  "agendas": [
    {
      "name": "Demo Trading Ltd",
      "address": {
        "street": "Street name",
        "building_no": "6 - 8",
        "city": "Bratislava",
        "postal_code": "811 03",
        "country": "sk"
      },
      "company_id": "12345678",
      "company_tax_id": "1002003000",
      "company_vat_id": null,
      "home_currency": "EUR",
      "client_id": "demo_client_id"
    }
  ]
}

JavaScript Fetch

const response = await fetch("https://app.datamolino.com/api/v1_2/agendas", {
  method: "POST",
  headers: {
"Content-Type": "application/json",
"Authorization": "Bearer demo_access_token"
  },
  body: JSON.stringify({
"agendas": [
  {
    "name": "Demo Trading Ltd",
    "address": {
      "street": "Street name",
      "building_no": "6 - 8",
      "city": "Bratislava",
      "postal_code": "811 03",
      "country": "sk"
    },
    "company_id": "12345678",
    "company_tax_id": "1002003000",
    "company_vat_id": null,
    "home_currency": "EUR",
    "client_id": "demo_client_id"
  }
]
  }),
});

const data = await response.json();

Node.js Axios

import axios from "axios";

const response = await axios({
  method: "post",
  url: "https://app.datamolino.com/api/v1_2/agendas",
  headers: {
"Content-Type": "application/json",
"Authorization": "Bearer demo_access_token"
  },
  data: {
"agendas": [
  {
    "name": "Demo Trading Ltd",
    "address": {
      "street": "Street name",
      "building_no": "6 - 8",
      "city": "Bratislava",
      "postal_code": "811 03",
      "country": "sk"
    },
    "company_id": "12345678",
    "company_tax_id": "1002003000",
    "company_vat_id": null,
    "home_currency": "EUR",
    "client_id": "demo_client_id"
  }
]
  }
});

console.log(response.data);

Python Requests

import requests

url = "https://app.datamolino.com/api/v1_2/agendas"
headers = {
  "Content-Type": "application/json",
  "Authorization": "Bearer demo_access_token"
}
payload = {
  "agendas": [
{
  "name": "Demo Trading Ltd",
  "address": {
    "street": "Street name",
    "building_no": "6 - 8",
    "city": "Bratislava",
    "postal_code": "811 03",
    "country": "sk"
  },
  "company_id": "12345678",
  "company_tax_id": "1002003000",
  "company_vat_id": None,
  "home_currency": "EUR",
  "client_id": "demo_client_id"
}
  ]
}

response = requests.request("POST", url, headers=headers, json=payload)
response.raise_for_status()
print(response.json())

Ruby Net::HTTP

require 'json'
require 'net/http'

uri = URI("https://app.datamolino.com/api/v1_2/agendas")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer demo_access_token"
request.body = <<~JSON
{
  "agendas": [
{
  "name": "Demo Trading Ltd",
  "address": {
    "street": "Street name",
    "building_no": "6 - 8",
    "city": "Bratislava",
    "postal_code": "811 03",
    "country": "sk"
  },
  "company_id": "12345678",
  "company_tax_id": "1002003000",
  "company_vat_id": null,
  "home_currency": "EUR",
  "client_id": "demo_client_id"
}
  ]
}
JSON

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts JSON.parse(response.body)

Ruby on Rails

# app/services/datamolino_client.rb
require 'json'
require 'net/http'

class DatamolinoClient
  BASE_URL = "https://app.datamolino.com"

  def initialize(access_token: Rails.application.credentials.dig(:datamolino, :access_token))
@access_token = access_token
  end

  def request_create_agenda
uri = URI("#{BASE_URL}/api/v1_2/agendas")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer #{@access_token}"
request.body = <<~JSON
  {
    "agendas": [
      {
        "name": "Demo Trading Ltd",
        "address": {
          "street": "Street name",
          "building_no": "6 - 8",
          "city": "Bratislava",
          "postal_code": "811 03",
          "country": "sk"
        },
        "company_id": "12345678",
        "company_tax_id": "1002003000",
        "company_vat_id": null,
        "home_currency": "EUR",
        "client_id": "demo_client_id"
      }
    ]
  }
JSON

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

JSON.parse(response.body)
  end
end

PHP Guzzle

<?php

use GuzzleHttp\Client;

$client = new Client();
$response = $client->request('POST', 'https://app.datamolino.com/api/v1_2/agendas', [
'headers' => json_decode('{"Content-Type":"application/json","Authorization":"Bearer demo_access_token"}', true),
'json' => json_decode('{"agendas":[{"name":"Demo Trading Ltd","address":{"street":"Street name","building_no":"6 - 8","city":"Bratislava","postal_code":"811 03","country":"sk"},"company_id":"12345678","company_tax_id":"1002003000","company_vat_id":null,"home_currency":"EUR","client_id":"demo_client_id"}]}', true)
]);

echo $response->getBody();

Java OkHttp

OkHttpClient client = new OkHttpClient();

RequestBody body = RequestBody.create("{\n  \"agendas\": [\n    {\n      \"name\": \"Demo Trading Ltd\",\n      \"address\": {\n        \"street\": \"Street name\",\n        \"building_no\": \"6 - 8\",\n        \"city\": \"Bratislava\",\n        \"postal_code\": \"811 03\",\n        \"country\": \"sk\"\n      },\n      \"company_id\": \"12345678\",\n      \"company_tax_id\": \"1002003000\",\n      \"company_vat_id\": null,\n      \"home_currency\": \"EUR\",\n      \"client_id\": \"demo_client_id\"\n    }\n  ]\n}", MediaType.parse("application/json"));
Request request = new Request.Builder()
.url("https://app.datamolino.com/api/v1_2/agendas")
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer demo_access_token")
.method("POST", body)
.build();

Response response = client.newCall(request).execute();

C# HttpClient

using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://app.datamolino.com/api/v1_2/agendas");
request.Headers.Add("Authorization", "Bearer demo_access_token");
request.Content = new StringContent("{\n  \"agendas\": [\n    {\n      \"name\": \"Demo Trading Ltd\",\n      \"address\": {\n        \"street\": \"Street name\",\n        \"building_no\": \"6 - 8\",\n        \"city\": \"Bratislava\",\n        \"postal_code\": \"811 03\",\n        \"country\": \"sk\"\n      },\n      \"company_id\": \"12345678\",\n      \"company_tax_id\": \"1002003000\",\n      \"company_vat_id\": null,\n      \"home_currency\": \"EUR\",\n      \"client_id\": \"demo_client_id\"\n    }\n  ]\n}", Encoding.UTF8, "application/json");

using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Go Native

client := &http.Client{}
req, err := http.NewRequest("POST", "https://app.datamolino.com/api/v1_2/agendas", strings.NewReader("{\n  \"agendas\": [\n    {\n      \"name\": \"Demo Trading Ltd\",\n      \"address\": {\n        \"street\": \"Street name\",\n        \"building_no\": \"6 - 8\",\n        \"city\": \"Bratislava\",\n        \"postal_code\": \"811 03\",\n        \"country\": \"sk\"\n      },\n      \"company_id\": \"12345678\",\n      \"company_tax_id\": \"1002003000\",\n      \"company_vat_id\": null,\n      \"home_currency\": \"EUR\",\n      \"client_id\": \"demo_client_id\"\n    }\n  ]\n}"))
if err != nil { panic(err) }
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer demo_access_token")

res, err := client.Do(req)
if err != nil { panic(err) }
defer res.Body.Close()

body, err := io.ReadAll(res.Body)
if err != nil { panic(err) }
fmt.Println(string(body))

Swift URLSession

import Foundation

var request = URLRequest(url: URL(string: "https://app.datamolino.com/api/v1_2/agendas")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.setValue("Bearer demo_access_token", forHTTPHeaderField: "Authorization")
request.httpBody = "{\n  \"agendas\": [\n    {\n      \"name\": \"Demo Trading Ltd\",\n      \"address\": {\n        \"street\": \"Street name\",\n        \"building_no\": \"6 - 8\",\n        \"city\": \"Bratislava\",\n        \"postal_code\": \"811 03\",\n        \"country\": \"sk\"\n      },\n      \"company_id\": \"12345678\",\n      \"company_tax_id\": \"1002003000\",\n      \"company_vat_id\": null,\n      \"home_currency\": \"EUR\",\n      \"client_id\": \"demo_client_id\"\n    }\n  ]\n}".data(using: .utf8)

let (data, _) = try await URLSession.shared.data(for: request)
print(String(data: data, encoding: .utf8)!)

Responses

201 Created

Content type: application/json; charset=utf-8

{
  "agendas": [
    {
      "id": 23698
    }
  ]
}

Type to search…

↑↓ navigate↵ selectEsc close