Lightyear APIReference
v1.0.0
OAS 3.0.3

Lightyear API

Lightyear API

Server: https://app.runlightyear.com/api/v1
Client Libraries

collections

Upsert an object

Path Parameters
  • envName
    Type:string
    required

    Environment name (dev | prod)

  • collectionName
    Type:string
    required

    Collection name

  • modelName
    Type:string
    required

    Model name

Body
application/json
  • syncId
    Type:string
    required

    The id of the currently running sync

  • managedUserId
    Type:string
    required

    The id of the user in your system. Only required when the sync is for ALL managed users.

  • objectId
    Type:string

    The id of the object in the collection

  • localObjectId
    Type:string
    required

    The id of the object in your system

  • localUpdatedAt
    Type:string Format: date-time
    required

    The string representation of when the object was updated in your system

  • data
    Type:object

    The object data

  • overwrite
    Type:boolean

    Whether to overwrite the object if it already exists. Default: false

Responses
  • application/json
  • 401

    Unauthorized

Request Example forPOST/envs/{envName}/collections/{collectionName}/models/{modelName}/objects/upsert
curl 'https://app.runlightyear.com/api/v1/envs/{envName}/collections/{collectionName}/models/{modelName}/objects/upsert' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: YOUR_SECRET_TOKEN' \
  --data '{
  "syncId": "",
  "managedUserId": "",
  "objectId": "",
  "localObjectId": "",
  "localUpdatedAt": "",
  "data": {},
  "overwrite": true
}'
{
  "message": "Upserted"
}

Models