{
  "openapi": "3.0.3",
  "info": {
    "title": "Spaces API",
    "version": "1.0.0",
    "description": "Messaging API for Spaces. Keys start with spc_live_. Send them as Authorization: Bearer. Docs: https://www.spacesos.com/docs/agents"
  },
  "servers": [
    {
      "url": "https://api.spacesos.com/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/signup": {
      "post": {
        "operationId": "signup",
        "security": [],
        "summary": "Email a 6-digit code",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "signup_id and expires_at"
          }
        }
      }
    },
    "/signup/verify": {
      "post": {
        "operationId": "signupVerify",
        "security": [],
        "summary": "Exchange the code for an API key",
        "responses": {
          "200": {
            "description": "api_key shown once"
          }
        }
      }
    },
    "/messaging/accounts": {
      "get": {
        "operationId": "listAccounts",
        "summary": "Connected accounts",
        "responses": {
          "200": {
            "description": "accounts"
          }
        }
      }
    },
    "/messaging/accounts/connect-link": {
      "post": {
        "operationId": "connectLink",
        "summary": "Link the person opens to connect an account",
        "responses": {
          "201": {
            "description": "url"
          }
        }
      }
    },
    "/messaging/billing": {
      "get": {
        "operationId": "getBilling",
        "summary": "Plan status",
        "responses": {
          "200": {
            "description": "billing"
          }
        }
      }
    },
    "/messaging/billing/checkout": {
      "post": {
        "operationId": "checkout",
        "summary": "Card checkout for a paid trial",
        "responses": {
          "201": {
            "description": "url"
          }
        }
      }
    },
    "/messaging/usage": {
      "get": {
        "operationId": "usage",
        "summary": "Send limits for each account",
        "responses": {
          "200": {
            "description": "usage"
          }
        }
      }
    },
    "/messaging/usage/export": {
      "get": {
        "operationId": "usageExport",
        "summary": "Usage per account per day (CSV or JSON). No message text.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "csv",
                "json"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "usage rows"
          }
        }
      }
    },
    "/messaging/schedules": {
      "get": {
        "operationId": "listSchedules",
        "summary": "Scheduled messages",
        "responses": {
          "200": {
            "description": "schedules"
          }
        }
      },
      "post": {
        "operationId": "createSchedule",
        "summary": "Schedule a message for a local time. The send uses the same account limits.",
        "responses": {
          "201": {
            "description": "schedule"
          }
        }
      }
    },
    "/messaging/schedules/{scheduleId}": {
      "patch": {
        "operationId": "updateSchedule",
        "summary": "Edit a scheduled message",
        "responses": {
          "200": {
            "description": "schedule"
          }
        }
      },
      "delete": {
        "operationId": "cancelSchedule",
        "summary": "Cancel a scheduled message",
        "responses": {
          "200": {
            "description": "schedule"
          }
        }
      }
    },
    "/messaging/routines": {
      "get": {
        "operationId": "listRoutines",
        "summary": "Routines",
        "responses": {
          "200": {
            "description": "routines"
          }
        }
      },
      "post": {
        "operationId": "createRoutine",
        "summary": "Create a recurring or event routine. Sends use the same limits.",
        "responses": {
          "201": {
            "description": "routine"
          }
        }
      }
    },
    "/messaging/routines/{routineId}": {
      "patch": {
        "operationId": "updateRoutine",
        "summary": "Pause, resume or edit a routine",
        "responses": {
          "200": {
            "description": "routine"
          }
        }
      },
      "delete": {
        "operationId": "deleteRoutine",
        "summary": "Delete a routine",
        "responses": {
          "200": {
            "description": "deleted"
          }
        }
      }
    },
    "/messaging/routines/{routineId}/runs": {
      "get": {
        "operationId": "listRoutineRuns",
        "summary": "Run history and errors",
        "responses": {
          "200": {
            "description": "runs"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}": {
      "get": {
        "operationId": "get_connected_account",
        "summary": "Status of one connected account.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/reconnect": {
      "post": {
        "operationId": "reconnect_account",
        "summary": "Start reconnecting an account that needs a sign-in.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/checkpoint": {
      "post": {
        "operationId": "solve_checkpoint",
        "summary": "Submit a 2FA or OTP code. The code is not stored.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/checkpoint/resend": {
      "post": {
        "operationId": "resend_checkpoint",
        "summary": "Resend a checkpoint code.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/restart": {
      "post": {
        "operationId": "restart_account",
        "summary": "Restart a frozen account.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/sync": {
      "post": {
        "operationId": "resync_account",
        "summary": "Resynchronize messaging data. LinkedIn and Telegram.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/proxy": {
      "patch": {
        "operationId": "update_account_proxy",
        "summary": "Update the proxy for this account.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/chats/{chatId}/attendees": {
      "get": {
        "operationId": "list_chat_attendees",
        "summary": "People in a chat.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/chats/{chatId}": {
      "patch": {
        "operationId": "update_chat",
        "summary": "Mark a chat read, mute it, or take another chat action.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      },
      "delete": {
        "operationId": "delete_chat",
        "summary": "Delete a chat. WhatsApp and LinkedIn.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/chats/{chatId}/tags": {
      "get": {
        "operationId": "getChatTags",
        "summary": "Tags and owner of a chat",
        "responses": {
          "200": {
            "description": "tags"
          }
        }
      },
      "put": {
        "operationId": "setChatTags",
        "summary": "Replace the tags on a chat (at most 20, each up to 40 characters). Sends nothing.",
        "responses": {
          "200": {
            "description": "tags"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/chats/{chatId}/owner": {
      "put": {
        "operationId": "setChatOwner",
        "summary": "Give a chat an owner: a workspace user id, an email or me; null clears it. Sends nothing.",
        "responses": {
          "200": {
            "description": "owner"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/chats/{chatId}/sync": {
      "get": {
        "operationId": "sync_chat",
        "summary": "Sync a chat from the start, or read the sync status.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/messages/{messageId}/forward": {
      "post": {
        "operationId": "forward_message",
        "summary": "Forward a message. WhatsApp only.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/messages": {
      "get": {
        "operationId": "list_messages",
        "summary": "Messages across chats. Filter with the query string.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/attendees": {
      "get": {
        "operationId": "list_attendees",
        "summary": "People the account can message.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/attendees/{attendeeId}": {
      "get": {
        "operationId": "get_attendee",
        "summary": "One attendee.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/attendees/{attendeeId}/picture": {
      "get": {
        "operationId": "get_attendee_picture",
        "summary": "Profile picture for an attendee. Binary.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/attendees/{attendeeId}/chats": {
      "get": {
        "operationId": "list_attendee_chats",
        "summary": "1:1 chats with an attendee.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/attendees/{attendeeId}/messages": {
      "get": {
        "operationId": "list_attendee_messages",
        "summary": "Messages with an attendee.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/messages/{messageId}/reaction": {
      "post": {
        "operationId": "add_message_reaction",
        "summary": "React to a message.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      },
      "delete": {
        "operationId": "remove_message_reaction",
        "summary": "Remove your reaction from a message.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/messages/{messageId}": {
      "delete": {
        "operationId": "delete_message",
        "summary": "Delete a message. WhatsApp and LinkedIn. LinkedIn only within about an hour.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      },
      "patch": {
        "operationId": "edit_message",
        "summary": "Edit a message. WhatsApp and LinkedIn Classic.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/attendees/{attendeeId}/sync": {
      "get": {
        "operationId": "sync_attendee",
        "summary": "Sync chats for an attendee.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/profile": {
      "get": {
        "operationId": "get_own_profile",
        "summary": "The connected account profile.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      },
      "patch": {
        "operationId": "edit_own_profile",
        "summary": "Edit the connected profile. Only fields the channel allows are applied.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/relations": {
      "get": {
        "operationId": "list_relations",
        "summary": "Relations of the account. Paced like profile views.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/following": {
      "get": {
        "operationId": "list_following",
        "summary": "Accounts this account follows.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/followers": {
      "get": {
        "operationId": "list_followers",
        "summary": "Followers of this account.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/invitations/received": {
      "get": {
        "operationId": "list_received_invitations",
        "summary": "Invitations waiting for this account.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/invitations/received/{invitationId}": {
      "post": {
        "operationId": "respond_to_invitation",
        "summary": "Accept or decline a received invitation.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/users/{identifier}/comments": {
      "get": {
        "operationId": "list_user_comments",
        "summary": "Comments written by a person.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/users/{identifier}/reactions": {
      "get": {
        "operationId": "list_user_reactions",
        "summary": "Reactions by a person.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/posts/{postId}/reactions": {
      "get": {
        "operationId": "list_post_reactions",
        "summary": "Reactions on a post or, with comment_id, a comment.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/inmail-balance": {
      "get": {
        "operationId": "get_inmail_balance",
        "summary": "InMail credit balance.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/companies/{companyId}": {
      "get": {
        "operationId": "get_company",
        "summary": "A LinkedIn company profile.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/search/parameters": {
      "get": {
        "operationId": "list_search_parameters",
        "summary": "Ids LinkedIn expects instead of raw search text.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/hiring-projects": {
      "get": {
        "operationId": "list_hiring_projects",
        "summary": "Recruiter hiring projects.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/hiring-projects/{projectId}": {
      "get": {
        "operationId": "get_hiring_project",
        "summary": "One hiring project.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/users/{identifier}/action": {
      "post": {
        "operationId": "linkedin_profile_action",
        "summary": "Recruiter or Sales Navigator action on a profile, such as saving a lead.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/jobs": {
      "get": {
        "operationId": "list_job_postings",
        "summary": "Job posts on this LinkedIn account.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      },
      "post": {
        "operationId": "create_job_posting",
        "summary": "Create a job post draft.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/jobs/{jobId}": {
      "get": {
        "operationId": "get_job_posting",
        "summary": "One job post.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      },
      "patch": {
        "operationId": "edit_job_posting",
        "summary": "Edit a job post.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/jobs/{jobId}/publish": {
      "post": {
        "operationId": "publish_job_posting",
        "summary": "Publish a job draft.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/jobs/{jobId}/close": {
      "post": {
        "operationId": "close_job_posting",
        "summary": "Close a job post.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/jobs/{jobId}/applicants": {
      "get": {
        "operationId": "list_applicants",
        "summary": "People who applied.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/jobs/{jobId}/applicants/{applicantId}": {
      "get": {
        "operationId": "get_applicant",
        "summary": "One applicant.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/jobs/{jobId}/applicants/{applicantId}/resume": {
      "get": {
        "operationId": "get_applicant_resume",
        "summary": "Download an applicant resume.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/users/{identifier}/endorse": {
      "post": {
        "operationId": "endorse_skill",
        "summary": "Endorse a skill.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/contracts": {
      "get": {
        "operationId": "list_contracts",
        "summary": "Recruiter or Sales Navigator contracts.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/contracts/{contractId}/select": {
      "post": {
        "operationId": "select_contract",
        "summary": "Select the contract used by this account.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/emails": {
      "get": {
        "operationId": "list_emails",
        "summary": "Emails in this account.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      },
      "post": {
        "operationId": "send_email",
        "summary": "Send one email. Not a bulk send.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/email-contacts": {
      "get": {
        "operationId": "list_email_contacts",
        "summary": "Contacts from Gmail or Outlook.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/emails/{emailId}": {
      "get": {
        "operationId": "get_email",
        "summary": "One email.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      },
      "delete": {
        "operationId": "delete_email",
        "summary": "Move an email to trash.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      },
      "patch": {
        "operationId": "update_email",
        "summary": "Update flags on an email.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/emails/{emailId}/attachments/{attachmentId}": {
      "get": {
        "operationId": "get_email_attachment",
        "summary": "Download an email attachment.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/email-folders": {
      "get": {
        "operationId": "list_email_folders",
        "summary": "Mail folders.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/email-folders/{folderId}": {
      "get": {
        "operationId": "get_email_folder",
        "summary": "One mail folder.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/email-drafts": {
      "post": {
        "operationId": "create_email_draft",
        "summary": "Save an email draft.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/calendars": {
      "get": {
        "operationId": "list_calendars",
        "summary": "Calendars on this account.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/calendars/{calendarId}": {
      "get": {
        "operationId": "get_calendar",
        "summary": "One calendar.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/calendars/{calendarId}/events": {
      "get": {
        "operationId": "list_events",
        "summary": "Events on a calendar.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      },
      "post": {
        "operationId": "create_event",
        "summary": "Create an event.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/calendars/{calendarId}/events/{eventId}": {
      "get": {
        "operationId": "get_event",
        "summary": "One event.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      },
      "patch": {
        "operationId": "edit_event",
        "summary": "Edit an event.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      },
      "delete": {
        "operationId": "delete_event",
        "summary": "Delete an event.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/jobs/{jobId}/checkpoint": {
      "post": {
        "operationId": "solve_job_checkpoint",
        "summary": "Solve a job publishing checkpoint.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/posts/audience": {
      "get": {
        "operationId": "estimate_post_audience",
        "summary": "Estimated audience for an organization post.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/recruiter/sign-out": {
      "post": {
        "operationId": "sign_out_recruiter",
        "summary": "Sign out the current Recruiter session.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/accounts/{accountId}/linkedin/recruiter/sign-out-others": {
      "post": {
        "operationId": "sign_out_other_recruiter_sessions",
        "summary": "Sign out other Recruiter sessions for this seat.",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/messaging/pause": {
      "post": {
        "operationId": "pauseAllSending",
        "summary": "Pause every outbound action in the workspace. Reads keep working. Needs accounts:manage.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "required": [
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "pause"
          },
          "404": {
            "description": "not turned on for this workspace yet"
          }
        }
      }
    },
    "/messaging/resume": {
      "post": {
        "operationId": "resumeAllSending",
        "summary": "Resume sending after a pause. Needs accounts:manage.",
        "responses": {
          "200": {
            "description": "pause"
          }
        }
      }
    },
    "/messaging/settings": {
      "get": {
        "operationId": "getSettings",
        "summary": "Approvals setting and pause state",
        "responses": {
          "200": {
            "description": "settings"
          }
        }
      },
      "patch": {
        "operationId": "updateSettings",
        "summary": "Set approvals to off, posts or all_writes. Needs accounts:manage.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "approvals": {
                    "type": "string",
                    "enum": [
                      "off",
                      "posts",
                      "all_writes"
                    ]
                  }
                },
                "required": [
                  "approvals"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "settings"
          }
        }
      }
    },
    "/messaging/approvals": {
      "get": {
        "operationId": "listApprovals",
        "summary": "Writes waiting for approval",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "approving",
                "sent",
                "rejected",
                "failed"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "approvals"
          }
        }
      }
    },
    "/messaging/approvals/{approval_id}/approve": {
      "post": {
        "operationId": "approve",
        "summary": "Send a pending approval through the normal path, optionally with edited text. Needs accounts:manage.",
        "parameters": [
          {
            "name": "approval_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 4000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "sent"
          },
          "409": {
            "description": "not pending, or AGENT_PAUSED"
          },
          "429": {
            "description": "over a limit; it stays pending"
          }
        }
      }
    },
    "/messaging/approvals/{approval_id}/reject": {
      "post": {
        "operationId": "reject",
        "summary": "Close a pending approval without sending it. Needs accounts:manage.",
        "parameters": [
          {
            "name": "approval_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "rejected"
          }
        }
      }
    }
  }
}
