Open Context Protocol is live! 🚀 Read the launch post

usersProfileSet

Set the profile information for a user.

Details

  • Method: POST
  • Path: /users.profile.set
  • Operation ID: users_profile_set

Parameters

{
  "token": {
    "description": "Authentication token. Requires scope: `users.profile:write`",
    "required": true,
    "location": "header",
    "type": "string"
  },
  "name": {
    "description": "Name of a single key to set. Usable only if `profile` is not passed.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "profile": {
    "description": "Collection of key:value pairs presented as a URL-encoded JSON hash. At most 50 fields may be set. Each field name is limited to 255 characters.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "user": {
    "description": "ID of user to change. This argument may only be specified by team admins on paid teams.",
    "required": false,
    "location": "formData",
    "type": "string"
  },
  "value": {
    "description": "Value to set a single key to. Usable only if `profile` is not passed.",
    "required": false,
    "location": "formData",
    "type": "string"
  }
}

Response Schema

{
  "additionalProperties": false,
  "description": "Schema for successful response from users.profile.set method",
  "properties": {
    "email_pending": {
      "format": "email",
      "type": "string"
    },
    "ok": {
      "enum": [
        true
      ],
      "title": "default success response",
      "type": "boolean"
    },
    "profile": {
      "additionalProperties": false,
      "properties": {
        "always_active": {
          "type": "boolean"
        },
        "api_app_id": {
          "pattern": "^(A[A-Z0-9]{1,})?$",
          "title": "App ID or empty string",
          "type": "string"
        },
        "avatar_hash": {
          "type": "string"
        },
        "bot_id": {
          "pattern": "^B[A-Z0-9]{8,}$",
          "title": "Bot User ID",
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "display_name_normalized": {
          "type": "string"
        },
        "email": {
          "format": "email",
          "type": [
            "null",
            "string"
          ]
        },
        "fields": {
          "items": {
            "type": "object"
          },
          "type": [
            "object",
            "null",
            "array"
          ]
        },
        "first_name": {
          "type": [
            "null",
            "string"
          ]
        },
        "guest_expiration_ts": {
          "type": [
            "null",
            "integer"
          ]
        },
        "guest_invited_by": {
          "type": [
            "null",
            "string"
          ]
        },
        "image_1024": {
          "format": "uri",
          "type": [
            "null",
            "string"
          ]
        },
        "image_192": {
          "format": "uri",
          "type": [
            "null",
            "string"
          ]
        },
        "image_24": {
          "format": "uri",
          "type": [
            "null",
            "string"
          ]
        },
        "image_32": {
          "format": "uri",
          "type": [
            "null",
            "string"
          ]
        },
        "image_48": {
          "format": "uri",
          "type": [
            "null",
            "string"
          ]
        },
        "image_512": {
          "format": "uri",
          "type": [
            "null",
            "string"
          ]
        },
        "image_72": {
          "format": "uri",
          "type": [
            "null",
            "string"
          ]
        },
        "image_original": {
          "format": "uri",
          "type": [
            "null",
            "string"
          ]
        },
        "is_app_user": {
          "type": "boolean"
        },
        "is_custom_image": {
          "type": "boolean"
        },
        "is_restricted": {
          "type": [
            "null",
            "boolean"
          ]
        },
        "is_ultra_restricted": {
          "type": [
            "null",
            "boolean"
          ]
        },
        "last_avatar_image_hash": {
          "type": "string"
        },
        "last_name": {
          "type": [
            "null",
            "string"
          ]
        },
        "memberships_count": {
          "type": "integer"
        },
        "name": {
          "type": [
            "null",
            "string"
          ]
        },
        "phone": {
          "type": "string"
        },
        "pronouns": {
          "type": "string"
        },
        "real_name": {
          "type": "string"
        },
        "real_name_normalized": {
          "type": "string"
        },
        "skype": {
          "type": "string"
        },
        "status_default_emoji": {
          "type": "string"
        },
        "status_default_text": {
          "type": "string"
        },
        "status_default_text_canonical": {
          "type": [
            "null",
            "string"
          ]
        },
        "status_emoji": {
          "type": "string"
        },
        "status_expiration": {
          "type": "integer"
        },
        "status_text": {
          "type": "string"
        },
        "status_text_canonical": {
          "type": [
            "null",
            "string"
          ]
        },
        "team": {
          "pattern": "^[TE][A-Z0-9]{8,}$",
          "title": "Team or Enterprise ID",
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "updated": {
          "type": "integer"
        },
        "user_id": {
          "type": "string"
        },
        "username": {
          "type": [
            "null",
            "string"
          ]
        }
      },
      "required": [
        "real_name",
        "display_name",
        "avatar_hash",
        "real_name_normalized",
        "display_name_normalized",
        "title",
        "phone",
        "skype",
        "status_text",
        "status_emoji",
        "fields"
      ],
      "title": "User profile object",
      "type": "object"
    },
    "username": {
      "type": "string"
    }
  },
  "required": [
    "ok",
    "username",
    "profile"
  ],
  "title": "users.profile.set schema",
  "type": "object"
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('slack')

# Call this tool
result = await agent.call_tool('usersProfileSet', {
    # Add required parameters here
})