{"openapi":"3.1.0","info":{"title":"OAuth","version":"1.0.0"},"paths":{"/oauth/token":{"post":{"operationId":"oauth_tokenGenerate","summary":"OAuth Token Generate","description":"Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call.","tags":["OAuth"],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenResponse"}}}},"400":{"description":"failed_operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenGenerateRequest"}}}}}},"/oauth/token?refresh":{"post":{"operationId":"oauth_tokenRefresh","summary":"OAuth Token Refresh","description":"Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see `expires_in`), along with a refresh token that can be used to acquire a new access token after the current one has expired.","tags":["OAuth"],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenResponse"}}}},"400":{"description":"failed_operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenRefreshRequest"}}}}}}},"tags":[{"name":"OAuth"}],"servers":[{"url":"https://app.hellosign.com","description":"https://app.hellosign.com"}],"components":{"schemas":{"OAuthTokenGenerateRequest":{"type":"object","properties":{"client_id":{"type":"string","description":"The client id of the app requesting authorization."},"client_secret":{"type":"string","description":"The secret token of your app."},"code":{"type":"string","description":"The code passed to your callback when the user granted access."},"grant_type":{"type":"string","default":"authorization_code","description":"When generating a new token use `authorization_code`."},"state":{"type":"string","description":"Same as the state you specified earlier."}},"required":["client_id","client_secret","code","grant_type","state"],"title":"OAuthTokenGenerateRequest"},"OAuthTokenResponse":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"refresh_token":{"type":"string"},"expires_in":{"type":"integer","description":"Number of seconds until the `access_token` expires. Uses epoch time."},"state":{"type":["string","null"]}},"title":"OAuthTokenResponse"},"ErrorResponseError":{"type":"object","properties":{"error_msg":{"type":"string","description":"Message describing an error."},"error_path":{"type":"string","description":"Path at which an error occurred."},"error_name":{"type":"string","description":"Name of the error. See the `x-error-codes` catalog in openapi file for a complete list of possible error codes with detailed information including HTTP status codes, causes, remediation steps, and retry guidance."}},"required":["error_msg","error_name"],"description":"Contains information about an error that occurred.","title":"ErrorResponseError"},"ErrorResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorResponseError"}},"required":["error"],"title":"ErrorResponse"},"OAuthTokenRefreshRequest":{"type":"object","properties":{"grant_type":{"type":"string","default":"refresh_token","description":"When refreshing an existing token use `refresh_token`."},"refresh_token":{"type":"string","description":"The token provided when you got the expired access token."},"client_id":{"type":"string","description":"The client ID for your API app. Required for new API apps. To enhance security, we recommend making it required for existing apps in your app settings."},"client_secret":{"type":"string","description":"The client secret for your API app. Required for new API apps. To enhance security, we recommend making it required for existing apps in your app settings."}},"required":["grant_type","refresh_token"],"title":"OAuthTokenRefreshRequest"}}}}