LogoLogo
SupportServer Hosting
  • Sonoran CAD
  • 📱Download The App
    • Steam Browser - Workaround
    • Web Browser - Clear Cache
    • Desktop App - Clear Cache
    • GTA RP Tablet - Clear Cache
    • Steam Browser - Clear Cache
  • Why Choose Sonoran CAD?
    • 🏆Why Choose Sonoran CAD?
  • Other Products
    • 🖥️FiveM Hosting
    • 📝Sonoran CMS
    • 📡Sonoran Radio
  • Tutorials
    • Getting Started
      • Registering Your Account
      • Registering Your Community
      • Inviting Users to Your CAD
      • Granting Account Permissions
      • View Your Limits
      • Community ID and API Keys
      • Troubleshooting
    • Customization
      • Custom Domain & Login Page
      • Customizing Your Layout
      • Community Branding and Settings
      • Creating Custom Record and Report Types
      • Sharing Custom Records
      • Custom Search Types
      • Geographical Settings
      • Penal Codes
      • 10-Codes
      • Addresses and Street Names
      • Unit Status Codes
      • Tone Board
      • Custom Audio Notifications
      • Custom Emails
      • Quick Links
      • Custom Page Colors
      • User Account Restrictions
      • Configuring Multiple Servers
      • Advanced Query Strings
    • Dispatching
      • Creating a Call
      • Self Dispatch
      • Timers
      • Command Line Interface (CLI)
    • Records Management
      • Record Lookups
      • Adding a Record
      • PDF Records
      • Scene Diagram Builder
    • Administration
      • System Logs
      • Remove User Account
      • Deleting or Transferring your CAD
    • Other Features
      • Configurable Hotkeys
      • Voice Commands
      • Volume and Language
  • Integration Capabilities
    • 🗃️Paid Integration Resources
      • Mobile Command Center
      • ATM Robbery
      • In-Vehicle Radar
      • Evidence Camera
      • Power Grid
      • Speed Cameras
      • Shot Spotter
    • 🛠️Integrated Vendors
    • 📺Twitch Bodycam, Bot, & Lighting Integration
    • Database Sync and Merge
      • Database Sync Credentials
      • QB Core Mapping Tutorial
      • Troubleshooting
    • Discord Bot Integration
    • Discord Rich Presence
    • Discord Webhooks
    • TeamSpeak 3 Integration
    • Stream Deck Integration
    • 🎮FiveM
      • FiveM Installation
        • Submodule Configuration
          • Submodule Troubleshooting
          • Submodule Configuration Updates
        • FiveM Submodules
          • Body Camera
          • Call Commands
          • Check API ID
          • Civilian Integration
          • Dispatch Notify
          • Emergency Response Simulator (ERS)
          • Framework Support (ESX/QBCore) and Auto Fines
          • FivePD
          • ForceReg
          • Kick
          • Locations
          • Live Map
          • Lookups
          • Postals
          • Smart Signs
          • Sonoran Radio (sonrad)
          • Station Alert
          • Tablet & Mini-CAD
          • TeamSpeak 3
          • Traffic Stop
          • Unit Status
          • VehReg
          • WraithV2
      • FiveM Development Documentation
        • Client Functions
        • Shared Functions
        • Server Functions
        • Server Events
        • HTTP Request Handling
      • Error Codes
    • 🎮Roblox ER:LC
  • Developer API Documentation
    • 📖API Integration
      • Getting Started
        • Retrieving Your Credentials
        • Integration API ID
        • Account Secret ID
      • Push Events
        • Event Restrictions
        • Record Events
          • Record Added
          • Record Edited
          • Record Removed
        • Unit Events
          • Unit Panic
          • Unit Login
          • Unit Logoff
          • Unit Status Update
          • Unit Group Name Change
          • Unit Group Add
          • Unit Group Remove
        • Dispatch Events
          • New Dispatch
          • Modified Dispatch
          • Closed Dispatch
          • Dispatch Note
          • Attach Unit
          • Detach Unit
          • Toggle Bodycam
        • Event 911
        • Remove 911
        • Sign Updated
        • Tone Played
        • Civilian
          • Character Selected
        • ERS
          • New Callout
        • Station Alert
          • New Station Alert
      • API Endpoints
        • API Restrictions
        • Emergency
          • Identifiers
            • Get Identifiers
            • Modify Identifier
            • Set Identifier
            • Unit Panic
            • Kick Unit
            • Unit Status
            • Get Active Units
            • Update Unit Location
          • Dispatch and Emergency Calls
            • Get Calls
            • New Dispatch
            • Attach Unit
            • Detach Unit
            • Update Call Postal
            • Add Call Note
            • Update Call Primary
            • Close Dispatch
            • New 911 Call
            • Remove 911
          • Custom Blips
            • Get Map Blips
            • Add Blip
            • Modify Blip
            • Remove Blip
          • Street Signs
            • Set Street Sign Config
            • Update Street Sign
          • ERS
            • Set Available Callouts
          • Station Alert
            • Set Stations
        • Civilian
          • Set Character
          • Get Characters
          • New Character
          • Edit Character
          • Remove Character
          • DB Sync: Get Character Links
          • DB Sync: Link Character
        • General
          • Get Servers
          • Set Servers
          • Get Version
          • Set Penal Codes
          • Set API IDs
          • Custom Records
            • API Options for Adding and Modifying Records
            • Get Record Templates
            • New Record
            • Edit Record
            • Remove Record
          • Lookup By Value
          • Lookup Name or Plate
          • Get Account
          • Get Accounts
          • Check API ID
          • Apply Permission Key
          • Modify Account Permissions
          • Kick or Ban User
          • Verify Secret
          • Auth Street Signs
          • Set Postal Config
          • Set Clock Time
          • Send Photo
          • Leave Community
          • Join Community
        • Local Endpoints
          • Smart Lighting
        • Internal
          • FiveM Download
      • API Examples
        • Emergency
          • LUA Examples
            • Dispatch and Emergency Calls
              • New 911 Call
              • Remove 911
              • Add Call Note
              • Set Call Postal
            • Custom Blips
              • Add Blip
              • Add Blips
              • Add Temp Blip
              • Get Map Blips
              • Remove Blip
              • Remove Blip With Subtype
            • General
              • Lookup Name or Plate
          • JavaScript Examples
            • Dispatch and Emergency Calls
              • New 911 Call
              • Remove 911
              • Add Call Note
              • Set Call Postal
            • Custom Blips
              • Add Blip
              • Add Blips
              • Add Temp Blip
              • Get Map Blips
              • Remove Blip
              • Remove Blip With Subtype
            • General
              • Lookup Name or Plate
      • Development Branch
    • 💵Developer Bounties
    • 🌎Translation Support
  • Pricing
    • Pricing FAQ
      • Military and First Responder Discount
      • Expert Installation
      • Accessing the Payment Center
      • Create and Manage a Subscription
      • Request Discord Role
    • View and Compare Plans
  • Roadmap
    • 📋Changelog
  • Other
    • AI QA
    • Contact Us
    • Policy
      • Rocket CAD Closure
      • Terms of Service
      • Privacy Policy
      • Refund and Purchase Policy
      • Discord Bot
    • Archive
      • Fire Siren
