Guides Getting Started Creating goals Technical API Reference

anygoal API

This API is in beta for now, please let us know if you encounter any issue or need to access data that isn't documented here. We strive to be fast to respond: hello@anygoal.app

Authentication

We expect the API key to be included in all requests to the server in a header that looks like the following:

Authorization: your_access_token

Example:

curl "api_endpoint_here"
    -H "Authorization: your_access_token"

You may also send it in the body of a POST request as the parameter token although that is not recommended in production.

Report new data for a goal

POST /api/v1/goal/:goalId/log

Post data as form-data or json.

Body

field optional description
value no Current value
date yes Specificy for which date this report should go
reporterEmail yes Associate this report to a specific email
comment yes A comment to go with the value

Get a goal data

The data for a goal includes its parameters as a goal plus an array with its reported values.

GET /api/v1/goal/:goalId

It will return a JSON object looking like this:

{
    created: "2019-12-04T09:54:47.117Z",
    startDate: ISO Date,
    deadline: ISO Date,
    name: "Revenue",
    unit: "$",
    goal: "grow",
    threshold: "over",
    relativeGrowth: true,
    target: 10000,
    frequency: "month",
    tolerance: 5,
    reporterEmail: "tom@anygoal.app", // The person assigned to the goal
    reports: [{
        created: "2019-12-04T09:54:47.117Z",
        filled: "2019-12-04T10:00:47.117Z",
        reporterEmail: "tom@anygoal.app",
        value: 10018,
        comment: "We're well on track for this month."
    }]
}