For a complete page index, fetch https://developer.close.com/llms.txt

# Create a new LeadStatusChange activity

POST https://api.close.com/api/v1/activity/status_change/lead/
Content-Type: application/json

Creating a lead status change does not change the lead's status. It only logs the status change event in the lead's activity feed. This should only be used to import historical status changes from another system.

Reference: https://developer.close.com/api/resources/activities/lead-status-changes/create

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Close API
  version: 1.0.0
paths:
  /activity/status_change/lead/:
    post:
      operationId: create
      summary: Create a new LeadStatusChange activity
      description: >-
        Creating a lead status change does not change the lead's status. It only
        logs the status change event in the lead's activity feed. This should
        only be used to import historical status changes from another system.
      tags:
        - subpackage_activitiesLeadStatusChanges
      parameters:
        - name: Authorization
          in: header
          description: Basic authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/activities.lead_status_changes_create_Response_200
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                description: Any type
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: Not found
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              description: Any type
servers:
  - url: https://api.close.com/api/v1
components:
  schemas:
    activities.lead_status_changes_create_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: activities.lead_status_changes_create_Response_200
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: basic
    OAuth2:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python
import requests

url = "https://api.close.com/api/v1/activity/status_change/lead/"

payload = {
    "date_created": "2013-08-23T20:57:45.956000+00:00",
    "lead_id": "lead_fioU1Nk5LC0H0iei9XBGHW2CFZU0yeP2zZCJQP9pC4m",
    "new_status_id": "stat_t7Zd2uspYPvBafR5bu9agrFZFs8GToWIbDnkqSk8nT8",
    "old_status_id": "stat_TRuQucMjSlSSV6cGAQixHBNyU2FS9zDyixNguwlfXxu"
}
headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, auth=("<CLOSE_API_KEY>", ""))

print(response.json())
```

```javascript
const url = 'https://api.close.com/api/v1/activity/status_change/lead/';
const credentials = btoa("<CLOSE_API_KEY>:");

const options = {
  method: 'POST',
  headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'},
  body: '{"date_created":"2013-08-23T20:57:45.956000+00:00","lead_id":"lead_fioU1Nk5LC0H0iei9XBGHW2CFZU0yeP2zZCJQP9pC4m","new_status_id":"stat_t7Zd2uspYPvBafR5bu9agrFZFs8GToWIbDnkqSk8nT8","old_status_id":"stat_TRuQucMjSlSSV6cGAQixHBNyU2FS9zDyixNguwlfXxu"}'
};

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

```go
package main

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

func main() {

	url := "https://api.close.com/api/v1/activity/status_change/lead/"

	payload := strings.NewReader("{\n  \"date_created\": \"2013-08-23T20:57:45.956000+00:00\",\n  \"lead_id\": \"lead_fioU1Nk5LC0H0iei9XBGHW2CFZU0yeP2zZCJQP9pC4m\",\n  \"new_status_id\": \"stat_t7Zd2uspYPvBafR5bu9agrFZFs8GToWIbDnkqSk8nT8\",\n  \"old_status_id\": \"stat_TRuQucMjSlSSV6cGAQixHBNyU2FS9zDyixNguwlfXxu\"\n}")

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

	req.SetBasicAuth("<CLOSE_API_KEY>", "")
	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
require 'uri'
require 'net/http'

url = URI("https://api.close.com/api/v1/activity/status_change/lead/")

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

request = Net::HTTP::Post.new(url)
request.basic_auth("<CLOSE_API_KEY>", "")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"date_created\": \"2013-08-23T20:57:45.956000+00:00\",\n  \"lead_id\": \"lead_fioU1Nk5LC0H0iei9XBGHW2CFZU0yeP2zZCJQP9pC4m\",\n  \"new_status_id\": \"stat_t7Zd2uspYPvBafR5bu9agrFZFs8GToWIbDnkqSk8nT8\",\n  \"old_status_id\": \"stat_TRuQucMjSlSSV6cGAQixHBNyU2FS9zDyixNguwlfXxu\"\n}"

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.close.com/api/v1/activity/status_change/lead/")
  .basicAuth("<CLOSE_API_KEY>", "")
  .header("Content-Type", "application/json")
  .body("{\n  \"date_created\": \"2013-08-23T20:57:45.956000+00:00\",\n  \"lead_id\": \"lead_fioU1Nk5LC0H0iei9XBGHW2CFZU0yeP2zZCJQP9pC4m\",\n  \"new_status_id\": \"stat_t7Zd2uspYPvBafR5bu9agrFZFs8GToWIbDnkqSk8nT8\",\n  \"old_status_id\": \"stat_TRuQucMjSlSSV6cGAQixHBNyU2FS9zDyixNguwlfXxu\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.close.com/api/v1/activity/status_change/lead/', [
  'body' => '{
  "date_created": "2013-08-23T20:57:45.956000+00:00",
  "lead_id": "lead_fioU1Nk5LC0H0iei9XBGHW2CFZU0yeP2zZCJQP9pC4m",
  "new_status_id": "stat_t7Zd2uspYPvBafR5bu9agrFZFs8GToWIbDnkqSk8nT8",
  "old_status_id": "stat_TRuQucMjSlSSV6cGAQixHBNyU2FS9zDyixNguwlfXxu"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<CLOSE_API_KEY>', ''],
]);

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

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.close.com/api/v1/activity/status_change/lead/");
client.Authenticator = new HttpBasicAuthenticator("<CLOSE_API_KEY>", "");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"date_created\": \"2013-08-23T20:57:45.956000+00:00\",\n  \"lead_id\": \"lead_fioU1Nk5LC0H0iei9XBGHW2CFZU0yeP2zZCJQP9pC4m\",\n  \"new_status_id\": \"stat_t7Zd2uspYPvBafR5bu9agrFZFs8GToWIbDnkqSk8nT8\",\n  \"old_status_id\": \"stat_TRuQucMjSlSSV6cGAQixHBNyU2FS9zDyixNguwlfXxu\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```