Use this method to create a new sticker set owned by a user

POST /createNewStickerSet

Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You must use exactly one of the fields png_sticker or tgs_sticker. Returns True on success.

Body Required

  • user_id integer Required

    User identifier of created sticker set owner

  • name string Required

    Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “_by_”. is case insensitive. 1-64 characters.

  • title string Required

    Sticker set title, 1-64 characters

  • 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

  • contains_masks boolean

    Pass True, if a set of mask stickers should be created

  • 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 /createNewStickerSet
curl \
 -X POST https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/createNewStickerSet \
 -H "Content-Type: multipart/form-data" \
 -F "user_id=42" \
 -F "name=string" \
 -F "title=string" \
 -F "emojis=string" \
 -F "contains_masks=true" \
 -F 'mask_position={"point":"forehead","x_shift":42.0,"y_shift":42.0,"scale":42.0}'
Request example
{
  "user_id": 42,
  "name": "string",
  "title": "string",
  "emojis": "string",
  "contains_masks": true,
  "mask_position": {
    "point": "forehead",
    "x_shift": 42.0,
    "y_shift": 42.0,
    "scale": 42.0
  }
}
Request examples
{
  "user_id": 42,
  "name": "string",
  "title": "string",
  "emojis": "string",
  "contains_masks": true,
  "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
}