{
    "openapi": "3.0.3",
    "info": {
        "title": "Edit User",
        "description": "Update information on an existing user.",
        "version": "1.0.0",
        "contact": {
            "name": "RunSignup API Support",
            "url": "https://runsignup.com/API",
            "email": "info@runsignup.com"
        }
    },
    "servers": [
        {
            "url": "https://api.runsignup.com/rest",
            "description": "Production API Server"
        }
    ],
    "tags": [
        {
            "name": "User Information",
            "description": "APIs related to User Information"
        }
    ],
    "components": {
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "string",
                        "description": "Error message"
                    },
                    "details": {
                        "type": "object",
                        "description": "Additional error details",
                        "additionalProperties": true
                    }
                },
                "required": [
                    "error"
                ]
            },
            "BadRequestError": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Error"
                    },
                    {
                        "description": "Error indicating invalid request parameters or structure"
                    }
                ]
            },
            "UnauthorizedError": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Error"
                    },
                    {
                        "description": "Error indicating authentication failure"
                    }
                ]
            },
            "ForbiddenError": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Error"
                    },
                    {
                        "description": "Error indicating the authenticated user lacks required permissions"
                    }
                ]
            },
            "NotFoundError": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Error"
                    },
                    {
                        "description": "Error indicating the requested resource does not exist"
                    }
                ]
            },
            "ServerError": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Error"
                    },
                    {
                        "description": "Error indicating an unexpected server-side issue"
                    }
                ]
            }
        },
        "securitySchemes": {
            "apiKey": {
                "type": "apiKey",
                "in": "query",
                "name": "api_key",
                "description": "RunSignup API Key"
            },
            "apiSecret": {
                "type": "apiKey",
                "in": "query",
                "name": "api_secret",
                "description": "RunSignup API Secret"
            }
        }
    },
    "paths": {
        "/user/{user_id}": {
            "post": {
                "tags": [
                    "User Information"
                ],
                "summary": "Edit User",
                "description": "Update information on an existing user.",
                "operationId": "user_:user_id",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "path",
                        "description": "Path parameter: user_id",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "api_key",
                        "in": "query",
                        "description": "API Key",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "api_secret",
                        "in": "query",
                        "description": "API Secret",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "rsu_api_key",
                        "in": "query",
                        "description": "API v2 key. If used, you must send the API secret in an HTTP header named X-RSU-API-SECRET.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sp_api_key",
                        "in": "query",
                        "description": "Super partner API key. If used, you must send the API secret in an HTTP header named X-RSU-API-SECRET.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-RSU-API-SECRET",
                        "in": "header",
                        "description": "API v2 or super partner secret.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Authorization",
                        "in": "header",
                        "description": "Authorization Header. If using OAuth 2.0, fill this in with `Bearer <token>`.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "description": "Format of response. The default if not sent is `xml`, but `json` is preferred.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "xml",
                                "json",
                                "csv"
                            ],
                            "default": "xml"
                        }
                    }
                ],
                "security": [
                    {
                        "apiKey": [],
                        "apiSecret": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/BadRequestError"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UnauthorizedError"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ForbiddenError"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/NotFoundError"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ServerError"
                                }
                            }
                        }
                    }
                },
                "x-permissions": [
                    "partners"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_id": {
                                        "type": "integer"
                                    },
                                    "first_name": {
                                        "type": "string"
                                    },
                                    "last_name": {
                                        "type": "string"
                                    },
                                    "dob": {
                                        "type": "string"
                                    },
                                    "gender": {
                                        "type": "string",
                                        "enum": [
                                            "M",
                                            "F"
                                        ]
                                    },
                                    "phone": {
                                        "type": "string"
                                    },
                                    "address1": {
                                        "type": "string"
                                    },
                                    "city": {
                                        "type": "string"
                                    },
                                    "state": {
                                        "type": "string"
                                    },
                                    "country": {
                                        "type": "string",
                                        "enum": [
                                            "US",
                                            "AD",
                                            "AE",
                                            "AF",
                                            "AG",
                                            "AI",
                                            "AL",
                                            "AM",
                                            "AO",
                                            "AQ",
                                            "AR",
                                            "AS",
                                            "AT",
                                            "AU",
                                            "AW",
                                            "AX",
                                            "AZ",
                                            "BA",
                                            "BB",
                                            "BD",
                                            "BE",
                                            "BF",
                                            "BG",
                                            "BH",
                                            "BI",
                                            "BJ",
                                            "BL",
                                            "BM",
                                            "BN",
                                            "BO",
                                            "BQ",
                                            "BR",
                                            "BS",
                                            "BT",
                                            "BV",
                                            "BW",
                                            "BY",
                                            "BZ",
                                            "CA",
                                            "CC",
                                            "CD",
                                            "CF",
                                            "CG",
                                            "CH",
                                            "CI",
                                            "CK",
                                            "CL",
                                            "CM",
                                            "CN",
                                            "CO",
                                            "CR",
                                            "CU",
                                            "CV",
                                            "CW",
                                            "CX",
                                            "CY",
                                            "CZ",
                                            "DE",
                                            "DJ",
                                            "DK",
                                            "DM",
                                            "DO",
                                            "DZ",
                                            "EC",
                                            "EE",
                                            "EG",
                                            "EH",
                                            "ER",
                                            "ES",
                                            "ET",
                                            "FI",
                                            "FJ",
                                            "FK",
                                            "FM",
                                            "FO",
                                            "FR",
                                            "GA",
                                            "GB",
                                            "GD",
                                            "GE",
                                            "GF",
                                            "GG",
                                            "GH",
                                            "GI",
                                            "GL",
                                            "GM",
                                            "GN",
                                            "GP",
                                            "GQ",
                                            "GR",
                                            "GS",
                                            "GT",
                                            "GU",
                                            "GW",
                                            "GY",
                                            "HK",
                                            "HM",
                                            "HN",
                                            "HR",
                                            "HT",
                                            "HU",
                                            "ID",
                                            "IE",
                                            "IL",
                                            "IM",
                                            "IN",
                                            "IO",
                                            "IQ",
                                            "IR",
                                            "IS",
                                            "IT",
                                            "JE",
                                            "JM",
                                            "JO",
                                            "JP",
                                            "KE",
                                            "KG",
                                            "KH",
                                            "KI",
                                            "KM",
                                            "KN",
                                            "KP",
                                            "KR",
                                            "KW",
                                            "KY",
                                            "KZ",
                                            "LA",
                                            "LB",
                                            "LC",
                                            "LI",
                                            "LK",
                                            "LR",
                                            "LS",
                                            "LT",
                                            "LU",
                                            "LV",
                                            "LY",
                                            "MA",
                                            "MC",
                                            "MD",
                                            "ME",
                                            "MF",
                                            "MG",
                                            "MH",
                                            "MK",
                                            "ML",
                                            "MM",
                                            "MN",
                                            "MO",
                                            "MP",
                                            "MQ",
                                            "MR",
                                            "MS",
                                            "MT",
                                            "MU",
                                            "MV",
                                            "MW",
                                            "MX",
                                            "MY",
                                            "MZ",
                                            "NA",
                                            "NC",
                                            "NE",
                                            "NF",
                                            "NG",
                                            "NI",
                                            "NL",
                                            "NO",
                                            "NP",
                                            "NR",
                                            "NU",
                                            "NZ",
                                            "OM",
                                            "PA",
                                            "PE",
                                            "PF",
                                            "PG",
                                            "PH",
                                            "PK",
                                            "PL",
                                            "PM",
                                            "PN",
                                            "PR",
                                            "PS",
                                            "PT",
                                            "PW",
                                            "PY",
                                            "QA",
                                            "RE",
                                            "RO",
                                            "RS",
                                            "RU",
                                            "RW",
                                            "SA",
                                            "SB",
                                            "SC",
                                            "SD",
                                            "SE",
                                            "SG",
                                            "SH",
                                            "SI",
                                            "SJ",
                                            "SK",
                                            "SL",
                                            "SM",
                                            "SN",
                                            "SO",
                                            "SR",
                                            "SS",
                                            "ST",
                                            "SV",
                                            "SX",
                                            "SY",
                                            "SZ",
                                            "TC",
                                            "TD",
                                            "TF",
                                            "TG",
                                            "TH",
                                            "TJ",
                                            "TK",
                                            "TL",
                                            "TM",
                                            "TN",
                                            "TO",
                                            "TR",
                                            "TT",
                                            "TV",
                                            "TW",
                                            "TZ",
                                            "UA",
                                            "UG",
                                            "UM",
                                            "UY",
                                            "UZ",
                                            "VA",
                                            "VC",
                                            "VE",
                                            "VG",
                                            "VI",
                                            "VN",
                                            "VU",
                                            "WF",
                                            "WS",
                                            "XK",
                                            "YE",
                                            "YT",
                                            "ZA",
                                            "ZM",
                                            "ZW"
                                        ]
                                    },
                                    "zipcode": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}