API pipeline: Create and edit your project page

Index: API pipelines — index

Goal: create your project page and keep it current: text, place, photos, contacts, translations and who can see it.

Steps

  1. Create.
POST /v0/my/projects
Idempotency-Key: proj-bikes-1
{"title": "Bike repair in Lisbon", "content": "What I offer, prices, hours…",
 "language": "en", "handle": "example-bikes",
 "rubrics": ["<rubric nonce>"], "location": "<place nonce>",
 "translate_mode": "auto"}
→ {"nonce": "470000000000000001", "card_type": "project", "visibility": "Private", "handle": "example-bikes", …}
  1. Photos. Upload, then attach:
POST /v0/my/media/upload      (multipart/form-data, up to 10 images, 10 MB each)
→ {"files": [{"hash": "<sha256>", "format": "webp", "width": 1200, "height": 800, …}]}

PATCH /v0/my/projects/470000000000000001
{"avatar": "media:<sha256>.webp", "media_add": ["media:<sha256>.webp"]}

media replaces the whole gallery (ordered, up to 20; [] clears it); media_add appends; avatar sets the round picture. Keep images out of content.

  1. Contacts.
POST /v0/my/projects/470000000000000001/contacts
Idempotency-Key: proj-bikes-contact-1
{"kind": "Telegram", "value": "@example", "is_primary": true,
 "publicity": "Everyone", "requires_reveal": true}
→ {"nonce": "470000000000000011", "kind": "Telegram", "value": "@example", …}
  1. Edit text, place, rubrics: PATCH /v0/my/projects/{nonce} with any of title, content, language (which language you are writing), handle, rubrics, location, canonical_lang (the original language), translate_mode + translate_langs. Fields you leave out stay as they are.

  2. Publish.

PATCH /v0/my/projects/470000000000000001
{"visibility": "Public", "publicity": "Everyone",
 "permissions": {"read": true, "write": false, "execute": false}}
  1. Check it: GET /v0/graph/projects/{nonce | @handle} shows the page as others see it; GET /v0/my/projects/{nonce} as its owner.

Behind

Rules

API surface

Endpoint Purpose FE AI / oracle
POST /v0/my/projects Create (Private) yes yes
PATCH /v0/my/projects/{nonce} Edit text, place, photos, visibility yes yes
GET /v0/my/projects, /v0/my/projects/{nonce} Your projects yes yes
POST /v0/my/media/upload Upload images yes yes
POST / GET /v0/my/projects/{ident}/contacts Add / list contacts yes yes
PATCH / DELETE /v0/my/contacts/{nonce} Edit / remove a contact yes yes
GET /v0/graph/projects/{ident} The public page yes yes

Mentioned