---
updatedAt: 2025-11-03T17:43:41.000Z
agentTools:
  projectIndex: https://docs.gupshup.io/llms.txt
---

# Mark a user as opted-in

| Key       | Description                             | Example      |
| :-------- | :-------------------------------------- | :----------- |
| `appname` | The registered Gupshup app's name       | DemoAPI      |
| `user`    | The user's phone number in E.164 format | 918728374375 |

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Useful APIs",
    "contact": {},
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.gupshup.io/sm/api",
      "variables": {}
    }
  ],
  "paths": {
    "/v1/app/opt/in/{appname}": {
      "post": {
        "summary": "Mark a user as opted-in",
        "operationId": "Markauserasopted-in",
        "parameters": [
          {
            "name": "appname",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "description": "",
            "required": true,
            "style": "simple",
            "schema": {
              "enum": [
                "application/x-www-form-urlencoded"
              ],
              "type": "string",
              "example": "application/x-www-form-urlencoded"
            }
          },
          {
            "name": "apikey",
            "in": "header",
            "description": "",
            "required": true,
            "style": "simple",
            "schema": {
              "type": "string",
              "example": "api key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "encoding": {},
              "schema": {
                "required": [
                  "user"
                ],
                "type": "object",
                "properties": {
                  "user": {
                    "type": "number",
                    "format": "int64",
                    "example": 918728374375
                  }
                }
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "",
            "headers": {}
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```