Reference

Build on the Lucra API.

Drag a sticker to move it, or use the arrow keys while focused.

Messages

Conversations with creators.

Conversations between an account and its creators. Everything an inbox needs is on the API, so you can build your own.

GET /v1/threads lists conversations and GET /v1/messages?thread=thr_… reads one. Start one with a creator you work with (or reopen the existing one) with POST /v1/threads:

JSON
{ "kind": "direct", "with": "crtr_06ZqNevhUeDnqxzC6VkeuQr", "message": { "body": "Welcome aboard!" } }

Reply with POST /v1/messages:

JSON
{ "thread": "thr_06ZqNevhUeDnqxzC6VkeuQr", "body": "Loved the first cut!" }

PATCH /v1/messages/:id edits or deletes a message you sent (send its version) or sets a reaction: { "reaction": { "emoji": "🎉", "active": true } }.

A partner does all of this as a roster creator with Lucra-Account: crtr_…. The message.created webhook tells you when one arrives. Read and unread, muting and live updates are yours to keep in your own app: track what each of your users has seen against message IDs.

Endpoints

GET/v1/messages
As creatorread

List messages

SDKlucra.messages.list({ query })

Query parameters

  • limitinteger
  • cursorstring
  • createdAfterstring

    Only items created at or after this time.

  • createdBeforestring

    Only items created before this time.

  • threadthr_…
Response200A page of items, 12 fields each, and nextCursorShow
  • idstring
  • threadstring
  • senderobject
    Show 4 child fields
    • idstring
    • typeenum
      organizationcreatorsupport
    • namestringnullable
    • avatarstringnullable
  • automatedboolean
  • bodystring
  • filesobject[]
    Show 8 child fields
    • idstring
    • namestring
    • kindenum
      imagevideodocument
    • sizenumbernullable
    • widthnumbernullable
    • heightnumbernullable
    • urlstringnullable
    • thumbnailUrlstringnullable
  • replyTostringnullable
  • reactionsobject[]
    Show 2 child fields
    • emojistring
    • actorsstring[]
  • createdAtstring
  • editedAtstringnullable
  • deletedAtstringnullable
  • versioninteger
POST/v1/messages
As creatorwrite

Send a message

SDKlucra.messages.create({ body })

Body

  • threadthr_…required
  • bodystring
  • filesfile_…[]

    Attachments: `chat_attachment` files.

  • replyTomsg_…
Response20112 fieldsShow
  • idstring
  • threadstring
  • senderobject
    Show 4 child fields
    • idstring
    • typeenum
      organizationcreatorsupport
    • namestringnullable
    • avatarstringnullable
  • automatedboolean
  • bodystring
  • filesobject[]
    Show 8 child fields
    • idstring
    • namestring
    • kindenum
      imagevideodocument
    • sizenumbernullable
    • widthnumbernullable
    • heightnumbernullable
    • urlstringnullable
    • thumbnailUrlstringnullable
  • replyTostringnullable
  • reactionsobject[]
    Show 2 child fields
    • emojistring
    • actorsstring[]
  • createdAtstring
  • editedAtstringnullable
  • deletedAtstringnullable
  • versioninteger
PATCH/v1/messages/:id
As creatorwrite

Edit or delete a message the caller sent (at its version), react to a message, or report it; one change per request

SDKlucra.messages.update({ path: { id }, body })

Path parameters

  • idstringrequired

Body

  • versioninteger

    The message's `version` as read; required to edit or delete.

  • bodystring

    New text for a message the caller sent.

  • statusstring

    Delete a message the caller sent.

    deleted
  • reactionobject

    Add or remove the caller's emoji reaction.

    Show 2 child fields
    • emojistringrequired
    • activebooleanrequired

      true adds the reaction, false removes it.

  • reportobject

    Report the message to Lucra.

    Show 2 child fields
    • reasonenumrequired
      spamharassmentunsafe_contentother
    • detailstring
Response20012 fieldsShow
  • idstring
  • threadstring
  • senderobject
    Show 4 child fields
    • idstring
    • typeenum
      organizationcreatorsupport
    • namestringnullable
    • avatarstringnullable
  • automatedboolean
  • bodystring
  • filesobject[]
    Show 8 child fields
    • idstring
    • namestring
    • kindenum
      imagevideodocument
    • sizenumbernullable
    • widthnumbernullable
    • heightnumbernullable
    • urlstringnullable
    • thumbnailUrlstringnullable
  • replyTostringnullable
  • reactionsobject[]
    Show 2 child fields
    • emojistring
    • actorsstring[]
  • createdAtstring
  • editedAtstringnullable
  • deletedAtstringnullable
  • versioninteger
GET/v1/threads
As creatorread

List the conversations the account (or, acting as a creator, the creator) takes part in, most recently active first

SDKlucra.threads.list({ query })

Query parameters

  • limitinteger
  • cursorstring
  • createdAfterstring

    Only items created at or after this time.

  • createdBeforestring

    Only items created before this time.

  • kindenum
    directprogramsupport
  • programprog_…
