> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pincast.fm/llms.txt
> Use this file to discover all available pages before exploring further.

# List the apps on Pincast

> Every app Pincast lists, with cards on Placecard or without: the featured app first while its slot runs, then every app by name. An app joins the list once Pincast has reviewed it, and leaves it when Pincast hides it or disables it. Pincast sets each app's description, icon, category, color and featured slot at the review.

Public: no key needed, and a key sent is ignored (never checked, counted or logged), so a web page may call it too. The answer is the same for everyone: the edge keeps it 5 minutes, and may give a copy up to a day old while it fetches a fresh one. Every text field is plain text: escape it before you put it in a page.



## OpenAPI

````yaml /api-reference/openapi.json get /apps
openapi: 3.1.0
info:
  title: Placecard registry
  version: 1.0.0
  summary: Register your app's cards with Placecard and record what people collect.
  description: >-
    Seven calls. Six go from your server with your app key: register a card set
    and its cards, record a collect, read what one person holds, link a person
    when they sign in to your app, move a guest's cards to them, and read a set
    back. The seventh, the list of apps on Pincast, is public and needs no key.


    Addresses: call https://api.pincast.fm/v1 with your key in the X-Pincast-Key
    header. The older address, https://www.pincaster.com/api/placecard/v1, and
    the header's older name, X-Placecard-Key, keep working: the same calls and
    the same answers, except that a key error at the older address names
    X-Placecard-Key.


    Checks run in this order on every call that takes a key: the key first (400
    when X-Pincast-Key and X-Placecard-Key both come and differ, 401 without
    one, 403 for a wrong, revoked, expired or disabled one), then your key's
    limit (429), then the set id (400), then the Idempotency-Key when one is
    sent (400), then the body (400), then, for a collect for a signed in person
    and for a claim, that person's sign-in link (403). Every error answers with
    the same JSON body: see the Error schema. On a 4xx its data says what to do:
    a code to branch on, the field at fault when there is one, and a fix in one
    sentence.


    Retries: every call is safe to send again, and each write says how. For the
    three writes (PUT a set, POST a collect, POST a claim) you can also send an
    Idempotency-Key header: Placecard keeps the first 200 answer to that key for
    24 hours and answers a retry with it, marked Idempotent-Replayed: true,
    without running the call again.


    Sign-in: when a person signs in to your app through id.pincast.fm, send
    their ID token to POST /people once. Placecard checks it with id.pincast.fm
    and links the person to your app. From then on your key can record collects
    (actor.source logto) and claims (to) for that person, and for nobody who has
    not signed in to your app: those calls answer 403. Guest collects need no
    link, and a guest token is never a person's id: a guest collect for an id
    that holds cards in your app as a signed-in person answers 409. Placecard
    reads only the token's issuer, subject, audience and times, and keeps none
    of the person's profile.


    Limits: each key takes 600 calls a minute, counted over the last 60 seconds,
    unless Pincast gave it a limit of its own. Past it, a call answers 429 with
    a Retry-After header, the seconds to wait. A refused call does not count, so
    the call sent after the wait goes through. Placecard logs each call made
    with your key (its time, method, path without the query string, key and
    answer, never the body) and keeps the log 90 days. The list of apps has no
    limit of its own and logs nothing: its answer is the same for everyone, and
    the edge keeps it 5 minutes.


    This file describes the registry as it runs today. The tests in
    tests/placecardApiV1.test.js send every example here to the real handlers
    and fail when an answer and this file disagree.
servers:
  - url: https://api.pincast.fm/v1
    description: >-
      Production: the Pincast address for the card registry. Send your key in
      X-Pincast-Key.
  - url: https://www.pincaster.com/api/placecard/v1
    description: >-
      Production, the older address, kept working: the same calls and answers,
      and a key error here names X-Placecard-Key. Use api.pincast.fm for new
      work.
security:
  - pincastKey: []
tags:
  - name: Sets
    description: Card sets and their cards.
  - name: Collects
    description: What people collect, and what they hold.
  - name: Claims
    description: A guest's cards, moved to them when they sign in.
  - name: People
    description: The people who signed in to your app.
  - name: Apps
    description: The apps listed on Pincast.
