Create or update the outbound proxy configuration
PATCH/config/proxy
Merges the supplied fields into the stored proxy configuration and saves it.
Only protocol, host, port, verify_ssl, auth.username and auth.password are read; other fields are ignored. After the merge the resulting configuration must have a valid protocol, host and port. A leading http:// or https:// on host is stripped. Any update that includes protocol, host or port but omits auth (or sends an empty auth) removes the stored credentials. Resend auth.username and auth.password with every such change. A body containing only verify_ssl keeps them. If auth is present, both username and password must be non-empty. Credentials are stored encrypted. Accepts JSON or application/x-www-form-urlencoded bodies. Required role: admin or superadmin. port is any non-empty string or number (a number is cast to a string); it is not range-checked, so "0" and "abc" are accepted and Invalid Port is returned only when the merged port is empty or missing. verify_ssl alone fails with 422 Invalid Protocol when no proxy is stored yet. The response includes updatedAt, and createdAt and __v only on the call that creates the document. A flat form key such as auth.username=x (instead of auth[username]=x) returns 500 after the other fields are saved; use JSON or bracketed keys.
Request
Responses
- 200
- 401
- 403
- 422
- 500
The saved proxy configuration (password omitted).
No token, or the token is invalid or expired. The body is {message}: No auth token provided when no token is sent, otherwise the token check's message (jwt expired, jwt malformed, invalid signature, invalid token, jwt signature is required). Send Authorization: Bearer <token> exactly: the server drops the first seven characters of the header and reads the rest as the token, so a different scheme or an extra space fails. If Authorization is absent, the server reads a token field in the body, then a token query parameter, then x-access-token. Routes that validate query fields reject ?token= with 400 InvalidQuery.
The token's role is not allowed for this operation, or the token's scopes exclude the route
(Scope not allowed by token).
Invalid proxy configuration. Messages include Invalid proxy configuration (no recognised fields), Invalid Protocol, Invalid Host, Invalid Port and Invalid authentication credentials.
A flat form key such as auth.username (instead of auth[username]) fails after the other fields have already been saved, so the stored proxy configuration is partly updated.