Every request to the Lymo API targets the base URL https://api.lymo.jp. Requests and responses use JSON, and you authenticate each request with a Bearer token in the Authorization header.
All API requests go to https://api.lymo.jp. Follow these conventions when building your requests:
- Set
Content-Type: application/json on all POST requests that include a body.
- Include
Authorization: Bearer YOUR_API_KEY on every request.
- Send request bodies as a JSON object.
The following example creates a new plant:
curl -X POST https://api.lymo.jp/plants \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "monstera", "tag": "tropical"}'
Use the tabs below to see the same request in other languages:
curl -X POST https://api.lymo.jp/plants \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "monstera", "tag": "tropical"}'
All responses return JSON and include an HTTP status code. A successful response looks like this:
{
"id": 42,
"name": "monstera",
"tag": "tropical"
}
Parse the response body as JSON and check the status code to determine whether the request succeeded.
Checking the status code
Use the HTTP status code to understand the outcome of each request:
| Range | Meaning |
|---|
| 2xx | Success |
| 4xx | Client error (check your request) |
| 5xx | Server error (retry later) |
Use the limit query parameter on GET /plants to control how many results are returned per request.