paths:
  /apps:
    get:
      tags:
        - Apps
      summary: List the apps on Pincast
      description: >-
        Every app Pincast lists, with cards on Placecard or without: the
        featured app first while its slot runs, then every app by name. An app
        joins the list once Pincast has reviewed it, and leaves it when Pincast
        hides it or disables it. Pincast sets each app's description, icon,
        category, color and featured slot at the review.


        Public: no key needed, and a key sent is ignored (never checked, counted
        or logged), so a web page may call it too. The answer is the same for
        everyone: the edge keeps it 5 minutes, and may give a copy up to a day
        old while it fetches a fresh one. Every text field is plain text: escape
        it before you put it in a page.
      operationId: getApps
      responses:
        '200':
          description: The listed apps.
          headers:
            Cache-Control:
              $ref: '#/components/headers/AppsCacheControl'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/AnyOrigin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppsResponse'
              examples:
                directory:
                  summary: >-
                    Three listed apps: the featured one first, then the rest by
                    name. Demo shows the story's set: its species card counts,
                    and the tree under it is a place.
                  value:
                    apps:
                      - id: skywatch
                        name: Sky Watch
                        description: >-
                          The birds of your city's parks, one card for each kind
                          you spot.
                        url: https://skywatch.example
                        icon: https://skywatch.example/icon.png
                        color: '#2f6f4f'
                        category: nature
                        featured:
                          note: New on Pincast
                          until: null
                        cardApp: true
                        cardCount: 3
                      - id: demo
                        name: Demo
                        description: The trees of Central Park, one card for each species.
                        url: https://demo.example
                        icon: null
                        color: '#3b5bdb'
                        category: nature
                        featured: null
                        cardApp: true
                        cardCount: 1
                      - id: nightowl
                        name: Night Owl
                        description: Late shows and open kitchens near you, after ten.
                        url: https://nightowl.example
                        icon: https://nightowl.example/icon.png
                        color: null
                        category: food
                        featured: null
                        cardApp: false
                        cardCount: 0
        default:
          $ref: '#/components/responses/ServerError'
      security: []
