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

# Count a start of a game by someone not signed in

> The play page sends this when a browser game starts for someone who isn't signed in. A signed-in player's start is their play session (`POST /me/play-sessions`), so from them this counts nothing. Answers its public stats, and the play's id, for timing how long it lasts.



## OpenAPI

````yaml /api-reference/openapi.json post /projects/{owner}/{slug}/plays
openapi: 3.1.0
info:
  title: Patch API
  version: 1.0.0
  description: >-
    The public API behind patch.gg, the desktop app and pch. Changes within v1
    are additive only. Errors are { error: { code, message, details } }; branch
    on code.
servers:
  - url: https://patch.gg/api/v1
security: []
paths:
  /projects/{owner}/{slug}/plays:
    post:
      tags:
        - Projects
      summary: Count a start of a game by someone not signed in
      description: >-
        The play page sends this when a browser game starts for someone who
        isn't signed in. A signed-in player's start is their play session (`POST
        /me/play-sessions`), so from them this counts nothing. Answers its
        public stats, and the play's id, for timing how long it lasts.
      parameters:
        - schema:
            type: string
            example: patch
          required: true
          name: owner
          in: path
        - schema:
            type: string
            example: demo-mod
          required: true
          name: slug
          in: path
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                visitor:
                  type: string
                  maxLength: 100
                  description: >-
                    The browser's product analytics id, so a later rule can
                    count people
      responses:
        '200':
          description: Its stats now
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectPlayAnswer'
        '308':
          description: Renamed; follow the Location header
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Not signed in
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ProjectPlayAnswer:
      allOf:
        - $ref: '#/components/schemas/ProjectStatsAnswer'
        - type: object
          properties:
            play:
              type:
                - object
                - 'null'
              properties:
                id:
                  type: string
                  format: uuid
                  description: >-
                    This play's id: send `POST /plays/{id}/heartbeat` every
                    `heartbeat_s` seconds, then `POST /plays/{id}/end`
                heartbeat_s:
                  type: integer
              required:
                - id
                - heartbeat_s
              description: Null when this start wasn't counted
          required:
            - play
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: version_exists
            message:
              type: string
            details: {}
          required:
            - code
            - message
      required:
        - error
    ProjectStatsAnswer:
      type: object
      properties:
        stats:
          $ref: '#/components/schemas/ProjectStats'
        liked:
          type:
            - boolean
            - 'null'
          description: Whether you like it; null when you're not signed in
      required:
        - stats
        - liked
    ProjectStats:
      type: object
      properties:
        plays:
          type: integer
          description: >-
            Every start of the game: each play session of someone signed in, and
            each start by someone who isn't. A game's cards and page show it.
        views:
          type: integer
          description: >-
            Every open of the project's page, refreshes and its own team's
            included; bots are left out. A block's cards and page show it.
        likes:
          type: integer
          description: One per signed-in person who likes it
        remixes:
          type: integer
          description: >-
            Every copy ever made of it, from the moment it's made: private ones
            and ones never released included, and it never goes down when one is
            deleted
      required:
        - plays
        - views
        - likes
        - remixes
      description: >-
        What everyone sees on a project's cards and page. Counted generously for
        now: the creator's own plays and views count, and there's no daily cap.

````

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