User documentation

    API Reference

    Assemblic provides a powerful, standardized API to interact with your OpenFisca rules. This allows you to build calculators, web forms, and backend integrations that rely on your single source of truth.

    Authentication

    To access the API, you must authenticate using an Access Token, or set your project to not be protected by an API Key.

    Managing Tokens

    1. Go to Access Tokens in the dashboard.
    2. Click New Token to generate a secure key.
    3. Enter a name for the token.
    4. Select the project(s) the token will be associated with.
    5. Click Create Token.
    6. Store this token securely. It will only be shown once.

    Create Token Dialog

    If a token is compromised, you can:

    • Revoke: Immediately disable the token.
    • Regenerate: Create a new token string for the existing entry (requires updating all clients).

    API Endpoints

    The OpenFisca API

    Your project’s API is fully compliant with the OpenFisca Web API specification.

    Base URL: Assemblic provides unique endpoints for your Production, Staging, and Development environments.

    To find your API base URLs:

    1. Go to the Projects list.
    2. Click the Access API Links button.
    3. Click the link for the environment you wish to query.

    Access API Links

    Common Operations

    • /entities: List the entities defined in your project.
    • /parameters: Query the parameters of your tax and benefit system.
    • /calculate: The core endpoint. Send a JSON payload describing a situation (entities + variables) and receive the calculated results.

    Example Request

    curl -X POST https://api.assemblic.com/v1/projects/<project-id>/calculate \
      -H "Authorization: Bearer <your-access-token>" \
      -H "Content-Type: application/json" \
      -d '{
        "persons": {
          "person1": {
            "salary": { "2023-01": 50000 }
          }
        }
      }'