components:
  headers:
    AppsCacheControl:
      description: >-
        The edge keeps the list 5 minutes, and may give a copy up to a day old
        while it fetches a fresh one.
      schema:
        type: string
        const: public, s-maxage=300, stale-while-revalidate=86400
    AnyOrigin:
      description: Any web page may read the list.
      schema:
        type: string
        const: '*'
  schemas:
    AppsResponse:
      type: object
      required:
        - apps
      additionalProperties: false
      properties:
        apps:
          type: array
          items:
            $ref: '#/components/schemas/App'
          description: The featured app first while its slot runs, then every app by name.
    App:
      type: object
      required:
        - id
        - name
        - description
        - url
        - icon
        - color
        - category
        - featured
        - cardApp
        - cardCount
      additionalProperties: false
      properties:
        id:
          type: string
          pattern: ^[a-z0-9-]{1,32}$
          description: 'The app''s id: the one in its key, and app on every set and card.'
        name:
          type: string
          minLength: 1
          maxLength: 80
        description:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 200
          description: >-
            What the app is, in a sentence or two of plain text. Null when it
            has none yet.
        url:
          type:
            - string
            - 'null'
          pattern: ^https://
          description: The app's home page, always https. Null when it has none.
        icon:
          type:
            - string
            - 'null'
          pattern: ^https://\S+$
          maxLength: 1000
          description: The address of the app's icon, always https. Null when it has none.
        color:
          type:
            - string
            - 'null'
          pattern: ^#[0-9a-fA-F]{6}$
          description: >-
            The app's color as #rrggbb, for its chips, pins and marks. Null when
            it has none.
        category:
          type:
            - string
            - 'null'
          enum:
            - walks
            - nature
            - history
            - art
            - food
            - games
            - making
            - null
          description: >-
            What kind of app it is, one of a short list Pincast keeps. The list
            may grow. Null when it has none yet.
        featured:
          type:
            - object
            - 'null'
          required:
            - note
            - until
          additionalProperties: false
          description: >-
            Set on the featured app while its slot runs, null on every other
            app. One app at a time.
          properties:
            note:
              type:
                - string
                - 'null'
              minLength: 1
              maxLength: 200
              description: A line on why the app is featured, or null.
            until:
              type:
                - string
                - 'null'
              format: date-time
              description: When the slot ends, or null when Pincast ends it by hand.
        cardApp:
          type: boolean
          description: >-
            true when the app has cards on Placecard: a listed set with one card
            or more.
        cardCount:
          type: integer
          minimum: 0
          description: >-
            The cards in the app's listed sets that Placecard shows as cards:
            active ones that show on their own: not an experience (a walk, say),
            not a place (a tree), and with no parent or an experience for a
            parent.
    Error:
      type: object
      description: >-
        The body of every error. message says what was wrong, for a person to
        read; statusCode repeats the HTTP status; data, on every 4xx and on a
        503, says what to do.
      required:
        - url
        - statusCode
        - statusMessage
        - message
      additionalProperties: false
      properties:
        url:
          type: string
          description: The path that was called.
        statusCode:
          type: integer
          minimum: 400
          maximum: 599
        statusMessage:
          type: string
          description: Empty, or Not Found on a 404.
        message:
          type: string
        stack:
          type: string
          description: Always empty in production.
        data:
          $ref: '#/components/schemas/ErrorData'
    ErrorData:
      type: object
      description: >-
        What to do about a 4xx or a 503. Branch on code: it stays the same from
        release to release, while message and fix are for people and may be
        worded better later.
      required:
        - code
        - fix
      additionalProperties: false
      properties:
        code:
          type: string
          enum:
            - key_missing
            - key_invalid
            - key_expired
            - key_conflict
            - rate_limited
            - set_id_invalid
            - idempotency_key_invalid
            - body_not_json
            - field_required
            - field_invalid
            - too_many_cards
            - duplicate_card_key
            - parent_not_registered
            - too_many_actors
            - same_player
            - set_not_registered
            - card_not_registered
            - card_retired
            - actor_signed_in
            - idempotency_key_reused
            - token_invalid
            - token_expired
            - token_other_app
            - person_not_signed_in
            - signin_check_unavailable
          description: >-
            Each code with the status it comes with: key_missing 401,
            key_invalid 403, key_expired 403, key_conflict 400, rate_limited
            429, set_id_invalid 400, idempotency_key_invalid 400, body_not_json
            400, field_required 400, field_invalid 400, too_many_cards 400,
            duplicate_card_key 400, parent_not_registered 400, too_many_actors
            400, same_player 400, set_not_registered 404, card_not_registered
            404, card_retired 409, actor_signed_in 409, idempotency_key_reused
            422, token_invalid 400, token_expired 400, token_other_app 403,
            person_not_signed_in 403, signin_check_unavailable 503.
            field_required is a field left out or blank; field_invalid is one
            sent with the wrong type, shape, length or range. key_conflict is a
            call that sent X-Pincast-Key and X-Placecard-Key with different
            keys.
        field:
          type: string
          description: >-
            Where the fault is: a body field's path (name, meta.checkout,
            cards[3].key, card.title, actor.id, to, token), the set path
            parameter (set), the actor query parameter (actor), or a header
            (X-Pincast-Key at api.pincast.fm, X-Placecard-Key at the older
            address, Idempotency-Key). Left out when no one field is at fault.
        fix:
          type: string
          minLength: 1
          description: What to send instead, in one sentence.
  responses:
    ServerError:
      description: >-
        Something failed on Placecard's side. Message: internal server error.
        Safe to send the same call again later.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    pincastKey:
      type: apiKey
      in: header
      name: X-Pincast-Key
      description: >-
        Your app's key, sent on every call from your server only. It reads pck_,
        your app id, an underscore, then a secret of 20 or more letters, digits,
        underscores or hyphens. Never put it in a web page, an app bundle or a
        query string. Placecard stores only its sha256.


        Your app can hold two live keys at once, so a key is replaced with no
        outage: the new key works at once, and the old one keeps working until
        its expiry (seven days after the new key is made, unless you ask for
        less). A revoked key is refused from the next call.


        X-Placecard-Key, the older name of this header, is taken too, at either
        address. Send one of the two; if both come and they differ, the call
        answers 400 key_conflict.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.