# Get audit log entry

GET https://app.launchdarkly.com/api/v2/auditlog/{id}

Fetch a detailed audit log entry representation. The detailed representation includes several fields that are not present in the summary representation, including:

- `previousVersion`: a JSON representation of the previous version of the entity.
- `currentVersion`: a JSON representation of the current version of the entity.
- `delta`: the JSON patch body that was used in the request to update the entity. This is only included if the update was made through a [JSON patch](https://launchdarkly.com/docs/api#updates-using-json-patch). It is null when the update was made using [semantic patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch). Because most [flag updates](https://launchdarkly.com/docs/api/feature-flags/patch-feature-flag) are made using semantic patch, this field is rarely returned.


Reference: https://launchdarkly.com/docs/api/audit-log/get-audit-log-entry

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: LaunchDarkly REST API
  version: 1.0.0
paths:
  /api/v2/auditlog/{id}:
    get:
      operationId: get-audit-log-entry
      summary: Get audit log entry
      description: >
        Fetch a detailed audit log entry representation. The detailed
        representation includes several fields that are not present in the
        summary representation, including:


        - `previousVersion`: a JSON representation of the previous version of
        the entity.

        - `currentVersion`: a JSON representation of the current version of the
        entity.

        - `delta`: the JSON patch body that was used in the request to update
        the entity. This is only included if the update was made through a [JSON
        patch](https://launchdarkly.com/docs/api#updates-using-json-patch). It
        is null when the update was made using [semantic
        patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch).
        Because most [flag
        updates](https://launchdarkly.com/docs/api/feature-flags/patch-feature-flag)
        are made using semantic patch, this field is rarely returned.
      tags:
        - subpackage_auditLog
      parameters:
        - name: id
          in: path
          description: The ID of the audit log entry
          required: true
          schema:
            type: string
            format: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Audit log entry response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditLogEntryRep'
        '401':
          description: Invalid access token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorRep'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenErrorRep'
        '404':
          description: Invalid resource identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorRep'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitedErrorRep'
servers:
  - url: https://app.launchdarkly.com
  - url: https://app.launchdarkly.us
components:
  schemas:
    Link:
      type: object
      properties:
        href:
          type: string
          description: The URL of the link
        type:
          type: string
          description: The type of the link
      title: Link
    UnixMillis:
      type: integer
      format: int64
      title: UnixMillis
    ActionIdentifier:
      type: string
      title: ActionIdentifier
    ResourceAccess:
      type: object
      properties:
        action:
          $ref: '#/components/schemas/ActionIdentifier'
        resource:
          type: string
      title: ResourceAccess
    ResourceKind:
      type: string
      title: ResourceKind
    SubjectDataRep:
      type: object
      properties:
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
        name:
          type: string
          description: The subject's name
        avatarUrl:
          type: string
          description: The subject's avatar
      title: SubjectDataRep
    MemberDataRep:
      type: object
      properties:
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
        _id:
          type: string
          description: The member ID
        email:
          type: string
          description: The member email
        firstName:
          type: string
          description: The member first name
        lastName:
          type: string
          description: The member last name
      title: MemberDataRep
    TokenSummary:
      type: object
      properties:
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
        _id:
          type: string
        name:
          type: string
          description: The name of the token
        ending:
          type: string
          description: The last few characters of the token
        serviceToken:
          type: boolean
          description: Whether this is a service token
      title: TokenSummary
    AuthorizedAppDataRep:
      type: object
      properties:
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
        _id:
          type: string
          description: The ID of the authorized application
        isScim:
          type: boolean
          description: Whether the application is authorized through SCIM
        name:
          type: string
          description: The authorized application name
        maintainerName:
          type: string
          description: The name of the maintainer for this authorized application
      title: AuthorizedAppDataRep
    TargetResourceRep:
      type: object
      properties:
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
        name:
          type: string
          description: The name of the resource
        resources:
          type: array
          items:
            type: string
          description: The resource specifier
      title: TargetResourceRep
    ParentResourceRep:
      type: object
      properties:
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
        name:
          type: string
          description: The name of the parent resource
        resource:
          type: string
          description: The parent's resource specifier
      title: ParentResourceRep
    AuditLogEntryListingRep:
      type: object
      properties:
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
          description: The location and content type of related resources
        _id:
          type: string
          description: The ID of the audit log entry
        _accountId:
          type: string
          description: The ID of the account to which this audit log entry belongs
        date:
          $ref: '#/components/schemas/UnixMillis'
          description: Timestamp of the audit log entry
        accesses:
          type: array
          items:
            $ref: '#/components/schemas/ResourceAccess'
          description: >-
            Details on the actions performed and resources acted on in this
            audit log entry
        kind:
          $ref: '#/components/schemas/ResourceKind'
          description: The type of resource this audit log entry refers to
        name:
          type: string
          description: The name of the resource this audit log entry refers to
        description:
          type: string
          description: Description of the change recorded in the audit log entry
        shortDescription:
          type: string
          description: Shorter version of the change recorded in the audit log entry
        comment:
          type: string
          description: Optional comment for the audit log entry
        subject:
          $ref: '#/components/schemas/SubjectDataRep'
          description: >-
            Details of the subject who initiated the action described in the
            audit log entry
        member:
          $ref: '#/components/schemas/MemberDataRep'
          description: >-
            Details of the member who initiated the action described in the
            audit log entry
        token:
          $ref: '#/components/schemas/TokenSummary'
          description: >-
            Details of the access token that initiated the action described in
            the audit log entry
        app:
          $ref: '#/components/schemas/AuthorizedAppDataRep'
          description: >-
            Details of the authorized application that initiated the action
            described in the audit log entry
        titleVerb:
          type: string
          description: The action and resource recorded in this audit log entry
        title:
          type: string
          description: >-
            A description of what occurred, in the format <code>member</code>
            <code>titleVerb</code> <code>target</code>
        target:
          $ref: '#/components/schemas/TargetResourceRep'
          description: Details of the resource acted upon in this audit log entry
        parent:
          $ref: '#/components/schemas/ParentResourceRep'
      required:
        - _links
        - _id
        - _accountId
        - date
        - accesses
        - kind
        - name
        - description
        - shortDescription
      title: AuditLogEntryListingRep
    AuditLogEntryRep:
      type: object
      properties:
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
          description: The location and content type of related resources
        _id:
          type: string
          description: The ID of the audit log entry
        _accountId:
          type: string
          description: The ID of the account to which this audit log entry belongs
        date:
          $ref: '#/components/schemas/UnixMillis'
          description: Timestamp of the audit log entry
        accesses:
          type: array
          items:
            $ref: '#/components/schemas/ResourceAccess'
          description: >-
            Details on the actions performed and resources acted on in this
            audit log entry
        kind:
          $ref: '#/components/schemas/ResourceKind'
          description: The type of resource this audit log entry refers to
        name:
          type: string
          description: The name of the resource this audit log entry refers to
        description:
          type: string
          description: Description of the change recorded in the audit log entry
        shortDescription:
          type: string
          description: Shorter version of the change recorded in the audit log entry
        comment:
          type: string
          description: Optional comment for the audit log entry
        subject:
          $ref: '#/components/schemas/SubjectDataRep'
          description: >-
            Details of the subject who initiated the action described in the
            audit log entry
        member:
          $ref: '#/components/schemas/MemberDataRep'
          description: >-
            Details of the member who initiated the action described in the
            audit log entry
        token:
          $ref: '#/components/schemas/TokenSummary'
          description: >-
            Details of the access token that initiated the action described in
            the audit log entry
        app:
          $ref: '#/components/schemas/AuthorizedAppDataRep'
          description: >-
            Details of the authorized application that initiated the action
            described in the audit log entry
        titleVerb:
          type: string
          description: The action and resource recorded in this audit log entry
        title:
          type: string
          description: >-
            A description of what occurred, in the format <code>member</code>
            <code>titleVerb</code> <code>target</code>
        target:
          $ref: '#/components/schemas/TargetResourceRep'
          description: Details of the resource acted upon in this audit log entry
        parent:
          $ref: '#/components/schemas/ParentResourceRep'
        delta:
          description: >-
            If the audit log entry has been updated, this is the JSON patch body
            that was used in the request to update the entity
        triggerBody:
          description: >-
            A JSON representation of the external trigger for this audit log
            entry, if any
        merge:
          description: >-
            A JSON representation of the merge information for this audit log
            entry, if any
        previousVersion:
          description: >-
            If the audit log entry has been updated, this is a JSON
            representation of the previous version of the entity
        currentVersion:
          description: >-
            If the audit log entry has been updated, this is a JSON
            representation of the current version of the entity
        subentries:
          type: array
          items:
            $ref: '#/components/schemas/AuditLogEntryListingRep'
      required:
        - _links
        - _id
        - _accountId
        - date
        - accesses
        - kind
        - name
        - description
        - shortDescription
      title: AuditLogEntryRep
    UnauthorizedErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: UnauthorizedErrorRep
    ForbiddenErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: ForbiddenErrorRep
    NotFoundErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: NotFoundErrorRep
    RateLimitedErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: RateLimitedErrorRep
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization

```

## SDK Code Examples

```python
import requests

url = "https://app.launchdarkly.com/api/v2/auditlog/id"

headers = {"Authorization": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.launchdarkly.com/api/v2/auditlog/id';
const options = {method: 'GET', headers: {Authorization: '<apiKey>'}};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://app.launchdarkly.com/api/v2/auditlog/id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<apiKey>")

	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://app.launchdarkly.com/api/v2/auditlog/id")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<apiKey>'

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.get("https://app.launchdarkly.com/api/v2/auditlog/id")
  .header("Authorization", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://app.launchdarkly.com/api/v2/auditlog/id', [
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://app.launchdarkly.com/api/v2/auditlog/id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://app.launchdarkly.com/api/v2/auditlog/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```