Response200A page of items, 14 fields each, and nextCursorShow
  • idstring
  • kindenum
    directprogramsupport
  • accountstringnullable
  • programstringnullable
  • supportobjectnullable
    Show 2 child fields
    • statusenum
      waiting_on_lucrawaiting_on_customerresolved
    • resolvedAtstringnullable
  • participantsobject[]
    Show 3 child fields
    • actorobject
      Show 4 child fields
      • idstring
      • typeenum
        organizationcreatorsupport
      • namestringnullable
      • avatarstringnullable
    • lastReadstringnullable
    • joinedAtstring
  • lastMessageobjectnullable
    Show 12 child fields
    • idstring
    • threadstring
    • senderobject
      Show 4 child fields
      • idstring
      • typeenum
        organizationcreatorsupport
      • namestringnullable
      • avatarstringnullable
    • automatedboolean
    • bodystring
    • filesobject[]
      Show 8 child fields
      • idstring
      • namestring
      • kindenum
        imagevideodocument
      • sizenumbernullable
      • widthnumbernullable
      • heightnumbernullable
      • urlstringnullable
      • thumbnailUrlstringnullable
    • replyTostringnullable
    • reactionsobject[]
      Show 2 child fields
      • emojistring
      • actorsstring[]
    • createdAtstring
    • editedAtstringnullable
    • deletedAtstringnullable
    • versioninteger
  • mutedboolean
  • blockedstring[]
  • canSendboolean
  • unreadCountinteger
  • createdAtstring
  • updatedAtstring
  • versioninteger
POST/v1/threads
As creatorwrite

Open a direct conversation with an account or creator you work with, a program's group chat or a Lucra Support thread; an existing one is returned

SDKlucra.threads.create({ body })

Body

  • kindenumrequired

    direct: one account or creator; program: a program's group chat; support: Lucra Support.

    directprogramsupport
  • withstring

    direct: the account (acct_) or creator (crtr_) to talk to; a creator must work with the account (and the reverse).

  • programstring

    program: the program (prog_) whose group chat to open.

  • messageobject

    A first message, sent when the conversation is new.

    Show 2 child fields
    • bodystring

      The message text.

    • filesstring[]

      Attachments: `chat_attachment` files (file_).

Response20114 fieldsShow
  • idstring
  • kindenum
    directprogramsupport
  • accountstringnullable
  • programstringnullable
  • supportobjectnullable
    Show 2 child fields
    • statusenum
      waiting_on_lucrawaiting_on_customerresolved
    • resolvedAtstringnullable
  • participantsobject[]
    Show 3 child fields
    • actorobject
      Show 4 child fields
      • idstring
      • typeenum
        organizationcreatorsupport
      • namestringnullable
      • avatarstringnullable
    • lastReadstringnullable
    • joinedAtstring
  • lastMessageobjectnullable
    Show 12 child fields
    • idstring
    • threadstring
    • senderobject
      Show 4 child fields
      • idstring
      • typeenum
        organizationcreatorsupport
      • namestringnullable
      • avatarstringnullable
    • automatedboolean
    • bodystring
    • filesobject[]
      Show 8 child fields
      • idstring
      • namestring
      • kindenum
        imagevideodocument
      • sizenumbernullable
      • widthnumbernullable
      • heightnumbernullable
      • urlstringnullable
      • thumbnailUrlstringnullable
    • replyTostringnullable
    • reactionsobject[]
      Show 2 child fields
      • emojistring
      • actorsstring[]
    • createdAtstring
    • editedAtstringnullable
    • deletedAtstringnullable
    • versioninteger
  • mutedboolean
  • blockedstring[]
  • canSendboolean
  • unreadCountinteger
  • createdAtstring
  • updatedAtstring
  • versioninteger
GET/v1/threads/:id
As creatorread

Get a conversation; its messages are GET /v1/messages?thread=

SDKlucra.threads.retrieve({ path: { id } })

Path parameters

  • idstringrequired
Response20014 fieldsShow
  • idstring
  • kindenum
    directprogramsupport
  • accountstringnullable
  • programstringnullable
  • supportobjectnullable
    Show 2 child fields
    • statusenum
      waiting_on_lucrawaiting_on_customerresolved
    • resolvedAtstringnullable
  • participantsobject[]
    Show 3 child fields
    • actorobject
      Show 4 child fields
      • idstring
      • typeenum
        organizationcreatorsupport
      • namestringnullable
      • avatarstringnullable
    • lastReadstringnullable
    • joinedAtstring
  • lastMessageobjectnullable
    Show 12 child fields
    • idstring
    • threadstring
    • senderobject
      Show 4 child fields
      • idstring
      • typeenum
        organizationcreatorsupport
      • namestringnullable
      • avatarstringnullable
    • automatedboolean
    • bodystring
    • filesobject[]
      Show 8 child fields
      • idstring
      • namestring
      • kindenum
        imagevideodocument
      • sizenumbernullable
      • widthnumbernullable
      • heightnumbernullable
      • urlstringnullable
      • thumbnailUrlstringnullable
    • replyTostringnullable
    • reactionsobject[]
      Show 2 child fields
      • emojistring
      • actorsstring[]
    • createdAtstring
    • editedAtstringnullable
    • deletedAtstringnullable
    • versioninteger
  • mutedboolean
  • blockedstring[]
  • canSendboolean
  • unreadCountinteger
  • createdAtstring
  • updatedAtstring
  • versioninteger