Fediverse and Bluesky

Bluesky

atproto-service

Finding and following people on Bluesky, and a person's own Bluesky account connected, which what they do here is written as. Optional: an installation may not run it (federation.md, Bluesky).

Find somebody on Bluesky

GET/atproto/lookup

They are kept here, so that they can be followed as anybody is. Thirty lookups in ten minutes.

Who: Somebody signed in

Parameters

  • qstringin query
    What was typed: a handle with or without its @ (alice.bsky.social), a DID, or the address of their profile page.

Answers

  • 200
    OK
    atproto.RemotePerson application/json
  • 400
    lookup_unreadable: not something that names an account
    Refusal application/json
  • 401
    no token, or one that has expired
  • 404
    lookup_not_found, there is nobody by that name; lookup_is_here, it is somebody of this installation; lookup_refused, Bluesky or their name is refused here
    Refusal application/json
  • 429
    too_many_lookups
    Refusal application/json
  • 502
    lookup_failed: Bluesky could not be asked
    Refusal application/json

Request

curl "https://api.example.org/atproto/lookup" \
  -H "Authorization: Bearer $TOKEN"

Answer · 200

{
  "alias": "string",
  "body": "string",
  "id": 42,
  "locked": false,
  "name": "string",
  "origin_domain": "string",
  "type": "string",
  "uri": "https://example.org/",
  "url": "https://example.org/"
}

Copy a post's pictures here again

POST/atproto/posts/{id}/pictures

The pictures of a post from Bluesky that has been left alone a while are removed from storage, and the post says so (media_removed). Asked here, they are read again from Bluesky and copied as they were. For anybody signed in who may see the post.

Who: Somebody signed in

Parameters

  • idintegerrequiredin path
    The post's id here.

Answers

  • 200
    OK
    PicturesRestored application/json
  • 400
    the request is not well formed, or a value in it is not one it may be
  • 401
    no token, or one that has expired
  • 404
    media_not_removed: there is no such post the viewer may see, or its pictures are here
    Refusal application/json
  • 410
    media_gone: they are not on Bluesky any more
    Refusal application/json
  • 429
    too_many_requests
    Refusal application/json
  • 502
    media_failed: Bluesky could not be asked
    Refusal application/json

Request

curl -X POST "https://api.example.org/atproto/posts/<id>/pictures" \
  -H "Authorization: Bearer $TOKEN"

Answer · 200

{
  "restored": 1
}

The viewer's Bluesky account

GET/atproto/settings

Or a website's, with profile_id, for one of its administrators.

Who: Somebody signed in

Parameters

  • profile_idintegerin query
    A website the viewer is an administrator of. Left out, the viewer.

Answers

  • 200
    OK
    atproto.Settings application/json
  • 400
    the request is not well formed, or a value in it is not one it may be
  • 401
    no token, or one that has expired
  • 403
    bluesky_not_yours: profile_id is not a website the viewer is an administrator of
    Refusal application/json
  • 404
    bluesky_writing_off: this installation does not write to Bluesky; bluesky_not_yours, there is no such website
    Refusal application/json

Request

curl "https://api.example.org/atproto/settings" \
  -H "Authorization: Bearer $TOKEN"

Answer · 200

{
  "broken": false,
  "connected": false,
  "did": "string",
  "handle": "string"
}

Connect the viewer's Bluesky account

PUT/atproto/settings

With an app password, which is exchanged for a token and not kept. Ten tries in ten minutes. With profile_id, a website's account, for one of its administrators: its notes then go to Bluesky as that account, and what the account posts there itself is not made a post of the website.

Who: Somebody signed in

Body application/json

  • app_passwordstring
    An app password made in Bluesky's settings, never the account's own password. Not kept: it is exchanged for a token, kept encrypted.
  • handlestring
    The Bluesky handle: alice.bsky.social.

Answers

  • 200
    OK
    atproto.Settings application/json
  • 400
    bluesky_unreadable
    Refusal application/json
  • 401
    no token, or one that has expired
  • 403
    bluesky_denied: the password is not taken
    Refusal application/json
  • 404
    bluesky_writing_off: this installation does not write to Bluesky; bluesky_not_found, there is no such account; lookup_refused, Bluesky is refused here
    Refusal application/json
  • 409
    bluesky_taken: somebody else here connected that account
    Refusal application/json
  • 429
    too_many_tries
    Refusal application/json
  • 502
    bluesky_failed
    Refusal application/json

Request

curl -X PUT "https://api.example.org/atproto/settings" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "app_password": "string",
    "handle": "string"
  }'

Answer · 200

{
  "broken": false,
  "connected": false,
  "did": "string",
  "handle": "string"
}

Disconnect it

DELETE/atproto/settings

The token is forgotten. What was written stays on Bluesky. With profile_id, a website's.

Who: Somebody signed in

Parameters

  • profile_idintegerin query
    A website the viewer is an administrator of. Left out, the viewer.

Answers

  • 200
    OK
    atproto.Settings application/json
  • 400
    the request is not well formed, or a value in it is not one it may be
  • 401
    no token, or one that has expired
  • 404
    bluesky_writing_off: this installation does not write to Bluesky
    Refusal application/json

Request

curl -X DELETE "https://api.example.org/atproto/settings" \
  -H "Authorization: Bearer $TOKEN"

Answer · 200

{
  "broken": false,
  "connected": false,
  "did": "string",
  "handle": "string"
}

What following here whoever the viewer follows on Bluesky would do

GET/atproto/settings/import-follows

Who: Somebody signed in

Answers

  • 200
    OK
    atproto.ImportPreview application/json
  • 401
    no token, or one that has expired
  • 404
    bluesky_writing_off: this installation does not write to Bluesky
    Refusal application/json
  • 409
    bluesky_not_connected
    Refusal application/json
  • 502
    bluesky_failed
    Refusal application/json

Request

curl "https://api.example.org/atproto/settings/import-follows" \
  -H "Authorization: Bearer $TOKEN"

Answer · 200

{
  "following": 1,
  "most": 1,
  "posts_of_each": 1
}

Follow here whoever the viewer follows on Bluesky

POST/atproto/settings/import-follows

The ones followed most lately first, leaving out whoever is refused or blocked. Answered at once and carried on with afterwards. Nothing is written to Bluesky. Three times an hour.

Who: Somebody signed in

Body application/json

  • limitinteger
    How many accounts to follow here, beginning with the ones followed most lately.

Answers

  • 202
    Accepted
    atproto.ImportStarted application/json
  • 400
    the request is not well formed, or a value in it is not one it may be
  • 401
    no token, or one that has expired
  • 404
    bluesky_writing_off: this installation does not write to Bluesky
    Refusal application/json
  • 409
    bluesky_not_connected
    Refusal application/json
  • 429
    too_many_tries
    Refusal application/json
  • 502
    bluesky_failed
    Refusal application/json

Request

curl -X POST "https://api.example.org/atproto/settings/import-follows" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "limit": 1
  }'

Answer · 202

{
  "limit": 1,
  "started": false
}

Written by Claude, reviewed by Rastin Mehr · About this