Powered by GitBook
On this page
  • Available Endpoints
  • Option 1 - Dictionary Values
  • 1. Getting the `recordTypeId`
  • 2. Getting the `recordId`
  • 3. Creating the `replaceValues` Dictionary
  • Dictionary For Non-Custom Sections
  • Option 2 - Raw JSON

Was this helpful?

Edit on GitHub
  1. Developer API Documentation
  2. API Integration
  3. API Endpoints
  4. General
  5. Custom Records

API Options for Adding and Modifying Records

Our API has multiple options when adding or modifying a custom record. Learn more about these below!

PreviousCustom RecordsNextGet Record Templates

Last updated 7 months ago

Was this helpful?

Available Endpoints

All endpoints for new and existing records and characters utilize these two common methods.

Option 1 - Dictionary Values

The easiest way to create or modify a custom record via API is to supply a "dictionary" of key/value field pairs.

1. Getting the `recordTypeId`

For adding a new record or character, you will need to specify the recordTypeId.

The recordTypeId is a unique number for your custom record template. This is visible in the custom record JSON's recordTypeId field, or next to the template name in the admin menu.

2. Getting the `recordId`

For modifying an existing record or character, you will need to specify the recordId.

When viewing a record's JSON from a lookup endpoint, the record's id field is the unique ID for that filed record.

You can also view a record's ID in the UI with an id type custom field.

3. Creating the `replaceValues` Dictionary

The replaceValues dictionary specifies the field UID (unique ID) and the desired text value to input.

You can easily copy a template field's UID in the admin menu by expanding the section and copying the very last column in the editor. This is shown as the Field Mapping ID or Field UID.

Example Dictionary

"replaceValues": {
    "first": "Brian", // Set field with UID of 'first' to 'Brian'
    "_qkz7j5fxy": "Some Value" // Set field with UID of '_qkz7j5fxy' to 'Some Value'
}

Dictionary For Non-Custom Sections

For these, the dictionary value should be a JSON string of the object that the data property will be set to.

JSON String - Flags Data
// Stringified JSON for the FLAGS object
// Value will be stored in the section[index].fields[0].data
// NOTE: `flags` property is an ARRAY of flag strings
"replaceValues": {
    "someUidFlagsField": "{\"flags\":[\"FLAG 1\",\"FLAG 2\"]}"
}
JSON String - Charges Data
// Stringified JSON for the CHARGES object
// Value will be stored in the section[index].fields[0].data
// NOTE: `charges` property is an ARRAY of charge objects
"replaceValues": {
    "someUidChargesField": "{\"charges\":[{\"jailTime\":\"1 Year\",\"arrestCharge\":\"Some Crime\",\"arrestBondType\":\"Federal Bail Bond\",\"arrestBondAmount\":123,\"arrestChargeCode\":\"(1)23\",\"arrestChargeType\":\"Felony\",\"arrestChargeCounts\":1}]}"
}
JSON String - Speed Data
// Stringfied JSON for the SPEED object
// Value will be stored in the section[index].fields[0].data
"replaceValues": {
    "someUidSpeedField": "{\"date\":\"2024/09/01\",\"fine\":\"123\",\"time\":\"03:30\",\"paceType\":\"Radar\",\"speedLimit\":\"50\",\"vehicleSpeed\":\"100\"}"
}
JSON String - Link Data
// Stringified JSON for the Link object
// Value will be stored in the section[index].fields[0].data
// NOTE: `records` property is an ARRAY of record link objects
"replaceValues": {
    "someUidLinkField": "{\"records\":[{\"link\":3,\"type\":8,\"label\":\"Arrest #3\"}]}"
}

Option 2 - Raw JSON

The more complicated but complete way to add or modify custom records via API is supplying the full, raw JSON structure of the record.

For section types like flags, charges, speed, or link these objects are stored in a data object on the first field in the section. These section type enums can be found under the .

Custom records require a strict format with several dozen different data fields. Due to the complexity, it is highly recommended to create a new custom record template in the CAD UI, and then for adding new records.

Or, view a detailed explanation of .

📖
retrieve the record template
New Record
Edit Record
New Character
Edit Character
custom record formatting
custom record formatting
Custom Records - Record Type ID
Custom Records - Record ID
Custom Records - Field UID