For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.ivfprovider.com/ivf-agency-ap-is/surrogate/account-profile/pregnancy-history/llms.txt. For full documentation content, see https://docs.ivfprovider.com/ivf-agency-ap-is/surrogate/account-profile/pregnancy-history/llms-full.txt.

# Update Pregnancy History

PATCH http://localhost:8000/api/surrogates/{id}/pregnancy-history
Content-Type: application/json

Reference: https://docs.ivfprovider.com/ivf-agency-ap-is/surrogate/account-profile/pregnancy-history/update-pregnancy-history

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/surrogates/{id}/pregnancy-history:
    patch:
      operationId: update-pregnancy-history
      summary: Update Pregnancy History
      tags:
        - >-
          subpackage_surrogate.subpackage_surrogate/accountProfile.subpackage_surrogate/accountProfile/pregnancyHistory
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Surrogate_Account Profile_Pregnancy
                  History_Update Pregnancy History_Response_200
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                pregnancies:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/ApiSurrogatesIdPregnancyHistoryPatchRequestBodyContentApplicationJsonSchemaPregnanciesItems
              required:
                - pregnancies
servers:
  - url: http://localhost:8000
components:
  schemas:
    ApiSurrogatesIdPregnancyHistoryPatchRequestBodyContentApplicationJsonSchemaPregnanciesItemsBabiesInfoItems:
      type: object
      properties:
        gender:
          type: string
        weight:
          type: string
      required:
        - gender
        - weight
      title: >-
        ApiSurrogatesIdPregnancyHistoryPatchRequestBodyContentApplicationJsonSchemaPregnanciesItemsBabiesInfoItems
    ApiSurrogatesIdPregnancyHistoryPatchRequestBodyContentApplicationJsonSchemaPregnanciesItems:
      type: object
      properties:
        id:
          type: integer
        delivery_date:
          type: string
          format: date
        delivery_type_id:
          type: integer
        weeks_at:
          type: string
        babies:
          type: integer
        babies_info:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiSurrogatesIdPregnancyHistoryPatchRequestBodyContentApplicationJsonSchemaPregnanciesItemsBabiesInfoItems
        complications:
          type: string
        hospital_name:
          type: string
        hospital_address:
          type: string
        hospital_phone_country:
          type: string
        hospital_phone:
          type: string
        hospital_fax_country:
          type: string
        hospital_fax:
          type: string
        hospital_email:
          type: string
          format: email
        is_draft:
          type: boolean
        is_deleted:
          type: boolean
      required:
        - id
        - delivery_date
        - delivery_type_id
        - weeks_at
        - babies
        - babies_info
        - complications
        - hospital_name
        - hospital_address
        - hospital_phone_country
        - hospital_phone
        - hospital_fax_country
        - hospital_fax
        - hospital_email
        - is_draft
        - is_deleted
      title: >-
        ApiSurrogatesIdPregnancyHistoryPatchRequestBodyContentApplicationJsonSchemaPregnanciesItems
    Surrogate_Account Profile_Pregnancy History_Update Pregnancy History_Response_200:
      type: object
      properties:
        status:
          type: integer
        message:
          type: string
      required:
        - status
        - message
      title: >-
        Surrogate_Account Profile_Pregnancy History_Update Pregnancy
        History_Response_200
  securitySchemes:
    oauth2Auth:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python Surrogate_Account Profile_Pregnancy History_Update Pregnancy History_example
import requests

url = "http://localhost:8000/api/surrogates/19/pregnancy-history"

