Entities

Find or create an entity

Find-or-create by kind and name, the app's own rule: the same name answers the same entity (200, created: false), a new one is 201. No kind means character; a look names its character in parent_id. refs and traits are then saved exactly as PATCH /v1/entities/{id} saves them — refs REPLACE the set, also on an entity the name found. A body they refuse is a 400, and an entity this call had just made is not left behind. Free.

post/v1/entities

Request

  • Base URL: https://nanostudiopro.com/api
  • URL: https://nanostudiopro.com/api/v1/entities
  • Auth: HTTP bearer

Request body

namestring required
parent_idstring

A look's character.

kind'character' | 'prop' | 'location' | 'look' | 'skin'
traitsobject

MERGED onto what is there: bio field by field (null clears one; a prop or a place has description and notes), voice, font, specs and slot each whole.

Example request

{
  "name": "Nano",
  "refs": [
    {
      "role": "front"
    }
  ],
  "traits": {
    "bio": {
      "description": "A girl who follows music into the woods"
    }
  }
}

Response

Found by name

idstring
namestring
slugstring
kind'character' | 'prop' | 'location' | 'look' | 'skin'
parent_idstring nullable

A look's character; null for every other kind.

photo_countinteger

Distinct scans this entity is tagged on — what the app calls photos. OPTIONAL because it is a list-only field: GET /v1/entities/{id} leaves the key out rather than returning a zero, since there facets[].count is the number that matters and recounting would cost the detail view a query it never asked for.

created_atstring date-time
createdboolean

Example response

{
  "id": "cmod4q3op00011dod8a0omywd",
  "name": "Pancho",
  "slug": "pancho",
  "photo_count": 12,
  "bio": {
    "born": "1983"
  },
  "specs": {
    "fields": [
      {
        "key": "top_speed",
        "label": "Top speed",
        "value": "250 km/h"
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 2 revisions of this API.