title: REST: Is it considered restful if API sends back two type of response?
body: <p>We have stock website and we help buyers connect with the sellers. We are creating API to let buyers push their contact details and get back the seller details. This is transaction and get logged in our database. We have created following API:</p>
  
  <p>The request is POST, the URL looks like:</p>
  
  <pre><code>/api/leads
  </code></pre>
  
  <p>The request body looks like:</p>
  
  <pre><code>{
    "buyermobile": "9999999999",
    "stockid": "123"
  }
  </code></pre>
  
  <p>The response looks like:</p>
  
  <pre><code>{
    "sellermobile" : "8888888888",
    "selleraddress": "123 avenue park"
  }
  </code></pre>
  
  <p>We have a new requirement, i.e. we need to send back PDF URL (instead of "sellermobile" &amp; "selleraddress"). This PDF URL would contain the seller details in case it comes from one of our client.</p>
  
  <p>We have modified the same API, now the request body looks like:</p>
  
  <pre><code>{
    "buyermobile": "9999999999",
    "stockid": "123",
    "ispdf": true
  }
  </code></pre>
  
  <p>The response looks like:</p>
  
  <pre><code>{
    "sellerdetailspdf" : "https://example.com/sellerdetails-1.pdf",
  }
  </code></pre>
  
  <p>Is it RESTFUL to do this? OR we should create separate API for getting response as PDF?</p>