payload = { "pregnancies": [
        {
            "id": 5,
            "delivery_date": "2025-05-02",
            "delivery_type_id": 3,
            "weeks_at": "11",
            "babies": 1,
            "babies_info": [
                {
                    "gender": "male",
                    "weight": "22"
                }
            ],
            "complications": "No complications",
            "hospital_name": "City Hospital",
            "hospital_address": "123 Main Street, Los Angeles, CA",
            "hospital_phone_country": "US",
            "hospital_phone": "1234567890",
            "hospital_fax_country": "US",
            "hospital_fax": "0987654321",
            "hospital_email": "hospital@example.com",
            "is_draft": False,
            "is_deleted": False
        },
        {
            "id": 6,
            "delivery_date": "2025-05-08",
            "delivery_type_id": 3,
            "weeks_at": "33",
            "babies": 2,
            "babies_info": [
                {
                    "gender": "female",
                    "weight": "11"
                },
                {
                    "gender": "male",
                    "weight": "10"
                }
            ],
            "complications": "Minor blood pressure issue",
            "hospital_name": "Women's Care Hospital",
            "hospital_address": "456 Health Avenue, San Diego, CA",
            "hospital_phone_country": "IN",
            "hospital_phone": "+919898989898",
            "hospital_fax_country": "IN",
            "hospital_fax": "1234567890",
            "hospital_email": "care@example.com",
            "is_draft": True,
            "is_deleted": True
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Surrogate_Account Profile_Pregnancy History_Update Pregnancy History_example
const url = 'http://localhost:8000/api/surrogates/19/pregnancy-history';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"pregnancies":[{"id":5,"delivery_date":"2025-05-02","delivery_type_id":3,"weeks_at":"11","babies":1,"babies_info":[{"gender":"male","weight":"22"}],"complications":"No complications","hospital_name":"City Hospital","hospital_address":"123 Main Street, Los Angeles, CA","hospital_phone_country":"US","hospital_phone":"1234567890","hospital_fax_country":"US","hospital_fax":"0987654321","hospital_email":"hospital@example.com","is_draft":false,"is_deleted":false},{"id":6,"delivery_date":"2025-05-08","delivery_type_id":3,"weeks_at":"33","babies":2,"babies_info":[{"gender":"female","weight":"11"},{"gender":"male","weight":"10"}],"complications":"Minor blood pressure issue","hospital_name":"Women\'s Care Hospital","hospital_address":"456 Health Avenue, San Diego, CA","hospital_phone_country":"IN","hospital_phone":"+919898989898","hospital_fax_country":"IN","hospital_fax":"1234567890","hospital_email":"care@example.com","is_draft":true,"is_deleted":true}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Surrogate_Account Profile_Pregnancy History_Update Pregnancy History_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8000/api/surrogates/19/pregnancy-history"

	payload := strings.NewReader("{\n  \"pregnancies\": [\n    {\n      \"id\": 5,\n      \"delivery_date\": \"2025-05-02\",\n      \"delivery_type_id\": 3,\n      \"weeks_at\": \"11\",\n      \"babies\": 1,\n      \"babies_info\": [\n        {\n          \"gender\": \"male\",\n          \"weight\": \"22\"\n        }\n      ],\n      \"complications\": \"No complications\",\n      \"hospital_name\": \"City Hospital\",\n      \"hospital_address\": \"123 Main Street, Los Angeles, CA\",\n      \"hospital_phone_country\": \"US\",\n      \"hospital_phone\": \"1234567890\",\n      \"hospital_fax_country\": \"US\",\n      \"hospital_fax\": \"0987654321\",\n      \"hospital_email\": \"hospital@example.com\",\n      \"is_draft\": false,\n      \"is_deleted\": false\n    },\n    {\n      \"id\": 6,\n      \"delivery_date\": \"2025-05-08\",\n      \"delivery_type_id\": 3,\n      \"weeks_at\": \"33\",\n      \"babies\": 2,\n      \"babies_info\": [\n        {\n          \"gender\": \"female\",\n          \"weight\": \"11\"\n        },\n        {\n          \"gender\": \"male\",\n          \"weight\": \"10\"\n        }\n      ],\n      \"complications\": \"Minor blood pressure issue\",\n      \"hospital_name\": \"Women's Care Hospital\",\n      \"hospital_address\": \"456 Health Avenue, San Diego, CA\",\n      \"hospital_phone_country\": \"IN\",\n      \"hospital_phone\": \"+919898989898\",\n      \"hospital_fax_country\": \"IN\",\n      \"hospital_fax\": \"1234567890\",\n      \"hospital_email\": \"care@example.com\",\n      \"is_draft\": true,\n      \"is_deleted\": true\n    }\n  ]\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Surrogate_Account Profile_Pregnancy History_Update Pregnancy History_example
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/api/surrogates/19/pregnancy-history")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"pregnancies\": [\n    {\n      \"id\": 5,\n      \"delivery_date\": \"2025-05-02\",\n      \"delivery_type_id\": 3,\n      \"weeks_at\": \"11\",\n      \"babies\": 1,\n      \"babies_info\": [\n        {\n          \"gender\": \"male\",\n          \"weight\": \"22\"\n        }\n      ],\n      \"complications\": \"No complications\",\n      \"hospital_name\": \"City Hospital\",\n      \"hospital_address\": \"123 Main Street, Los Angeles, CA\",\n      \"hospital_phone_country\": \"US\",\n      \"hospital_phone\": \"1234567890\",\n      \"hospital_fax_country\": \"US\",\n      \"hospital_fax\": \"0987654321\",\n      \"hospital_email\": \"hospital@example.com\",\n      \"is_draft\": false,\n      \"is_deleted\": false\n    },\n    {\n      \"id\": 6,\n      \"delivery_date\": \"2025-05-08\",\n      \"delivery_type_id\": 3,\n      \"weeks_at\": \"33\",\n      \"babies\": 2,\n      \"babies_info\": [\n        {\n          \"gender\": \"female\",\n          \"weight\": \"11\"\n        },\n        {\n          \"gender\": \"male\",\n          \"weight\": \"10\"\n        }\n      ],\n      \"complications\": \"Minor blood pressure issue\",\n      \"hospital_name\": \"Women's Care Hospital\",\n      \"hospital_address\": \"456 Health Avenue, San Diego, CA\",\n      \"hospital_phone_country\": \"IN\",\n      \"hospital_phone\": \"+919898989898\",\n      \"hospital_fax_country\": \"IN\",\n      \"hospital_fax\": \"1234567890\",\n      \"hospital_email\": \"care@example.com\",\n      \"is_draft\": true,\n      \"is_deleted\": true\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Surrogate_Account Profile_Pregnancy History_Update Pregnancy History_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("http://localhost:8000/api/surrogates/19/pregnancy-history")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"pregnancies\": [\n    {\n      \"id\": 5,\n      \"delivery_date\": \"2025-05-02\",\n      \"delivery_type_id\": 3,\n      \"weeks_at\": \"11\",\n      \"babies\": 1,\n      \"babies_info\": [\n        {\n          \"gender\": \"male\",\n          \"weight\": \"22\"\n        }\n      ],\n      \"complications\": \"No complications\",\n      \"hospital_name\": \"City Hospital\",\n      \"hospital_address\": \"123 Main Street, Los Angeles, CA\",\n      \"hospital_phone_country\": \"US\",\n      \"hospital_phone\": \"1234567890\",\n      \"hospital_fax_country\": \"US\",\n      \"hospital_fax\": \"0987654321\",\n      \"hospital_email\": \"hospital@example.com\",\n      \"is_draft\": false,\n      \"is_deleted\": false\n    },\n    {\n      \"id\": 6,\n      \"delivery_date\": \"2025-05-08\",\n      \"delivery_type_id\": 3,\n      \"weeks_at\": \"33\",\n      \"babies\": 2,\n      \"babies_info\": [\n        {\n          \"gender\": \"female\",\n          \"weight\": \"11\"\n        },\n        {\n          \"gender\": \"male\",\n          \"weight\": \"10\"\n        }\n      ],\n      \"complications\": \"Minor blood pressure issue\",\n      \"hospital_name\": \"Women's Care Hospital\",\n      \"hospital_address\": \"456 Health Avenue, San Diego, CA\",\n      \"hospital_phone_country\": \"IN\",\n      \"hospital_phone\": \"+919898989898\",\n      \"hospital_fax_country\": \"IN\",\n      \"hospital_fax\": \"1234567890\",\n      \"hospital_email\": \"care@example.com\",\n      \"is_draft\": true,\n      \"is_deleted\": true\n    }\n  ]\n}")
  .asString();
```

```php Surrogate_Account Profile_Pregnancy History_Update Pregnancy History_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'http://localhost:8000/api/surrogates/19/pregnancy-history', [
  'body' => '{
  "pregnancies": [
    {
      "id": 5,
      "delivery_date": "2025-05-02",
      "delivery_type_id": 3,
      "weeks_at": "11",
      "babies": 1,
      "babies_info": [
        {
          "gender": "male",
          "weight": "22"
        }
      ],
      "complications": "No complications",
      "hospital_name": "City Hospital",
      "hospital_address": "123 Main Street, Los Angeles, CA",
      "hospital_phone_country": "US",
      "hospital_phone": "1234567890",
      "hospital_fax_country": "US",
      "hospital_fax": "0987654321",
      "hospital_email": "hospital@example.com",
      "is_draft": false,
      "is_deleted": false
    },
    {
      "id": 6,
      "delivery_date": "2025-05-08",
      "delivery_type_id": 3,
      "weeks_at": "33",
      "babies": 2,
      "babies_info": [
        {
          "gender": "female",
          "weight": "11"
        },
        {
          "gender": "male",
          "weight": "10"
        }
      ],
      "complications": "Minor blood pressure issue",
      "hospital_name": "Women\'s Care Hospital",
      "hospital_address": "456 Health Avenue, San Diego, CA",
      "hospital_phone_country": "IN",
      "hospital_phone": "+919898989898",
      "hospital_fax_country": "IN",
      "hospital_fax": "1234567890",
      "hospital_email": "care@example.com",
      "is_draft": true,
      "is_deleted": true
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Surrogate_Account Profile_Pregnancy History_Update Pregnancy History_example
using RestSharp;

var client = new RestClient("http://localhost:8000/api/surrogates/19/pregnancy-history");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"pregnancies\": [\n    {\n      \"id\": 5,\n      \"delivery_date\": \"2025-05-02\",\n      \"delivery_type_id\": 3,\n      \"weeks_at\": \"11\",\n      \"babies\": 1,\n      \"babies_info\": [\n        {\n          \"gender\": \"male\",\n          \"weight\": \"22\"\n        }\n      ],\n      \"complications\": \"No complications\",\n      \"hospital_name\": \"City Hospital\",\n      \"hospital_address\": \"123 Main Street, Los Angeles, CA\",\n      \"hospital_phone_country\": \"US\",\n      \"hospital_phone\": \"1234567890\",\n      \"hospital_fax_country\": \"US\",\n      \"hospital_fax\": \"0987654321\",\n      \"hospital_email\": \"hospital@example.com\",\n      \"is_draft\": false,\n      \"is_deleted\": false\n    },\n    {\n      \"id\": 6,\n      \"delivery_date\": \"2025-05-08\",\n      \"delivery_type_id\": 3,\n      \"weeks_at\": \"33\",\n      \"babies\": 2,\n      \"babies_info\": [\n        {\n          \"gender\": \"female\",\n          \"weight\": \"11\"\n        },\n        {\n          \"gender\": \"male\",\n          \"weight\": \"10\"\n        }\n      ],\n      \"complications\": \"Minor blood pressure issue\",\n      \"hospital_name\": \"Women's Care Hospital\",\n      \"hospital_address\": \"456 Health Avenue, San Diego, CA\",\n      \"hospital_phone_country\": \"IN\",\n      \"hospital_phone\": \"+919898989898\",\n      \"hospital_fax_country\": \"IN\",\n      \"hospital_fax\": \"1234567890\",\n      \"hospital_email\": \"care@example.com\",\n      \"is_draft\": true,\n      \"is_deleted\": true\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Surrogate_Account Profile_Pregnancy History_Update Pregnancy History_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["pregnancies": [
    [
      "id": 5,
      "delivery_date": "2025-05-02",
      "delivery_type_id": 3,
      "weeks_at": "11",
      "babies": 1,
      "babies_info": [
        [
          "gender": "male",
          "weight": "22"
        ]
      ],
      "complications": "No complications",
      "hospital_name": "City Hospital",
      "hospital_address": "123 Main Street, Los Angeles, CA",
      "hospital_phone_country": "US",
      "hospital_phone": "1234567890",
      "hospital_fax_country": "US",
      "hospital_fax": "0987654321",
      "hospital_email": "hospital@example.com",
      "is_draft": false,
      "is_deleted": false
    ],
    [
      "id": 6,
      "delivery_date": "2025-05-08",
      "delivery_type_id": 3,
      "weeks_at": "33",
      "babies": 2,
      "babies_info": [
        [
          "gender": "female",
          "weight": "11"
        ],
        [
          "gender": "male",
          "weight": "10"
        ]
      ],
      "complications": "Minor blood pressure issue",
      "hospital_name": "Women's Care Hospital",
      "hospital_address": "456 Health Avenue, San Diego, CA",
      "hospital_phone_country": "IN",
      "hospital_phone": "+919898989898",
      "hospital_fax_country": "IN",
      "hospital_fax": "1234567890",
      "hospital_email": "care@example.com",
      "is_draft": true,
      "is_deleted": true
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/api/surrogates/19/pregnancy-history")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```