{
  "openapi": "3.1.0",
  "info": {
    "title": "europe.social API",
    "version": "1.1.2",
    "summary": "Publish posts from automated accounts, plus the open interfaces RSS, WebFinger, NodeInfo and ActivityPub.",
    "description": "Automated accounts, such as a newspaper posting from its RSS feed or a weather service posting warnings, publish posts with an access key. Read the rules for automation at https://europe.social/regeln first. Errors of the endpoints for automated accounts are JSON with an error field; a wrong method on a known path is 405 with an Allow header.",
    "termsOfService": "https://europe.social/agb",
    "contact": {
      "name": "europe.social",
      "url": "https://europe.social/developers"
    }
  },
  "servers": [
    {
      "url": "https://europe.social"
    }
  ],
  "externalDocs": {
    "description": "Developer documentation",
    "url": "https://europe.social/developers"
  },
  "tags": [
    {
      "name": "Automation",
      "description": "Publish and delete posts of an automated account with an access key."
    },
    {
      "name": "Media",
      "description": "Upload images for a post."
    },
    {
      "name": "Feeds",
      "description": "RSS feeds of public profiles."
    },
    {
      "name": "Federation",
      "description": "WebFinger, NodeInfo and ActivityPub, for other servers in the fediverse."
    }
  ],
  "x-limits": {
    "postsPerHour": 30,
    "postsPerDay": 300,
    "maxKeysPerAccount": 10,
    "maxTextLength": 500,
    "maxMediaPerPost": 20,
    "maxUnpostedMedia": 40,
    "unpostedMediaDeletedAfterMinutes": 60,
    "maxImageBytes": 10485760,
    "maxImageEdge": 4096,
    "maxGifBytes": 10485760,
    "maxGifEdge": 2048,
    "maxJsonBodyBytes": 65536,
    "mediaUploadsPerWindow": 40,
    "mediaUploadWindowSeconds": 60,
    "publishRequestsPerWindow": 60,
    "publishRequestWindowSeconds": 60,
    "deleteRequestsPerWindow": 60,
    "deleteRequestWindowSeconds": 60,
    "termsVersion": "2026-11-28"
  },
  "paths": {
    "/api/v1/automation/posts": {
      "post": {
        "tags": [
          "Automation"
        ],
        "operationId": "createPost",
        "summary": "Publish a post",
        "description": "Publishes a post for the account the access key belongs to. Send JSON (Content-Type: application/json); every field is checked, a wrong type or an unknown value is answered with 400 and the field’s name, null counts as not given. A post needs text, images, or both. Replies, polls and threads can’t be created through the API; fields for them are ignored, as is every field not listed here. The account’s limits apply: at most 30 posts in any 60 minutes and 300 in any 24 hours, counting every published post of the account, also deleted ones and those written on the website or in the apps. Posts of a protected account are always visible to followers only. Mentions only notify accounts that follow the automated account (the rules allow mentions on request only); other @names stay plain text without a notification.",
        "security": [
          {
            "accessKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "description": "A JSON object, at most 64 KiB.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewPost"
              },
              "example": {
                "text": "Severe weather warning for Göttingen until 18:00. https://example.org/warning",
                "lang": "en"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The post is published.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostCreated"
                },
                "example": {
                  "ok": true,
                  "id": 42,
                  "url": "https://europe.social/@weather/posts/42"
                }
              }
            }
          },
          "400": {
            "description": "The post isn’t valid; error says why (for example, a field of the wrong type, an unknown visibility, too long, no text and no images, more than the allowed number of images, an image that doesn’t belong to the account, is already used or belongs to a draft). Also when the body isn’t a JSON object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "visibility must be one of: public, followers."
                }
              }
            }
          },
          "401": {
            "description": "The access key is malformed, unknown or revoked, the account is no longer marked as automated, or its owner hasn’t agreed to the current terms. Requests without a key, or signed in with a website or app session instead, get this answer too.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "A valid access key is required (Authorization: Bearer es_…)."
                }
              }
            }
          },
          "403": {
            "description": "A POST request without an Authorization header but with the session cookie of the europe.social website, sent from somewhere else than the website itself. Send the access key and this can’t happen.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Cross-site request: send the request with an Authorization header."
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 64 KiB. The server reads the rest and answers 413; only a body much larger than that (or one whose Content-Length already says so) is cut off, and then the connection closes after the answer.",
            "x-connection-may-close": true,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "The request body is too large."
                }
              }
            }
          },
          "415": {
            "description": "The body isn’t sent as JSON (Content-Type: application/json).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Send the post as JSON (Content-Type: application/json)."
                }
              }
            }
          },
          "429": {
            "description": "The account has reached its limit of 30 posts an hour or 300 posts a day. Retry-After and retry_after say in how many seconds a post is possible again. More than 60 requests within 60 seconds from the same account also get 429.",
            "headers": {
              "Retry-After": {
                "description": "Seconds until the account can post again.",
                "required": true,
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimited"
                },
                "example": {
                  "error": "Automated accounts can post up to 30 times an hour and 300 times a day.",
                  "retry_after": 1260
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/automation/posts/{id}": {
      "delete": {
        "tags": [
          "Automation"
        ],
        "operationId": "deletePost",
        "summary": "Delete a post",
        "description": "Deletes a post of the account the access key belongs to, also one written on the website or in an app. Other servers in the fediverse are told to delete it as well.",
        "security": [
          {
            "accessKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The id from the answer to “Publish a post”.",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "example": 42
          }
        ],
        "responses": {
          "200": {
            "description": "The post is deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                },
                "example": {
                  "ok": true
                }
              }
            }
          },
          "401": {
            "description": "The access key is malformed, unknown or revoked, the account is no longer marked as automated, or its owner hasn’t agreed to the current terms. Requests without a key, or signed in with a website or app session instead, get this answer too.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "A valid access key is required (Authorization: Bearer es_…)."
                }
              }
            }
          },
          "404": {
            "description": "There’s no post with this id, or it belongs to another account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Not found."
                }
              }
            }
          },
          "429": {
            "description": "Too many requests: more than 60 within 60 seconds from the same account.",
            "headers": {
              "Retry-After": {
                "description": "Seconds until the time window ends.",
                "required": true,
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimited"
                },
                "example": {
                  "error": "Too many requests. Please try again later.",
                  "retry_after": 60
                }
              }
            }
          }
        }
      }
    },
    "/media": {
      "post": {
        "tags": [
          "Media"
        ],
        "operationId": "uploadImage",
        "summary": "Upload an image",
        "description": "Uploads one image and returns its id for the media field of “Publish a post”. Send the file itself as the body; the format is recognised from its content, the Content-Type header isn’t checked. JPEG, PNG and WebP can be up to 4096 pixels wide and high, GIFs (also animated) up to 2048; every file up to 10 MiB. Location data and other metadata are removed. An account can have at most 40 uploaded images that aren’t in a post yet; images that aren’t used in a post within 60 minutes are deleted. Videos can’t be uploaded with an access key.",
        "security": [
          {
            "accessKey": []
          }
        ],
        "parameters": [
          {
            "name": "quelle",
            "in": "query",
            "required": false,
            "description": "Id of a public post this image shows (used by the apps for screenshots of posts). The image then links to that post.",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "example": 7
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "image/jpeg": {
              "schema": {
                "type": "string",
                "contentMediaType": "image/jpeg",
                "maxLength": 10485760
              }
            },
            "image/png": {
              "schema": {
                "type": "string",
                "contentMediaType": "image/png",
                "maxLength": 10485760
              }
            },
            "image/webp": {
              "schema": {
                "type": "string",
                "contentMediaType": "image/webp",
                "maxLength": 10485760
              }
            },
            "image/gif": {
              "schema": {
                "type": "string",
                "contentMediaType": "image/gif",
                "maxLength": 10485760
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The image is stored. url and poster are paths on this server.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Media"
                },
                "example": {
                  "id": 123,
                  "url": "/media/9f2b5c0e6a1d4b7c8e3f0a2b4c6d8e0f1a3b5c7d9e1f3a5b7c9d1e3f5a7b9c1d.jpg",
                  "poster": null,
                  "width": 1200,
                  "height": 800,
                  "alpha": false
                }
              }
            }
          },
          "400": {
            "description": "The file isn’t an image we can read, or it’s too large in pixels.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "This image could not be read. Please try another one."
                }
              }
            }
          },
          "401": {
            "description": "The access key is malformed, unknown or revoked, the account is no longer marked as automated, or its owner hasn’t agreed to the current terms. Requests without a key get this answer too.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Please sign in."
                }
              }
            }
          },
          "403": {
            "description": "A POST request without an Authorization header but with the session cookie of the europe.social website, sent from somewhere else than the website itself. Send the access key and this can’t happen.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Cross-site request: send the request with an Authorization header."
                }
              }
            }
          },
          "404": {
            "description": "quelle is set, but isn’t a public post the account can see.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Only public posts can be shared."
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 10 MiB. The server reads the rest and answers 413; only a body much larger than that (or one whose Content-Length already says so) is cut off, and then the connection closes after the answer.",
            "x-connection-may-close": true,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "This image is too large."
                }
              }
            }
          },
          "429": {
            "description": "The account already has 40 uploaded images that aren’t in a post (without Retry-After and retry_after). Or too many uploads, more than 40 within 60 seconds from the same account (with Retry-After and retry_after).",
            "headers": {
              "Retry-After": {
                "description": "Only when the time window is the reason: seconds until it ends.",
                "required": false,
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/RateLimited"
                    }
                  ]
                },
                "example": {
                  "error": "Too many unposted images. Post or remove some first."
                }
              }
            }
          },
          "503": {
            "description": "The image couldn’t be stored right now. Try again in a moment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "The upload didn’t work. Please try again in a moment."
                }
              }
            }
          }
        }
      }
    },
    "/@{name}/feed.rss": {
      "get": {
        "tags": [
          "Feeds"
        ],
        "operationId": "profileFeed",
        "summary": "RSS feed of a profile",
        "description": "The latest public posts of a profile as RSS 2.0, without shared posts. Posts with the Ad label start with the label in brackets, in the language of the post, for example [Ad]. Protected profiles have no feed.",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Username without @.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_]{1,15}$"
            },
            "example": "weather"
          }
        ],
        "responses": {
          "200": {
            "description": "The feed.",
            "content": {
              "application/rss+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "There’s no such account, or it’s protected. The answer is a web page.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/webfinger": {
      "get": {
        "tags": [
          "Federation"
        ],
        "operationId": "webfinger",
        "summary": "WebFinger (RFC 7033)",
        "description": "Finds the ActivityPub actor of an account that takes part in the fediverse (an option in the account’s privacy settings). Allowed from any website (Access-Control-Allow-Origin: *).",
        "parameters": [
          {
            "name": "resource",
            "in": "query",
            "required": true,
            "description": "acct:name@host, the profile URL or the actor URL.",
            "schema": {
              "type": "string"
            },
            "example": "acct:weather@europe.social"
          }
        ],
        "responses": {
          "200": {
            "description": "The account.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string",
                  "const": "*"
                },
                "required": true
              }
            },
            "content": {
              "application/jrd+json": {
                "schema": {
                  "$ref": "#/components/schemas/WebFinger"
                }
              }
            }
          },
          "400": {
            "description": "resource is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          },
          "404": {
            "description": "Unknown account, or it doesn’t take part in the fediverse.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          }
        }
      }
    },
    "/.well-known/nodeinfo": {
      "get": {
        "tags": [
          "Federation"
        ],
        "operationId": "nodeinfoLinks",
        "summary": "NodeInfo discovery",
        "responses": {
          "200": {
            "description": "Link to the NodeInfo document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeInfoLinks"
                }
              }
            }
          }
        }
      }
    },
    "/nodeinfo/2.1": {
      "get": {
        "tags": [
          "Federation"
        ],
        "operationId": "nodeinfo",
        "summary": "NodeInfo 2.1",
        "description": "Software, protocols and a short description. User numbers aren’t published.",
        "responses": {
          "200": {
            "description": "The NodeInfo document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeInfo"
                }
              }
            }
          }
        }
      }
    },
    "/ap/actor": {
      "get": {
        "tags": [
          "Federation"
        ],
        "operationId": "instanceActor",
        "summary": "Instance actor",
        "description": "The server’s own ActivityPub actor (type Application), used to sign requests to other servers.",
        "responses": {
          "200": {
            "description": "The actor.",
            "content": {
              "application/activity+json": {
                "schema": {
                  "$ref": "#/components/schemas/Actor"
                }
              }
            }
          }
        }
      }
    },
    "/ap/actor/outbox": {
      "get": {
        "tags": [
          "Federation"
        ],
        "operationId": "instanceOutbox",
        "summary": "Outbox of the instance actor",
        "description": "The instance actor doesn’t publish anything; its outbox is an empty collection.",
        "responses": {
          "200": {
            "description": "OrderedCollection without items.",
            "content": {
              "application/activity+json": {
                "schema": {
                  "$ref": "#/components/schemas/Collection"
                }
              }
            }
          }
        }
      }
    },
    "/ap/users/{id}": {
      "get": {
        "tags": [
          "Federation"
        ],
        "operationId": "actor",
        "summary": "Actor of an account",
        "description": "ActivityPub actor of an account that takes part in the fediverse: type Service for automated accounts (shown as a bot elsewhere, with the responsible person or organisation as “Operated by”), otherwise Person. Send Accept: application/activity+json; without it you’re redirected to the profile page. The profile URL /@name answers the same way with that Accept header.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Numeric account id, as in the actor URL.",
            "schema": {
              "type": "integer"
            },
            "example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "The actor.",
            "content": {
              "application/activity+json": {
                "schema": {
                  "$ref": "#/components/schemas/Actor"
                }
              }
            }
          },
          "302": {
            "description": "Without the ActivityPub Accept header: redirect to the profile page.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "required": true
              }
            }
          },
          "404": {
            "description": "Unknown account, or it doesn’t take part in the fediverse.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          }
        }
      }
    },
    "/ap/users/{id}/outbox": {
      "get": {
        "tags": [
          "Federation"
        ],
        "operationId": "outbox",
        "summary": "Outbox",
        "description": "Public posts of the account as Create activities, 20 per page, newest first. Without page=true the answer is the collection with a link to the first page.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 1
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "max_id",
            "in": "query",
            "required": false,
            "description": "Only posts with a smaller id (paging, see next).",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OrderedCollection, or with page=true an OrderedCollectionPage.",
            "content": {
              "application/activity+json": {
                "schema": {
                  "$ref": "#/components/schemas/Collection"
                }
              }
            }
          },
          "404": {
            "description": "Unknown account, or it doesn’t take part in the fediverse.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          }
        }
      }
    },
    "/ap/users/{id}/followers": {
      "get": {
        "tags": [
          "Federation"
        ],
        "operationId": "followers",
        "summary": "Followers collection",
        "description": "An empty collection without a count: who follows whom is only visible to the account itself.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "OrderedCollection without items.",
            "content": {
              "application/activity+json": {
                "schema": {
                  "$ref": "#/components/schemas/Collection"
                }
              }
            }
          },
          "404": {
            "description": "Unknown account, or it doesn’t take part in the fediverse.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          }
        }
      }
    },
    "/ap/users/{id}/following": {
      "get": {
        "tags": [
          "Federation"
        ],
        "operationId": "following",
        "summary": "Following collection",
        "description": "An empty collection without a count: who follows whom is only visible to the account itself.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "OrderedCollection without items.",
            "content": {
              "application/activity+json": {
                "schema": {
                  "$ref": "#/components/schemas/Collection"
                }
              }
            }
          },
          "404": {
            "description": "Unknown account, or it doesn’t take part in the fediverse.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          }
        }
      }
    },
    "/ap/posts/{id}": {
      "get": {
        "tags": [
          "Federation"
        ],
        "operationId": "note",
        "summary": "Post as ActivityPub Note",
        "description": "A public post of an account that takes part in the fediverse. Send Accept: application/activity+json; without it you’re redirected to the post’s page. Posts with the Ad label start with the label in brackets, in the language of the post. The post address /@name/posts/id answers the same way with that Accept header.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 42
          }
        ],
        "responses": {
          "200": {
            "description": "The Note.",
            "content": {
              "application/activity+json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          },
          "302": {
            "description": "Without the ActivityPub Accept header: redirect to the post’s page.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "required": true
              }
            }
          },
          "404": {
            "description": "Unknown, not public, or the account doesn’t take part in the fediverse.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          }
        }
      }
    },
    "/ap/inbox": {
      "post": {
        "tags": [
          "Federation"
        ],
        "operationId": "sharedInbox",
        "summary": "Shared inbox",
        "description": "Receives activities from other servers. Every request must carry an HTTP signature (draft-cavage) by the actor of the activity, with a Date header at most 60 minutes off the server’s clock; at most 256 KiB. A repeated signed request has no further effect. An actor document is fetched at most once every few minutes and stored only after a valid signature.",
        "requestBody": {
          "required": true,
          "content": {
            "application/activity+json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "actor"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          },
          "400": {
            "description": "Not JSON, no type, or no foreign actor.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          },
          "401": {
            "description": "Signature missing or not valid for the actor.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          },
          "403": {
            "description": "The sending server is blocked here.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          },
          "413": {
            "description": "The body is too large. Only a body much larger than the limit is cut off, then the connection closes after the answer.",
            "x-connection-may-close": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          }
        }
      }
    },
    "/ap/users/{id}/inbox": {
      "post": {
        "tags": [
          "Federation"
        ],
        "operationId": "inbox",
        "summary": "Inbox of an account",
        "description": "Receives activities from other servers. Every request must carry an HTTP signature (draft-cavage) by the actor of the activity, with a Date header at most 60 minutes off the server’s clock; at most 256 KiB. A repeated signed request has no further effect. An actor document is fetched at most once every few minutes and stored only after a valid signature.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 1
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/activity+json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "actor"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          },
          "400": {
            "description": "Not JSON, no type, or no foreign actor.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          },
          "401": {
            "description": "Signature missing or not valid for the actor.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          },
          "403": {
            "description": "The sending server is blocked here.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          },
          "413": {
            "description": "The body is too large. Only a body much larger than the limit is cut off, then the connection closes after the answer.",
            "x-connection-may-close": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "accessKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "es_ followed by 43 base64url characters",
        "description": "Access key of an automated account, created under Settings, Automation. It works only while the account is marked as automated and its owner has agreed to the terms of 2026-11-28 or a later version. A newer version of the terms does not stop keys from working.",
        "x-pattern": "^Bearer (es_[A-Za-z0-9_-]{43})$"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong, for people. The text can change and may be translated; don’t parse it, use the status code."
          }
        }
      },
      "RateLimited": {
        "type": "object",
        "required": [
          "error",
          "retry_after"
        ],
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "string"
          },
          "retry_after": {
            "type": "integer",
            "minimum": 1,
            "description": "Seconds until the account can post again (same as Retry-After)."
          }
        }
      },
      "Ok": {
        "type": "object",
        "required": [
          "ok"
        ],
        "additionalProperties": false,
        "properties": {
          "ok": {
            "const": true
          }
        }
      },
      "NewPost": {
        "type": "object",
        "description": "Text, media or both. Fields not listed here are ignored.",
        "anyOf": [
          {
            "required": [
              "text"
            ]
          },
          {
            "required": [
              "media"
            ]
          }
        ],
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 500,
            "description": "The text. Links, #hashtags and $cashtags work as on the website; @mentions notify only accounts that follow the automated account. Length is counted in characters (Unicode code points) after invisible and control characters are removed; spaces at the start and end don’t count."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "followers"
            ],
            "default": "public",
            "description": "Who can see the post. Other values are rejected with 400."
          },
          "reply_policy": {
            "type": "string",
            "enum": [
              "all",
              "following",
              "none"
            ],
            "default": "all",
            "description": "Who can reply: everyone, accounts the bot follows, or nobody. Other values are rejected with 400."
          },
          "cw": {
            "type": "string",
            "maxLength": 100,
            "x-truncated": true,
            "description": "Content warning, shown before the post. Longer text is shortened to 100 characters."
          },
          "ad": {
            "type": "boolean",
            "default": false,
            "description": "true if you get or expect something in return for the post; it then carries the Ad label. Also accepted: 1, \"1\", \"true\" and 0, \"0\", \"false\"; other values are rejected with 400."
          },
          "lang": {
            "type": "string",
            "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$",
            "description": "Language of the text as a language tag (for example de, en, pt-BR). Without it, or if it doesn’t match, the language is detected from the text."
          },
          "media": {
            "type": "array",
            "maxItems": 20,
            "description": "Up to 20 images uploaded with “Upload an image”, in this order. Each image can be used in one post only. Not an array: rejected with 400.",
            "items": {
              "type": "object",
              "required": [
                "id"
              ],
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "id from the answer to “Upload an image”."
                },
                "alt": {
                  "type": "string",
                  "maxLength": 1000,
                  "x-truncated": true,
                  "description": "Description of the image for people who can’t see it. Longer text is shortened to 1000 characters."
                }
              }
            }
          }
        }
      },
      "PostCreated": {
        "type": "object",
        "required": [
          "ok",
          "id",
          "url"
        ],
        "additionalProperties": false,
        "properties": {
          "ok": {
            "const": true
          },
          "id": {
            "type": "integer",
            "description": "Id of the new post, for deleting it."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Address of the post."
          }
        }
      },
      "Media": {
        "type": "object",
        "required": [
          "id",
          "url",
          "poster",
          "width",
          "height",
          "alpha"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "description": "Use it in media when publishing."
          },
          "url": {
            "type": "string",
            "pattern": "^/media/",
            "description": "Path of the file on this server; visible only to the account until the image is in a post."
          },
          "poster": {
            "type": [
              "string",
              "null"
            ],
            "description": "For GIFs: path of a still image of the first frame, otherwise null."
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "alpha": {
            "type": "boolean",
            "description": "true if the image has transparent areas."
          }
        }
      },
      "WebFinger": {
        "type": "object",
        "required": [
          "subject",
          "links"
        ],
        "properties": {
          "subject": {
            "type": "string",
            "pattern": "^acct:"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "links": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "rel",
                "href"
              ],
              "properties": {
                "rel": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "href": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        }
      },
      "NodeInfoLinks": {
        "type": "object",
        "required": [
          "links"
        ],
        "additionalProperties": false,
        "properties": {
          "links": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "rel",
                "href"
              ],
              "additionalProperties": false,
              "properties": {
                "rel": {
                  "type": "string"
                },
                "href": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        }
      },
      "NodeInfo": {
        "type": "object",
        "required": [
          "version",
          "software",
          "protocols",
          "services",
          "openRegistrations",
          "usage",
          "metadata"
        ],
        "properties": {
          "version": {
            "const": "2.1"
          },
          "software": {
            "type": "object",
            "required": [
              "name",
              "version"
            ]
          },
          "protocols": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "services": {
            "type": "object"
          },
          "openRegistrations": {
            "type": "boolean"
          },
          "usage": {
            "type": "object"
          },
          "metadata": {
            "type": "object"
          }
        }
      },
      "Actor": {
        "type": "object",
        "required": [
          "@context",
          "id",
          "type",
          "preferredUsername",
          "inbox",
          "publicKey"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uri"
          },
          "type": {
            "type": "string",
            "enum": [
              "Person",
              "Service",
              "Application"
            ]
          },
          "preferredUsername": {
            "type": "string"
          },
          "inbox": {
            "type": "string",
            "format": "uri"
          },
          "outbox": {
            "type": "string",
            "format": "uri"
          },
          "publicKey": {
            "type": "object",
            "required": [
              "id",
              "owner",
              "publicKeyPem"
            ]
          }
        }
      },
      "Collection": {
        "type": "object",
        "required": [
          "@context",
          "id",
          "type"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "OrderedCollection",
              "OrderedCollectionPage"
            ]
          },
          "first": {
            "type": "string"
          },
          "next": {
            "type": "string"
          },
          "orderedItems": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "Note": {
        "type": "object",
        "required": [
          "@context",
          "id",
          "type",
          "content",
          "attributedTo"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uri"
          },
          "type": {
            "const": "Note"
          },
          "content": {
            "type": "string"
          },
          "attributedTo": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  },
  "x-changelog": [
    {
      "date": "2026-12-02",
      "version": "1.1.2",
      "changes": [
        "Access keys need agreement to the terms of 2026-11-28 or a later version. A newer version of the terms (current: 2026-12-02) no longer stops keys from working until the owner agrees again."
      ]
    },
    {
      "date": "2026-12-01",
      "version": "1.1.1",
      "changes": [
        "The contact object of the description no longer names an email address, it points to the developer page. Contact details of the operator are shown on the website only after a click; error texts that used to name the address now link to the legal notice."
      ]
    },
    {
      "date": "2026-11-28",
      "version": "1.1.0",
      "changes": [
        "Publish a post accepts JSON only (415 otherwise) and checks every field: a wrong type or an unknown visibility or reply_policy is 400 with the field name instead of being read as the default. null counts as not given.",
        "The limit of posts per hour and day counts every published post, also deleted ones, and every part of a thread.",
        "Mentions by automated accounts only notify accounts that follow them; other @names stay plain text.",
        "All errors of the API are JSON with an error field, also 400 for a body that isn’t a JSON object, 413 for a body that is too large (sent before the connection closes), 429 with Retry-After and retry_after, and 401 for requests without a valid key. A wrong method on a known path is 405 with Allow.",
        "Rate limits for requests count per account, not per IP address: images, publishing and deleting.",
        "Images: only image data and the colour profile stay in JPEG and WebP files, all other segments are removed.",
        "ActivityPub: the instance actor has an (empty) outbox; signed requests may be at most one hour off the server’s clock."
      ]
    },
    {
      "date": "2026-11-28",
      "version": "1.0.0",
      "changes": [
        "First published version of the API for automated accounts: publish a post, delete a post, upload an image.",
        "Machine-readable description at /openapi.json (OpenAPI 3.1).",
        "Open interfaces documented: RSS, WebFinger, NodeInfo and ActivityPub."
      ]
    }
  ]
}