# Webex

> Read your Webex profile, list and create rooms, send messages, and list and create meetings through Cisco Webex's REST API v1.

Lets an agent work with Cisco Webex through the REST API v1: read your own profile, list and create rooms (spaces), post and read messages, list and create meetings, and inspect room memberships. Use it to send notifications into a space, schedule a meeting, or summarize a room's recent messages.

## What it can do

| Method | What it does |
| --- | --- |
| `webex_people_me` | Get the authenticated user's own profile (id, emails, org). |
| `webex_rooms_list` | List rooms (spaces), optionally filtered by type or team. |
| `webex_room_create` | Create a room (space), optionally inside a team. |
| `webex_message_send` | Send a message to a room or directly to a person (text or markdown, with optional file attachments and threading). |
| `webex_messages_list` | List messages in a room, optionally within a thread. |
| `webex_meetings_list` | List meetings, filtered by type, state and time window. |
| `webex_meeting_create` | Create a scheduled meeting (title, start, end, agenda, invitees). |
| `webex_memberships_list` | List memberships of a room, or a person's rooms. |
| `webex_request` | Generic passthrough to any `/v1` endpoint for full API coverage. |

## How to get your access token

Webex uses a bearer access token.

1. Go to [developer.webex.com](https://developer.webex.com) and sign in with your Webex account.
2. For quick testing, open [Getting Started](https://developer.webex.com/docs/getting-started) and copy your **personal access token**. Note: it is short-lived (about 12 hours) and is meant only for development.
3. For an agent that runs unattended, create a **bot** instead: open **My Webex Apps -> Create a New App -> Create a Bot**, then copy the bot's access token. Bot tokens are long-lived and do not expire every 12 hours.
4. Paste the token into FlyMyAI. When you use a bot token, messages and rooms are owned by the bot - add the bot to the rooms it should post into.

## Fields to fill

| FlyMyAI field | Where it comes from |
| --- | --- |
| `WEBEX_ACCESS_TOKEN` | developer.webex.com - personal access token (short-lived) or a bot's access token (long-lived) |

## Troubleshooting

- **`401 Unauthorized`** - the token is wrong or, for a personal access token, expired (they last about 12 hours). Re-copy it, or switch to a long-lived bot token.
- **Bot cannot see or post to a room** - bots only act in rooms they belong to. Add the bot to the room first.
- **`429 Too Many Requests`** - you hit the rate limit. Back off and retry; the response includes a `Retry-After` header.
- **`400` on meeting create** - `start` and `end` must be valid ISO 8601 timestamps and `end` must be after `start`; set `timezone` if needed.

## Links

- [Webex API reference](https://developer.webex.com/docs/api/v1)
- [Getting started & tokens](https://developer.webex.com/docs/getting-started)
