Use this method to add a new sticker to a set created by the bot

POST /addStickerToSet

Use this method to add a new sticker to a set created by the bot. You must use exactly one of the fields png_sticker or tgs_sticker. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.

Body Required

  • user_id integer Required

    User identifier of sticker set owner

  • name string Required

    Sticker set name

  • png_sticker string

    Any of:

    This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.

    PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »

  • tgs_sticker

    This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.

  • emojis string Required

    One or more emoji corresponding to the sticker

  • mask_position object

    This object describes the position on faces where a mask should be placed by default.

    Hide mask_position attributes Show mask_position attributes object
    • point string Required

      The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.

      Values are forehead, eyes, mouth, or chin.

    • x_shift number Required

      Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.

    • y_shift number Required

      Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.

    • scale number Required

      Mask scaling coefficient. For example, 2.0 means double size.

Responses

  • default
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is false.

    • error_code integer Required
    • description string Required
    • parameters object

      Contains information about why a request was unsuccessful.

      Hide parameters attributes Show parameters attributes object
      • migrate_to_chat_id integer

        Optional. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

      • retry_after integer

        Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated

  • 200
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is true.

    • result boolean Required

      Default value is true.

POST /addStickerToSet
curl \
 -X POST https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/addStickerToSet \
 -H "Content-Type: multipart/form-data" \
 -F "user_id=42" \
 -F "name=string" \
 -F "emojis=string" \
 -F 'mask_position={"point":"forehead","x_shift":42.0,"y_shift":42.0,"scale":42.0}'
Request example
{
  "user_id": 42,
  "name": "string",
  "emojis": "string",
  "mask_position": {
    "point": "forehead",
    "x_shift": 42.0,
    "y_shift": 42.0,
    "scale": 42.0
  }
}
Request examples
{
  "user_id": 42,
  "name": "string",
  "emojis": "string",
  "mask_position": {
    "point": "forehead",
    "x_shift": 42.0,
    "y_shift": 42.0,
    "scale": 42.0
  }
}
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (200)
{
  "ok": true,
  "result": true
}
Response examples (200)
{
  "ok": true,
  "result": true
}