-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.json
More file actions
1493 lines (1493 loc) · 54.7 KB
/
Copy pathopenapi.json
File metadata and controls
1493 lines (1493 loc) · 54.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"openapi": "3.0.3",
"info": {
"title": "X-Plane Local Web API",
"description": "Starting with version 12.1.1, X-Plane includes a built-in web server that provides a REST and WebSocket API for communicating with a running simulator instance.\n\nThis spec covers the **REST API** endpoints. For WebSocket message types, see the companion AsyncAPI spec.\n\nThe web server listens on `localhost:8086` by default. You can change the port with `--web_server_port=XXXX` when launching X-Plane. To disable the API entirely, set the network security policy to \"Disable Incoming Traffic\" in Settings > Network.\n\n**Note:** The `/api/capabilities` endpoint is unversioned (not under `/api/v3/`). All other endpoints are versioned under `/api/v3/`.\n\nThe web server is built on [Drogon](https://github.com/drogonframework/drogon) (C++). Requests to invalid paths return a default Drogon HTML 404 page, not JSON.\n\nFor more information, see the [official documentation](https://developer.x-plane.com/article/x-plane-web-api/).",
"version": "3.0.0",
"contact": {
"name": "X-Plane Developer",
"url": "https://developer.x-plane.com"
}
},
"servers": [
{
"url": "http://localhost:8086/api/v3",
"description": "X-Plane local web server (v3, default port)"
}
],
"tags": [
{
"name": "Capabilities",
"description": "API version and X-Plane version information"
},
{
"name": "Datarefs",
"description": "Read and write simulator datarefs"
},
{
"name": "Commands",
"description": "List and activate simulator commands"
},
{
"name": "Flight",
"description": "Initialize or update a flight"
}
],
"paths": {
"/capabilities": {
"get": {
"tags": ["Capabilities"],
"summary": "Get API capabilities",
"description": "Returns the supported API versions and the running X-Plane version.\n\n**Note:** This endpoint is unversioned. Use the `/api/capabilities` server, not `/api/v3/capabilities`.",
"operationId": "getCapabilities",
"servers": [
{
"url": "http://localhost:8086/api",
"description": "Unversioned endpoint"
}
],
"responses": {
"200": {
"description": "Successful response with API and X-Plane version info",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiCapabilities"
},
"example": {
"api": {
"versions": ["v1", "v2", "v3"]
},
"x-plane": {
"version": "12.4.0"
}
}
}
}
}
}
}
},
"/datarefs": {
"get": {
"tags": ["Datarefs"],
"summary": "List datarefs",
"description": "Returns all registered datarefs in X-Plane at the moment of the request (both built-in and created by third parties). Supports filtering, pagination, and field selection.",
"operationId": "listDatarefs",
"parameters": [
{
"name": "filter[name]",
"in": "query",
"description": "Filter by exact dataref name. Repeatable — multiple values are joined with OR logic.",
"schema": {
"type": "string"
},
"example": "sim/time/zulu_time_sec"
},
{
"name": "start",
"in": "query",
"description": "Index from where to start (inclusive, for pagination).",
"schema": {
"type": "integer",
"minimum": 0
}
},
{
"name": "limit",
"in": "query",
"description": "Maximum number of results to return (for pagination).",
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "fields",
"in": "query",
"description": "Comma-separated list of fields to return per record. Available fields: `id`, `name`, `value_type`. Use `all` (default) to return all fields. Note: `is_writable` is always included automatically when present but cannot be used as a field selector.",
"schema": {
"type": "string",
"default": "all"
},
"example": "id,name,value_type"
}
],
"responses": {
"200": {
"description": "Successful response with array of datarefs",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Dataref"
}
}
}
},
"example": {
"data": [
{
"id": 40003472032,
"is_writable": true,
"name": "sim/time/zulu_time_sec",
"value_type": "float"
}
]
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"start_out_of_range": {
"value": {
"error_code": "start_out_of_range",
"error_message": "Start out of range"
}
},
"limit_out_of_range": {
"value": {
"error_code": "limit_out_of_range",
"error_message": "Limit out of range"
}
},
"invalid_field": {
"value": {
"error_code": "invalid_field",
"error_message": "Field name 'foo' does not exist"
}
}
}
}
}
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"description": "Dataref name not found (when using filter[name])",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"example": {
"error_code": "invalid_dataref_name",
"error_message": "Dataref name 'foo' doesn't exist"
}
}
}
}
}
}
},
"/datarefs/count": {
"get": {
"tags": ["Datarefs"],
"summary": "Get dataref count",
"description": "Returns the number of registered datarefs in X-Plane at the moment (both built-in and created by third parties).",
"operationId": "getDatarefCount",
"responses": {
"200": {
"description": "Successful response with the dataref count",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "integer",
"description": "Total number of registered datarefs"
}
}
},
"example": {
"data": 7396
}
}
}
},
"403": {
"$ref": "#/components/responses/Forbidden"
}
}
}
},
"/datarefs/{id}/value": {
"get": {
"tags": ["Datarefs"],
"summary": "Get dataref value",
"description": "Returns the current value of a dataref. For array datarefs, returns the full array or a single element if `index` is specified.\n\n**Note:** The official documentation shows a copy-pasted error table from List datarefs for this endpoint (with `start_out_of_range`, `limit_out_of_range`, etc.). The actual error codes for this endpoint are `index_out_of_range`, `not_an_array`, and `invalid_dataref_id`.",
"operationId": "getDatarefValue",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "Numeric ID of the dataref (obtained from List datarefs). This ID is stable within an X-Plane session but may change between sessions.",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "index",
"in": "query",
"description": "Index to get on array datarefs.",
"schema": {
"type": "integer",
"minimum": 0
}
}
],
"responses": {
"200": {
"description": "Successful response with the dataref value. The value type depends on the dataref: a number for scalar datarefs, an array for array datarefs, or a base64 string for data datarefs.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"description": "The dataref value. Type depends on the dataref: number, array of numbers, or base64 string.",
"oneOf": [
{ "type": "number" },
{
"type": "array",
"items": { "type": "number" }
},
{ "type": "string" }
]
}
}
},
"examples": {
"scalar": {
"summary": "Scalar value (float/double/int)",
"value": { "data": 43200.0 }
},
"array": {
"summary": "Array value (float_array/int_array)",
"value": { "data": [0.0, 0.0, 0.0, 0.0] }
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"index_out_of_range": {
"value": {
"error_code": "index_out_of_range",
"error_message": "Dataref array index out of range"
}
},
"not_an_array": {
"value": {
"error_code": "not_an_array",
"error_message": "An index was provided but the dataref is not an array"
}
}
}
}
}
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"description": "Dataref not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"example": {
"error_code": "invalid_dataref_id",
"error_message": "Dataref id 99999 doesn't exist"
}
}
}
}
}
},
"patch": {
"tags": ["Datarefs"],
"summary": "Set dataref value",
"description": "Set a dataref value. For array datarefs, you can set a specific index or the whole array at once (all values must be provided).",
"operationId": "setDatarefValue",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "Numeric ID of the dataref to update",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "index",
"in": "query",
"description": "Index to set on array datarefs.",
"schema": {
"type": "integer",
"minimum": 0
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["data"],
"properties": {
"data": {
"description": "The value to set. A single number, an array of numbers, or a base64 encoded string.",
"oneOf": [
{ "type": "number" },
{
"type": "array",
"items": { "type": "number" }
},
{ "type": "string" }
]
}
}
},
"examples": {
"scalar": {
"summary": "Set a scalar value",
"value": { "data": 43200 }
},
"array": {
"summary": "Set an entire array",
"value": { "data": [210, 220, 240] }
}
}
}
}
},
"responses": {
"200": {
"description": "Value set successfully",
"content": {
"application/json": {
"schema": {
"nullable": true,
"description": "Returns null on success"
},
"example": null
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"index_out_of_range": {
"value": {
"error_code": "index_out_of_range",
"error_message": "Dataref array index out of range"
}
},
"not_an_array": {
"value": {
"error_code": "not_an_array",
"error_message": "An index was provided but the dataref is not an array"
}
},
"incompatible_data": {
"value": {
"error_code": "incompatible_data",
"error_message": "Provided data is too much or not enough to set all elements of the dataref array, or sent an array to write to a non-array dataref."
}
},
"invalid_body": {
"value": {
"error_code": "invalid_body",
"error_message": "The request body is not valid JSON"
}
}
}
}
}
},
"403": {
"description": "Dataref is read-only or incoming traffic is disabled",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"example": {
"error_code": "dataref_is_readonly",
"error_message": "Attempted to write to a read-only dataref"
}
}
}
},
"404": {
"description": "Dataref not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"example": {
"error_code": "invalid_dataref_id",
"error_message": "Dataref id 99999 doesn't exist"
}
}
}
}
}
}
},
"/commands": {
"get": {
"tags": ["Commands"],
"summary": "List commands",
"description": "Returns all registered commands in X-Plane at the moment (built-in and third party). Supports filtering, pagination, and field selection. Introduced in API v2 (X-Plane 12.1.4+).",
"operationId": "listCommands",
"parameters": [
{
"name": "filter[name]",
"in": "query",
"description": "Filter by exact command name. Repeatable — multiple values are joined with OR logic.",
"schema": {
"type": "string"
},
"example": "sim/operation/pause"
},
{
"name": "start",
"in": "query",
"description": "Index from where to start (inclusive, for pagination).",
"schema": {
"type": "integer",
"minimum": 0
}
},
{
"name": "limit",
"in": "query",
"description": "Maximum number of results to return (for pagination).",
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "fields",
"in": "query",
"description": "Comma-separated list of fields to return per record. Available fields: `id`, `name`, `description`. Use `all` (default) to return all fields.",
"schema": {
"type": "string",
"default": "all"
},
"example": "id,name"
}
],
"responses": {
"200": {
"description": "Successful response with array of commands",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Command"
}
}
}
},
"example": {
"data": [
{
"description": "Landing lights toggle.",
"id": 818,
"name": "sim/lights/landing_lights_toggle"
}
]
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"start_out_of_range": {
"value": {
"error_code": "start_out_of_range",
"error_message": "Start out of range"
}
},
"limit_out_of_range": {
"value": {
"error_code": "limit_out_of_range",
"error_message": "Limit out of range"
}
},
"invalid_field": {
"value": {
"error_code": "invalid_field",
"error_message": "Field name 'foo' does not exist"
}
}
}
}
}
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"description": "Command name not found (when using filter[name])",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"example": {
"error_code": "invalid_command_name",
"error_message": "Command name 'foo' doesn't exist"
}
}
}
}
}
}
},
"/commands/count": {
"get": {
"tags": ["Commands"],
"summary": "Get command count",
"description": "Returns the number of registered commands in X-Plane at the moment (built-in and third party). Introduced in API v2 (X-Plane 12.1.4+).",
"operationId": "getCommandCount",
"responses": {
"200": {
"description": "Successful response with the command count",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "integer",
"description": "Total number of registered commands"
}
}
},
"example": {
"data": 3171
}
}
}
},
"403": {
"$ref": "#/components/responses/Forbidden"
}
}
}
},
"/command/{id}/activate": {
"post": {
"tags": ["Commands"],
"summary": "Activate a command",
"description": "Runs a command for a fixed duration. A zero duration triggers the command on and off immediately (like a button press). Maximum duration is 10 seconds.\n\nThis endpoint is intended for fire-and-forget commands (e.g., `sim/operation/pause`). For hardware integration or command up/down sequences, use the WebSocket interface instead.\n\nIntroduced in API v2 (X-Plane 12.1.4+).",
"operationId": "activateCommand",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "Numeric ID of the command to activate",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["duration"],
"properties": {
"duration": {
"type": "number",
"format": "float",
"minimum": 0,
"maximum": 10,
"description": "Time in seconds after which the command will be deactivated. Use 0 for an immediate press-and-release."
}
}
},
"examples": {
"press_half_sec": {
"summary": "Press for half a second",
"value": { "duration": 0.5 }
},
"press_release": {
"summary": "Immediate press and release",
"value": { "duration": 0 }
}
}
}
}
},
"responses": {
"200": {
"description": "Command activated successfully",
"content": {
"application/json": {
"schema": {
"nullable": true,
"description": "Returns null on success"
},
"example": null
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"invalid_body": {
"value": {
"error_code": "invalid_body",
"error_message": "The request body is not valid JSON"
}
},
"duration_out_of_range": {
"value": {
"error_code": "duration_out_of_range",
"error_message": "Duration is out of valid range"
}
},
"duration_missing": {
"value": {
"error_code": "duration_missing",
"error_message": "Duration parameter is missing"
}
}
}
}
}
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"description": "Command not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"example": {
"error_code": "invalid_command_id",
"error_message": "Command id 99999 doesn't exist"
}
}
}
}
}
}
},
"/flight": {
"post": {
"tags": ["Flight"],
"summary": "Start a flight",
"description": "Starts a new flight with the specified configuration. Introduced in API v3 (X-Plane 12.4.0+).\n\nRequires: `aircraft` and exactly one start location key (`runway_start`, `ramp_start`, `lle_ground_start`, `lle_air_start`, or `boat_start`). All other keys are optional.\n\nSee the [Flight Initialization API documentation](https://developer.x-plane.com/article/flight-initialization-api/) for full details.",
"operationId": "startFlight",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["data"],
"properties": {
"data": {
"$ref": "#/components/schemas/FlightInit"
}
}
},
"examples": {
"minimal": {
"summary": "Minimal ramp start",
"value": {
"data": {
"ramp_start": {
"airport_id": "KPDX",
"ramp": "A1"
},
"aircraft": {
"path": "Aircraft/Laminar Research/Boeing 737-800/b738.acf"
}
}
}
},
"full": {
"summary": "Runway start with weather and time",
"value": {
"data": {
"runway_start": {
"airport_id": "KBOS",
"runway": "22L"
},
"aircraft": {
"path": "Aircraft/Laminar Research/Cessna 172SP/Cessna_172SP.acf",
"livery": "default"
},
"weight": {
"payload_weight_in_kilograms": [80, 80, 0, 0, 0, 0, 0, 0, 0],
"fueltank_weight_in_kilograms": [50, 50, 0, 0, 0, 0, 0, 0, 0]
},
"engine_status": {
"all_engines": { "running": true }
},
"local_time": {
"day_of_year": 150,
"time_in_24_hours": 14.5
},
"weather": {
"definition": "vfr_scattered",
"vertical_speed_in_thermal_in_feet_per_minute": 200,
"wave_height_in_meters": 1.5,
"wave_direction_in_degrees": 180,
"terrain_state": "dry",
"variation_across_region_percentage": 50,
"evolution_over_time_enum": "static"
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Flight started successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FlightSuccessResponse"
},
"example": {
"error_code": "success"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"json_invalid_format": {
"value": {
"error_code": "json_invalid",
"error_message": "Failed to parse json, json format invalid"
}
},
"json_invalid_missing_keys": {
"value": {
"error_code": "json_invalid",
"error_message": "Provided json is invalid, to start a new flight both a start and an aircraft key must be present."
}
},
"missing_aircraft": {
"value": {
"error_code": "missing_aircraft",
"error_message": "Failed to parse aircraft_spec: no aircraft file found at path: fake.acf"
}
},
"missing_livery": {
"value": {
"error_code": "missing_livery",
"error_message": "Livery name doesn't exist"
}
},
"missing_scenery": {
"value": {
"error_code": "missing_scenery",
"error_message": "All or some scenery for the requested conditions is missing"
}
},
"missing_airport": {
"value": {
"error_code": "missing_airport",
"error_message": "Failed to parse ramp start, airport id 'XXXX' is not recognized"
}
},
"missing_ramp": {
"value": {
"error_code": "missing_ramp",
"error_message": "Specified ramp start not found"
}
},
"missing_runway": {
"value": {
"error_code": "missing_runway",
"error_message": "Specified runway not found"
}
}
}
}
}
},
"403": {
"$ref": "#/components/responses/Forbidden"
}
}
},
"patch": {
"tags": ["Flight"],
"summary": "Update flight",
"description": "Updates the current flight configuration. You cannot change the start location or aircraft during an update — these require starting a new flight. All keys are optional; omitted keys leave corresponding parameters unchanged. Introduced in API v3 (X-Plane 12.4.0+).\n\nSee the [Flight Initialization API documentation](https://developer.x-plane.com/article/flight-initialization-api/) for full details.",
"operationId": "updateFlight",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["data"],
"properties": {
"data": {
"type": "object",
"description": "Partial flight configuration update. All keys are optional. Cannot include start location or aircraft keys."
}
}
},
"example": {
"data": {
"local_time": {
"day_of_year": 100,
"time_in_24_hours": 15.9
}
}
}
}
}
},
"responses": {
"200": {
"description": "Flight updated successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FlightSuccessResponse"
},
"example": {
"error_code": "success"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"json_invalid": {
"value": {
"error_code": "json_invalid",
"error_message": "Failed to parse json, json format invalid"
}
}
}
}
}
},
"403": {
"$ref": "#/components/responses/Forbidden"
}
}
}
}
},
"components": {
"schemas": {
"Dataref": {
"type": "object",
"description": "Represents a dataref in the simulator. The `id` is stable within an X-Plane session but may change between sessions.",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"description": "Numeric identifier of the dataref for the current simulator session",
"example": 40003472032
},
"name": {
"type": "string",
"description": "Fully qualified name of the dataref",
"example": "sim/time/zulu_time_sec"
},
"value_type": {
"type": "string",
"description": "The data type of the dataref value",
"enum": ["float", "double", "int", "int_array", "float_array", "data"],
"example": "float"
},
"is_writable": {
"type": "boolean",
"description": "Whether this dataref can be written to",
"example": false
}
}
},
"Command": {
"type": "object",
"description": "Represents a command in the simulator. The `id` is stable within an X-Plane session but may change between sessions.",
"properties": {
"id": {
"type": "integer",
"description": "Numeric identifier of the command for the current simulator session",
"example": 818
},
"name": {
"type": "string",
"description": "Fully qualified name of the command",
"example": "sim/lights/landing_lights_toggle"
},