---
title: "View source for System Api - DreamFactory Wiki"
source: "http://wiki.dreamfactory.com/index.php?action=edit&title=System_Api"
canonical_url: "http://wiki.dreamfactory.com/index.php?action=edit&title=System_Api"
converted_at: "2026-11-22T13:06:13.539Z"
format: "markdown"
converted_by: "html-to-md-ai"
---
[]()
	
	
	
	# View source for System Api

	
		
		← [System Api](/System_Api)
		
		
		
		[Jump to navigation](#mw-head)
		[Jump to search](#searchInput)
		You do not have permission to edit this page, for the following reason:

The action you have requested is limited to users in the group: [Users](/index.php?title=DreamFactory_Wiki:Users&action=edit&redlink=1).---

You can view and copy the source of this page.

{{#seo:
|title=System API - DreamFactory Documentation
|title_mode=replace
|description=Complete reference for the DreamFactory System API — managing admins, users, apps, roles, services, and sessions. Derived from live OpenAPI spec at /api/v2/api_docs/system.
|keywords=system API, admin, user management, roles, services, apps, CORS, session, JWT
|og:title=System API
|og:type=article
|og:site_name=DreamFactory Documentation
|og:description=Complete reference for the DreamFactory System API — managing admins, users, apps, roles, services, and sessions. Derived from live OpenAPI spec at /api/v2/api_docs/system.
}}
'''Complete reference for the DreamFactory System API — managing admins, users, apps, roles, services, and sessions. Derived from live OpenAPI spec at /api/v2/api_docs/system.'''

&lt;span id="system-api">&lt;/span>
= System API =

&lt;blockquote>All endpoints below are prefixed with &lt;code>/api/v2/system/&lt;/code>. Every request requires &lt;code>X-DreamFactory-API-Key&lt;/code>. Most require &lt;code>X-DreamFactory-Session-Token&lt;/code> as well. See [[Authentication]].
&lt;/blockquote>
&lt;blockquote>'''LLM tip:''' Retrieve the live OpenAPI spec for this service at &lt;code>GET /api/v2/api_docs/system&lt;/code> (DF 7.4.x) or &lt;code>GET /api/v2/system/_spec&lt;/code> (DF 7.5+). Always check the live spec first — it's the ground truth. See [[Api_Generation_And_Connections/Api_Discovery|API Discovery]].
&lt;/blockquote>

-----

&lt;span id="session-management">&lt;/span>
== Session Management ==

&lt;span id="post-apiv2systemadminsession-login">&lt;/span>
=== &lt;code>POST /api/v2/system/admin/session&lt;/code> — Login ===

The correct admin login endpoint. Do NOT use &lt;code>/api/v2/admin/session&lt;/code> or &lt;code>/api/v2/user/session&lt;/code>.

'''Required headers:''' &lt;code>Content-Type: application/json&lt;/code>, &lt;code>X-DreamFactory-API-Key&lt;/code>

'''Request schema:'''

&lt;syntaxhighlight lang="json">{
  "email": "string (required)",
  "password": "string (required)",
  "duration": "integer (optional, session duration in minutes, 0 = until browser close)"
}&lt;/syntaxhighlight>
'''Response schema:'''

&lt;syntaxhighlight lang="json">{
  "session_token": "string — use as X-DreamFactory-Session-Token",
  "session_id": "string — same as session_token",
  "id": "integer",
  "email": "string",
  "first_name": "string",
  "last_name": "string",
  "name": "string",
  "is_sys_admin": "boolean",
  "role": "string",
  "last_login_date": "string",
  "token_expiry_date": "string",
  "apps": "array",
  "ticket": "string",
  "ticket_expiry": "string"
}&lt;/syntaxhighlight>
'''Example:'''

&lt;syntaxhighlight lang="bash">curl -s -X POST http://your-df-host/api/v2/system/admin/session \
  -H "Content-Type: application/json" \
  -H "X-DreamFactory-API-Key: YOUR_ADMIN_APP_API_KEY" \
  -d @login.json   # {"email":"admin@example.com","password":"yourpassword"}&lt;/syntaxhighlight>
&lt;blockquote>⚠️ Shell quoting issues with &lt;code>-d '...'&lt;/code> can silently break JSON parsing. Use &lt;code>-d @file.json&lt;/code> for reliability.
&lt;/blockquote>
&lt;span id="get-apiv2systemadminsession-refresh-check">&lt;/span>
=== &lt;code>GET /api/v2/system/admin/session&lt;/code> — Refresh / Check ===

Refreshes the current session token. Returns current user info.

&lt;span id="put-apiv2systemadminsession-refresh-via-token-param">&lt;/span>
=== &lt;code>PUT /api/v2/system/admin/session&lt;/code> — Refresh via token param ===

Pass &lt;code>session_token&lt;/code> as query param or &lt;code>X-DreamFactory-Session-Token&lt;/code> header to refresh a specific token.

&lt;span id="delete-apiv2systemadminsession-logout">&lt;/span>
=== &lt;code>DELETE /api/v2/system/admin/session&lt;/code> — Logout ===

Destroys the current session.

-----

&lt;span id="admin-management">&lt;/span>
== Admin Management ==

&lt;span id="get-apiv2systemadmin">&lt;/span>
=== &lt;code>GET /api/v2/system/admin&lt;/code> ===

List all system administrators.

'''Query params:''' &lt;code>fields&lt;/code>, &lt;code>related&lt;/code>, &lt;code>ids&lt;/code>, &lt;code>filter&lt;/code>, &lt;code>limit&lt;/code>, &lt;code>offset&lt;/code>, &lt;code>order&lt;/code>, &lt;code>include_count&lt;/code>

&lt;syntaxhighlight lang="bash">curl -s http://your-df-host/api/v2/system/admin \
  -H "X-DreamFactory-API-Key: KEY" \
  -H "X-DreamFactory-Session-Token: TOKEN"&lt;/syntaxhighlight>
&lt;span id="post-apiv2systemadmin">&lt;/span>
=== &lt;code>POST /api/v2/system/admin&lt;/code> ===

Create one or more admins.

'''Request schema:'''

&lt;syntaxhighlight lang="json">{
  "resource": [{
    "name": "string (required)",
    "email": "string (required)",
    "first_name": "string",
    "last_name": "string",
    "username": "string",
    "phone": "string",
    "is_active": "boolean",
    "default_app_id": "integer"
  }]
}&lt;/syntaxhighlight>
&lt;span id="patch-apiv2systemadminid-update-admin">&lt;/span>
=== &lt;code>PATCH /api/v2/system/admin/{id}&lt;/code> — Update Admin ===

&lt;span id="delete-apiv2systemadminid-delete-admin">&lt;/span>
=== &lt;code>DELETE /api/v2/system/admin/{id}&lt;/code> — Delete Admin ===

&lt;span id="post-apiv2systemadminpassword-change-password">&lt;/span>
=== &lt;code>POST /api/v2/system/admin/password&lt;/code> — Change Password ===

&lt;span id="getpost-apiv2systemadminprofile-getupdate-profile">&lt;/span>
=== &lt;code>GET/POST /api/v2/system/admin/profile&lt;/code> — Get/Update Profile ===

-----

&lt;span id="user-management">&lt;/span>
== User Management ==

Non-admin users. Same pattern as admin endpoints.

&lt;span id="get-apiv2systemuser">&lt;/span>
=== &lt;code>GET /api/v2/system/user&lt;/code> ===

&lt;span id="post-apiv2systemuser">&lt;/span>
=== &lt;code>POST /api/v2/system/user&lt;/code> ===

'''Request schema:'''

&lt;syntaxhighlight lang="json">{
  "resource": [{
    "name": "string (required)",
    "email": "string (required)",
    "first_name": "string",
    "last_name": "string",
    "is_active": "boolean",
    "phone": "string"
  }]
}&lt;/syntaxhighlight>
&lt;span id="patch-apiv2systemuserid">&lt;/span>
=== &lt;code>PATCH /api/v2/system/user/{id}&lt;/code> ===

&lt;span id="delete-apiv2systemuserid">&lt;/span>
=== &lt;code>DELETE /api/v2/system/user/{id}&lt;/code> ===

-----

&lt;span id="app-management">&lt;/span>
== App Management ==

Apps hold API keys. Each app gets its own &lt;code>api_key&lt;/code> used in &lt;code>X-DreamFactory-API-Key&lt;/code>.

&lt;span id="get-apiv2systemapp-list-apps">&lt;/span>
=== &lt;code>GET /api/v2/system/app&lt;/code> — List Apps ===

&lt;span id="post-apiv2systemapp-create-app">&lt;/span>
=== &lt;code>POST /api/v2/system/app&lt;/code> — Create App ===

'''Request schema:'''

&lt;syntaxhighlight lang="json">{
  "resource": [{
    "name": "string (required)",
    "label": "string",
    "description": "string",
    "is_active": "boolean"
  }]
}&lt;/syntaxhighlight>
'''Response includes &lt;code>api_key&lt;/code>''' — this is the value used in &lt;code>X-DreamFactory-API-Key&lt;/code> for all requests.

&lt;span id="patch-apiv2systemappid">&lt;/span>
=== &lt;code>PATCH /api/v2/system/app/{id}&lt;/code> ===

&lt;span id="delete-apiv2systemappid">&lt;/span>
=== &lt;code>DELETE /api/v2/system/app/{id}&lt;/code> ===

-----

&lt;span id="service-management">&lt;/span>
== Service Management ==

Services are database connections, file storage, APIs, etc. Each gets a &lt;code>name&lt;/code> (namespace) used in API paths like &lt;code>/api/v2/{name}/_table/...&lt;/code>.

&lt;span id="get-apiv2systemservice-list-services">&lt;/span>
=== &lt;code>GET /api/v2/system/service&lt;/code> — List Services ===

&lt;span id="post-apiv2systemservice-create-service">&lt;/span>
=== &lt;code>POST /api/v2/system/service&lt;/code> — Create Service ===

'''Request schema:'''

&lt;syntaxhighlight lang="json">{
  "resource": [{
    "name": "string (required) — becomes URL namespace, lowercase alphanumeric",
    "label": "string (required) — display name",
    "type": "string (required) — service type id, e.g. 'mysql', 'sqlite', 'aws_s3'",
    "description": "string",
    "is_active": "boolean",
    "config": "object — type-specific configuration"
  }]
}&lt;/syntaxhighlight>
'''Get available service types:'''

&lt;syntaxhighlight lang="bash">curl -s http://your-df-host/api/v2/system/service_type \
  -H "X-DreamFactory-API-Key: KEY" \
  -H "X-DreamFactory-Session-Token: TOKEN"&lt;/syntaxhighlight>
&lt;span id="patch-apiv2systemserviceid">&lt;/span>
=== &lt;code>PATCH /api/v2/system/service/{id}&lt;/code> ===

&lt;span id="delete-apiv2systemserviceid">&lt;/span>
=== &lt;code>DELETE /api/v2/system/service/{id}&lt;/code> ===

-----

&lt;span id="role-management">&lt;/span>
== Role Management ==

Roles control what services and operations a user or app can access (RBAC).

&lt;span id="get-apiv2systemrole-list-roles">&lt;/span>
=== &lt;code>GET /api/v2/system/role&lt;/code> — List Roles ===

&lt;span id="post-apiv2systemrole-create-role">&lt;/span>
=== &lt;code>POST /api/v2/system/role&lt;/code> — Create Role ===

'''Request schema:'''

&lt;syntaxhighlight lang="json">{
  "resource": [{
    "name": "string (required)",
    "description": "string",
    "is_active": "boolean"
  }]
}&lt;/syntaxhighlight>
&lt;span id="patch-apiv2systemroleid">&lt;/span>
=== &lt;code>PATCH /api/v2/system/role/{id}&lt;/code> ===

&lt;span id="delete-apiv2systemroleid">&lt;/span>
=== &lt;code>DELETE /api/v2/system/role/{id}&lt;/code> ===

-----

&lt;span id="cors-configuration">&lt;/span>
== CORS Configuration ==

&lt;span id="get-apiv2systemcors-list-cors-rules">&lt;/span>
=== &lt;code>GET /api/v2/system/cors&lt;/code> — List CORS Rules ===

&lt;span id="post-apiv2systemcors-create-cors-rule">&lt;/span>
=== &lt;code>POST /api/v2/system/cors&lt;/code> — Create CORS Rule ===

&lt;span id="patch-apiv2systemcorsid">&lt;/span>
=== &lt;code>PATCH /api/v2/system/cors/{id}&lt;/code> ===

&lt;span id="delete-apiv2systemcorsid">&lt;/span>
=== &lt;code>DELETE /api/v2/system/cors/{id}&lt;/code> ===

-----

&lt;span id="other-system-endpoints">&lt;/span>
== Other System Endpoints ==

{| class="wikitable"
|-
! Endpoint
! Method
! Description
|-
| &lt;code>/api/v2/system/environment&lt;/code>
| GET
| System environment info (version, platform, etc.)
|-
| &lt;code>/api/v2/system/event&lt;/code>
| GET
| List system events
|-
| &lt;code>/api/v2/system/cache&lt;/code>
| DELETE
| Clear all cache
|-
| &lt;code>/api/v2/system/cache/{service}&lt;/code>
| DELETE
| Clear cache for one service
|-
| &lt;code>/api/v2/system/lookup&lt;/code>
| GET/POST/PATCH/DELETE
| Manage lookup keys (global variables)
|-
| &lt;code>/api/v2/system/constant&lt;/code>
| GET
| Read-only system constants
|-
| &lt;code>/api/v2/system/package&lt;/code>
| GET/POST
| Export/import configuration packages
|-
| &lt;code>/api/v2/system/email_template&lt;/code>
| GET/POST/PATCH/DELETE
| Manage email templates
|-
| &lt;code>/api/v2/system/custom&lt;/code>
| GET/POST/PATCH/DELETE
| Custom system settings
|}

-----

&lt;span id="common-query-parameters-all-list-endpoints">&lt;/span>
== Common Query Parameters (all list endpoints) ==

{| class="wikitable"
|-
! Parameter
! Type
! Description
|-
| &lt;code>fields&lt;/code>
| string
| Comma-separated fields to return, &lt;code>*&lt;/code> for all
|-
| &lt;code>related&lt;/code>
| string
| Related resources to include
|-
| &lt;code>ids&lt;/code>
| string
| Comma-separated IDs to retrieve
|-
| &lt;code>filter&lt;/code>
| string
| SQL-like filter, e.g. &lt;code>is_active=1&lt;/code>
|-
| &lt;code>limit&lt;/code>
| integer
| Max records to return
|-
| &lt;code>offset&lt;/code>
| integer
| Skip N records
|-
| &lt;code>order&lt;/code>
| string
| Sort, e.g. &lt;code>name ASC&lt;/code>
|-
| &lt;code>include_count&lt;/code>
| boolean
| Include total count in meta
|}

-----

&lt;span id="response-envelope">&lt;/span>
== Response Envelope ==

All list responses are wrapped:

&lt;syntaxhighlight lang="json">{
  "resource": [ {...}, {...} ],
  "meta": { "count": 10 }
}&lt;/syntaxhighlight>
Single-record responses (by ID) return the object directly.

[[Category:System_Api]]
[[Category:Admin]]
[[Category:User_Management]]
[[Category:API]]

[[Category:API]]
Return to [System Api](/System_Api).

Retrieved from "[https://wiki.dreamfactory.com/System_Api](https://wiki.dreamfactory.com/System_Api)"