@hexis-ai/engram-server 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/openapi.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "tags": [
9
9
  {
10
10
  "name": "Me",
11
- "description": "識別プローブ"
11
+ "description": "識別プローブ・閲覧可能な workspace/org 一覧"
12
12
  },
13
13
  {
14
14
  "name": "Sessions",
@@ -22,10 +22,22 @@
22
22
  "name": "Persons",
23
23
  "description": "person の作成・更新・検索"
24
24
  },
25
+ {
26
+ "name": "Aliases",
27
+ "description": "ワークスペース横断の alias 解決"
28
+ },
25
29
  {
26
30
  "name": "Identities",
27
31
  "description": "外部 ID(slack: / email: など)の resolve と upsert"
28
32
  },
33
+ {
34
+ "name": "Orgs (self-serve)",
35
+ "description": "engram-web からの cookie 認証 + org-member ロールでの org / workspace / API キー管理"
36
+ },
37
+ {
38
+ "name": "Orgs (admin)",
39
+ "description": "プラットフォーム管理者トークンでの org 管理"
40
+ },
29
41
  {
30
42
  "name": "Workspaces (admin)",
31
43
  "description": "ワークスペースの管理(管理者トークン必須)"
@@ -133,6 +145,120 @@
133
145
  "type": "null"
134
146
  }
135
147
  ]
148
+ },
149
+ "trigger_purpose": {
150
+ "anyOf": [
151
+ {
152
+ "type": "string"
153
+ },
154
+ {
155
+ "type": "null"
156
+ }
157
+ ]
158
+ },
159
+ "trigger_resume_hint": {
160
+ "anyOf": [
161
+ {
162
+ "type": "string"
163
+ },
164
+ {
165
+ "type": "null"
166
+ }
167
+ ]
168
+ }
169
+ },
170
+ "additionalProperties": false
171
+ },
172
+ "SessionUpdate": {
173
+ "type": "object",
174
+ "properties": {
175
+ "title": {
176
+ "anyOf": [
177
+ {
178
+ "type": "string"
179
+ },
180
+ {
181
+ "type": "null"
182
+ }
183
+ ]
184
+ },
185
+ "channel": {
186
+ "anyOf": [
187
+ {
188
+ "type": "string"
189
+ },
190
+ {
191
+ "type": "null"
192
+ }
193
+ ]
194
+ },
195
+ "status": {
196
+ "type": "string",
197
+ "enum": [
198
+ "active",
199
+ "idle",
200
+ "completed"
201
+ ]
202
+ },
203
+ "summary": {
204
+ "anyOf": [
205
+ {
206
+ "type": "string"
207
+ },
208
+ {
209
+ "type": "null"
210
+ }
211
+ ]
212
+ },
213
+ "model": {
214
+ "anyOf": [
215
+ {
216
+ "type": "string"
217
+ },
218
+ {
219
+ "type": "null"
220
+ }
221
+ ]
222
+ },
223
+ "trigger_conversation_id": {
224
+ "anyOf": [
225
+ {
226
+ "type": "string"
227
+ },
228
+ {
229
+ "type": "null"
230
+ }
231
+ ]
232
+ },
233
+ "trigger_event_id": {
234
+ "anyOf": [
235
+ {
236
+ "type": "string"
237
+ },
238
+ {
239
+ "type": "null"
240
+ }
241
+ ]
242
+ },
243
+ "trigger_purpose": {
244
+ "anyOf": [
245
+ {
246
+ "type": "string"
247
+ },
248
+ {
249
+ "type": "null"
250
+ }
251
+ ]
252
+ },
253
+ "trigger_resume_hint": {
254
+ "anyOf": [
255
+ {
256
+ "type": "string"
257
+ },
258
+ {
259
+ "type": "null"
260
+ }
261
+ ]
136
262
  }
137
263
  },
138
264
  "additionalProperties": false
@@ -406,6 +532,95 @@
406
532
  },
407
533
  "additionalProperties": false
408
534
  },
535
+ "AliasUpsert": {
536
+ "type": "object",
537
+ "properties": {
538
+ "caller": {
539
+ "type": "string",
540
+ "minLength": 1
541
+ },
542
+ "last_used": {
543
+ "type": "string",
544
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}"
545
+ },
546
+ "increment": {
547
+ "type": "boolean"
548
+ }
549
+ },
550
+ "required": [
551
+ "caller",
552
+ "last_used"
553
+ ],
554
+ "additionalProperties": false
555
+ },
556
+ "IdentityUpsert": {
557
+ "type": "object",
558
+ "properties": {
559
+ "person_id": {
560
+ "type": "string",
561
+ "minLength": 1
562
+ },
563
+ "service": {
564
+ "type": "string",
565
+ "minLength": 1
566
+ },
567
+ "external_id": {
568
+ "type": "string",
569
+ "minLength": 1
570
+ },
571
+ "display_name": {
572
+ "anyOf": [
573
+ {
574
+ "type": "string"
575
+ },
576
+ {
577
+ "type": "null"
578
+ }
579
+ ]
580
+ },
581
+ "source": {
582
+ "anyOf": [
583
+ {
584
+ "type": "string"
585
+ },
586
+ {
587
+ "type": "null"
588
+ }
589
+ ]
590
+ },
591
+ "is_primary": {
592
+ "anyOf": [
593
+ {
594
+ "type": "boolean"
595
+ },
596
+ {
597
+ "type": "null"
598
+ }
599
+ ]
600
+ },
601
+ "picture": {
602
+ "anyOf": [
603
+ {
604
+ "type": "string"
605
+ },
606
+ {
607
+ "type": "null"
608
+ }
609
+ ]
610
+ },
611
+ "linked_at": {
612
+ "type": "string",
613
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}"
614
+ }
615
+ },
616
+ "required": [
617
+ "person_id",
618
+ "service",
619
+ "external_id",
620
+ "linked_at"
621
+ ],
622
+ "additionalProperties": false
623
+ },
409
624
  "SearchRequest": {
410
625
  "type": "object",
411
626
  "properties": {
@@ -518,6 +733,72 @@
518
733
  }
519
734
  },
520
735
  "additionalProperties": false
736
+ },
737
+ "CreateOrg": {
738
+ "type": "object",
739
+ "properties": {
740
+ "id": {
741
+ "type": "string"
742
+ },
743
+ "name": {
744
+ "type": "string"
745
+ },
746
+ "metadata": {
747
+ "type": "object",
748
+ "propertyNames": {
749
+ "type": "string"
750
+ },
751
+ "additionalProperties": {}
752
+ }
753
+ },
754
+ "additionalProperties": false
755
+ },
756
+ "OrgPatch": {
757
+ "type": "object",
758
+ "properties": {
759
+ "name": {
760
+ "type": "string"
761
+ },
762
+ "metadata": {
763
+ "type": "object",
764
+ "propertyNames": {
765
+ "type": "string"
766
+ },
767
+ "additionalProperties": {}
768
+ }
769
+ },
770
+ "additionalProperties": false
771
+ },
772
+ "WorkspacePatch": {
773
+ "type": "object",
774
+ "properties": {
775
+ "name": {
776
+ "type": "string"
777
+ },
778
+ "metadata": {
779
+ "type": "object",
780
+ "propertyNames": {
781
+ "type": "string"
782
+ },
783
+ "additionalProperties": {}
784
+ }
785
+ },
786
+ "additionalProperties": false
787
+ },
788
+ "AddMember": {
789
+ "type": "object",
790
+ "properties": {
791
+ "userId": {
792
+ "type": "string"
793
+ },
794
+ "email": {
795
+ "type": "string"
796
+ },
797
+ "role": {
798
+ "type": "string"
799
+ }
800
+ },
801
+ "additionalProperties": false
521
802
  }
522
803
  }
523
804
  },
@@ -538,18 +819,50 @@
538
819
  ]
539
820
  }
540
821
  },
541
- "/v1/sessions": {
542
- "post": {
543
- "summary": "セッションを作成する。",
544
- "requestBody": {
545
- "required": true,
546
- "content": {
547
- "application/json": {
548
- "schema": {
549
- "$ref": "#/components/schemas/SessionInit"
550
- }
551
- }
552
- }
822
+ "/v1/me/workspaces": {
823
+ "get": {
824
+ "summary": "サインイン中のユーザーが閲覧できる workspace 一覧。cookie 認証専用 — workspace 選択前にも到達できるよう workspace ゲートの前段に置かれている。",
825
+ "responses": {
826
+ "200": {
827
+ "description": "workspace 一覧"
828
+ },
829
+ "401": {
830
+ "description": "認証エラー"
831
+ }
832
+ },
833
+ "tags": [
834
+ "Me"
835
+ ]
836
+ }
837
+ },
838
+ "/v1/me/orgs": {
839
+ "get": {
840
+ "summary": "サインイン中のユーザーが member として所属する org 一覧(自分の role 付き)。cookie 認証専用。",
841
+ "responses": {
842
+ "200": {
843
+ "description": "org 一覧"
844
+ },
845
+ "401": {
846
+ "description": "認証エラー"
847
+ }
848
+ },
849
+ "tags": [
850
+ "Me"
851
+ ]
852
+ }
853
+ },
854
+ "/v1/sessions": {
855
+ "post": {
856
+ "summary": "セッションを作成する。",
857
+ "requestBody": {
858
+ "required": true,
859
+ "content": {
860
+ "application/json": {
861
+ "schema": {
862
+ "$ref": "#/components/schemas/SessionInit"
863
+ }
864
+ }
865
+ }
553
866
  },
554
867
  "responses": {
555
868
  "200": {
@@ -1114,6 +1427,33 @@
1114
1427
  ]
1115
1428
  }
1116
1429
  },
1430
+ "/v1/aliases": {
1431
+ "get": {
1432
+ "summary": "ワークスペース全体で alias 名を case-insensitive に逆引き。同名の alias を持つ複数の person を `last_used` desc で返す。`persons` map も同梱。",
1433
+ "parameters": [
1434
+ {
1435
+ "name": "name",
1436
+ "in": "query",
1437
+ "required": true,
1438
+ "schema": {
1439
+ "type": "string"
1440
+ },
1441
+ "description": "alias 名(URL-encoded)。"
1442
+ }
1443
+ ],
1444
+ "responses": {
1445
+ "200": {
1446
+ "description": "alias 一覧 + persons map"
1447
+ },
1448
+ "401": {
1449
+ "description": "認証エラー"
1450
+ }
1451
+ },
1452
+ "tags": [
1453
+ "Aliases"
1454
+ ]
1455
+ }
1456
+ },
1117
1457
  "/v1/identities/{ref}": {
1118
1458
  "put": {
1119
1459
  "summary": "ref(例: `slack:U12345`、`email:foo@bar.com`)で identity を upsert する。",
@@ -1185,6 +1525,984 @@
1185
1525
  ]
1186
1526
  }
1187
1527
  },
1528
+ "/v1/orgs/{id}": {
1529
+ "get": {
1530
+ "summary": "自分が member の org を取得する(自分の role 付き)。",
1531
+ "parameters": [
1532
+ {
1533
+ "name": "id",
1534
+ "in": "path",
1535
+ "required": true,
1536
+ "schema": {
1537
+ "type": "string"
1538
+ },
1539
+ "description": "org id。"
1540
+ }
1541
+ ],
1542
+ "responses": {
1543
+ "200": {
1544
+ "description": "org + role"
1545
+ },
1546
+ "401": {
1547
+ "description": "認証エラー"
1548
+ },
1549
+ "403": {
1550
+ "description": "この org の member ではない"
1551
+ },
1552
+ "404": {
1553
+ "description": "org が見つからない"
1554
+ }
1555
+ },
1556
+ "tags": [
1557
+ "Orgs (self-serve)"
1558
+ ]
1559
+ },
1560
+ "patch": {
1561
+ "summary": "org の name / metadata を更新する(owner / admin のみ)。",
1562
+ "parameters": [
1563
+ {
1564
+ "name": "id",
1565
+ "in": "path",
1566
+ "required": true,
1567
+ "schema": {
1568
+ "type": "string"
1569
+ },
1570
+ "description": "org id。"
1571
+ }
1572
+ ],
1573
+ "requestBody": {
1574
+ "required": true,
1575
+ "content": {
1576
+ "application/json": {
1577
+ "schema": {
1578
+ "$ref": "#/components/schemas/OrgPatch"
1579
+ }
1580
+ }
1581
+ }
1582
+ },
1583
+ "responses": {
1584
+ "200": {
1585
+ "description": "更新後の org"
1586
+ },
1587
+ "401": {
1588
+ "description": "認証エラー"
1589
+ },
1590
+ "403": {
1591
+ "description": "権限不足(owner / admin が必要)"
1592
+ },
1593
+ "404": {
1594
+ "description": "org が見つからない"
1595
+ }
1596
+ },
1597
+ "tags": [
1598
+ "Orgs (self-serve)"
1599
+ ]
1600
+ }
1601
+ },
1602
+ "/v1/orgs/{id}/members": {
1603
+ "get": {
1604
+ "summary": "org の member 一覧。",
1605
+ "parameters": [
1606
+ {
1607
+ "name": "id",
1608
+ "in": "path",
1609
+ "required": true,
1610
+ "schema": {
1611
+ "type": "string"
1612
+ },
1613
+ "description": "org id。"
1614
+ }
1615
+ ],
1616
+ "responses": {
1617
+ "200": {
1618
+ "description": "member 一覧"
1619
+ },
1620
+ "401": {
1621
+ "description": "認証エラー"
1622
+ },
1623
+ "403": {
1624
+ "description": "この org の member ではない"
1625
+ }
1626
+ },
1627
+ "tags": [
1628
+ "Orgs (self-serve)"
1629
+ ]
1630
+ },
1631
+ "post": {
1632
+ "summary": "member を追加する(owner / admin のみ)。`email` か `userId` のいずれかを必須で渡す。",
1633
+ "parameters": [
1634
+ {
1635
+ "name": "id",
1636
+ "in": "path",
1637
+ "required": true,
1638
+ "schema": {
1639
+ "type": "string"
1640
+ },
1641
+ "description": "org id。"
1642
+ }
1643
+ ],
1644
+ "requestBody": {
1645
+ "required": true,
1646
+ "content": {
1647
+ "application/json": {
1648
+ "schema": {
1649
+ "$ref": "#/components/schemas/AddMember"
1650
+ }
1651
+ }
1652
+ }
1653
+ },
1654
+ "responses": {
1655
+ "200": {
1656
+ "description": "追加された membership"
1657
+ },
1658
+ "400": {
1659
+ "description": "`userId` も `email` も無い、または body が不正"
1660
+ },
1661
+ "401": {
1662
+ "description": "認証エラー"
1663
+ },
1664
+ "403": {
1665
+ "description": "権限不足"
1666
+ },
1667
+ "404": {
1668
+ "description": "email から user を解決できない"
1669
+ }
1670
+ },
1671
+ "tags": [
1672
+ "Orgs (self-serve)"
1673
+ ]
1674
+ }
1675
+ },
1676
+ "/v1/orgs/{id}/members/{userId}": {
1677
+ "delete": {
1678
+ "summary": "member を削除する(owner / admin のみ)。最後の owner は削除拒否(`cannot_remove_last_owner`)。",
1679
+ "parameters": [
1680
+ {
1681
+ "name": "id",
1682
+ "in": "path",
1683
+ "required": true,
1684
+ "schema": {
1685
+ "type": "string"
1686
+ },
1687
+ "description": "org id。"
1688
+ },
1689
+ {
1690
+ "name": "userId",
1691
+ "in": "path",
1692
+ "required": true,
1693
+ "schema": {
1694
+ "type": "string"
1695
+ },
1696
+ "description": "user id。"
1697
+ }
1698
+ ],
1699
+ "responses": {
1700
+ "204": {
1701
+ "description": "削除完了"
1702
+ },
1703
+ "400": {
1704
+ "description": "最後の owner は削除できない"
1705
+ },
1706
+ "401": {
1707
+ "description": "認証エラー"
1708
+ },
1709
+ "403": {
1710
+ "description": "権限不足"
1711
+ }
1712
+ },
1713
+ "tags": [
1714
+ "Orgs (self-serve)"
1715
+ ]
1716
+ }
1717
+ },
1718
+ "/v1/orgs/{id}/workspaces": {
1719
+ "get": {
1720
+ "summary": "org の workspace 一覧。",
1721
+ "parameters": [
1722
+ {
1723
+ "name": "id",
1724
+ "in": "path",
1725
+ "required": true,
1726
+ "schema": {
1727
+ "type": "string"
1728
+ },
1729
+ "description": "org id。"
1730
+ }
1731
+ ],
1732
+ "responses": {
1733
+ "200": {
1734
+ "description": "workspace 一覧"
1735
+ },
1736
+ "401": {
1737
+ "description": "認証エラー"
1738
+ },
1739
+ "403": {
1740
+ "description": "この org の member ではない"
1741
+ }
1742
+ },
1743
+ "tags": [
1744
+ "Orgs (self-serve)"
1745
+ ]
1746
+ },
1747
+ "post": {
1748
+ "summary": "workspace を作成し、(issueKey=false でなければ)初期 API キーも発行する。owner / admin のみ。",
1749
+ "parameters": [
1750
+ {
1751
+ "name": "id",
1752
+ "in": "path",
1753
+ "required": true,
1754
+ "schema": {
1755
+ "type": "string"
1756
+ },
1757
+ "description": "org id。"
1758
+ }
1759
+ ],
1760
+ "requestBody": {
1761
+ "required": true,
1762
+ "content": {
1763
+ "application/json": {
1764
+ "schema": {
1765
+ "$ref": "#/components/schemas/CreateWorkspace"
1766
+ }
1767
+ }
1768
+ }
1769
+ },
1770
+ "responses": {
1771
+ "200": {
1772
+ "description": "workspace(issueKey=false でない限り key も含む)"
1773
+ },
1774
+ "400": {
1775
+ "description": "body または workspace id が不正"
1776
+ },
1777
+ "401": {
1778
+ "description": "認証エラー"
1779
+ },
1780
+ "403": {
1781
+ "description": "権限不足"
1782
+ }
1783
+ },
1784
+ "tags": [
1785
+ "Orgs (self-serve)"
1786
+ ]
1787
+ }
1788
+ },
1789
+ "/v1/orgs/{id}/workspaces/{wsId}": {
1790
+ "patch": {
1791
+ "summary": "workspace の name / metadata を更新する(owner / admin のみ)。",
1792
+ "parameters": [
1793
+ {
1794
+ "name": "id",
1795
+ "in": "path",
1796
+ "required": true,
1797
+ "schema": {
1798
+ "type": "string"
1799
+ },
1800
+ "description": "org id。"
1801
+ },
1802
+ {
1803
+ "name": "wsId",
1804
+ "in": "path",
1805
+ "required": true,
1806
+ "schema": {
1807
+ "type": "string"
1808
+ },
1809
+ "description": "workspace id。"
1810
+ }
1811
+ ],
1812
+ "requestBody": {
1813
+ "required": true,
1814
+ "content": {
1815
+ "application/json": {
1816
+ "schema": {
1817
+ "$ref": "#/components/schemas/WorkspacePatch"
1818
+ }
1819
+ }
1820
+ }
1821
+ },
1822
+ "responses": {
1823
+ "200": {
1824
+ "description": "更新後の workspace"
1825
+ },
1826
+ "401": {
1827
+ "description": "認証エラー"
1828
+ },
1829
+ "403": {
1830
+ "description": "権限不足"
1831
+ },
1832
+ "404": {
1833
+ "description": "workspace がこの org に属さない / 存在しない"
1834
+ }
1835
+ },
1836
+ "tags": [
1837
+ "Orgs (self-serve)"
1838
+ ]
1839
+ },
1840
+ "delete": {
1841
+ "summary": "workspace を削除する(セッション・persons・identities・API キーにカスケード)。owner / admin のみ。",
1842
+ "parameters": [
1843
+ {
1844
+ "name": "id",
1845
+ "in": "path",
1846
+ "required": true,
1847
+ "schema": {
1848
+ "type": "string"
1849
+ },
1850
+ "description": "org id。"
1851
+ },
1852
+ {
1853
+ "name": "wsId",
1854
+ "in": "path",
1855
+ "required": true,
1856
+ "schema": {
1857
+ "type": "string"
1858
+ },
1859
+ "description": "workspace id。"
1860
+ }
1861
+ ],
1862
+ "responses": {
1863
+ "204": {
1864
+ "description": "削除完了"
1865
+ },
1866
+ "401": {
1867
+ "description": "認証エラー"
1868
+ },
1869
+ "403": {
1870
+ "description": "権限不足"
1871
+ },
1872
+ "404": {
1873
+ "description": "workspace がこの org に属さない"
1874
+ }
1875
+ },
1876
+ "tags": [
1877
+ "Orgs (self-serve)"
1878
+ ]
1879
+ }
1880
+ },
1881
+ "/v1/orgs/{id}/workspaces/{wsId}/keys": {
1882
+ "get": {
1883
+ "summary": "workspace の API キー一覧(owner / admin のみ)。",
1884
+ "parameters": [
1885
+ {
1886
+ "name": "id",
1887
+ "in": "path",
1888
+ "required": true,
1889
+ "schema": {
1890
+ "type": "string"
1891
+ },
1892
+ "description": "org id。"
1893
+ },
1894
+ {
1895
+ "name": "wsId",
1896
+ "in": "path",
1897
+ "required": true,
1898
+ "schema": {
1899
+ "type": "string"
1900
+ },
1901
+ "description": "workspace id。"
1902
+ }
1903
+ ],
1904
+ "responses": {
1905
+ "200": {
1906
+ "description": "キー一覧"
1907
+ },
1908
+ "401": {
1909
+ "description": "認証エラー"
1910
+ },
1911
+ "403": {
1912
+ "description": "権限不足"
1913
+ },
1914
+ "404": {
1915
+ "description": "workspace がこの org に属さない"
1916
+ }
1917
+ },
1918
+ "tags": [
1919
+ "Orgs (self-serve)"
1920
+ ]
1921
+ },
1922
+ "post": {
1923
+ "summary": "新しい API キーを発行する(owner / admin のみ)。",
1924
+ "parameters": [
1925
+ {
1926
+ "name": "id",
1927
+ "in": "path",
1928
+ "required": true,
1929
+ "schema": {
1930
+ "type": "string"
1931
+ },
1932
+ "description": "org id。"
1933
+ },
1934
+ {
1935
+ "name": "wsId",
1936
+ "in": "path",
1937
+ "required": true,
1938
+ "schema": {
1939
+ "type": "string"
1940
+ },
1941
+ "description": "workspace id。"
1942
+ }
1943
+ ],
1944
+ "requestBody": {
1945
+ "required": false,
1946
+ "content": {
1947
+ "application/json": {
1948
+ "schema": {
1949
+ "$ref": "#/components/schemas/IssueKey"
1950
+ }
1951
+ }
1952
+ }
1953
+ },
1954
+ "responses": {
1955
+ "200": {
1956
+ "description": "発行されたキー(raw は一度のみ返却)"
1957
+ },
1958
+ "401": {
1959
+ "description": "認証エラー"
1960
+ },
1961
+ "403": {
1962
+ "description": "権限不足"
1963
+ },
1964
+ "404": {
1965
+ "description": "workspace がこの org に属さない"
1966
+ }
1967
+ },
1968
+ "tags": [
1969
+ "Orgs (self-serve)"
1970
+ ]
1971
+ }
1972
+ },
1973
+ "/v1/orgs/{id}/workspaces/{wsId}/keys/{keyId}": {
1974
+ "delete": {
1975
+ "summary": "API キーを無効化する(owner / admin のみ)。",
1976
+ "parameters": [
1977
+ {
1978
+ "name": "id",
1979
+ "in": "path",
1980
+ "required": true,
1981
+ "schema": {
1982
+ "type": "string"
1983
+ },
1984
+ "description": "org id。"
1985
+ },
1986
+ {
1987
+ "name": "wsId",
1988
+ "in": "path",
1989
+ "required": true,
1990
+ "schema": {
1991
+ "type": "string"
1992
+ },
1993
+ "description": "workspace id。"
1994
+ },
1995
+ {
1996
+ "name": "keyId",
1997
+ "in": "path",
1998
+ "required": true,
1999
+ "schema": {
2000
+ "type": "string"
2001
+ },
2002
+ "description": "key id。"
2003
+ }
2004
+ ],
2005
+ "responses": {
2006
+ "204": {
2007
+ "description": "無効化完了"
2008
+ },
2009
+ "401": {
2010
+ "description": "認証エラー"
2011
+ },
2012
+ "403": {
2013
+ "description": "権限不足"
2014
+ },
2015
+ "404": {
2016
+ "description": "workspace / key がこの org に属さない、または存在しない"
2017
+ }
2018
+ },
2019
+ "tags": [
2020
+ "Orgs (self-serve)"
2021
+ ]
2022
+ }
2023
+ },
2024
+ "/admin/v1/orgs": {
2025
+ "post": {
2026
+ "summary": "org を作成する。",
2027
+ "security": [
2028
+ {
2029
+ "adminToken": []
2030
+ }
2031
+ ],
2032
+ "requestBody": {
2033
+ "required": true,
2034
+ "content": {
2035
+ "application/json": {
2036
+ "schema": {
2037
+ "$ref": "#/components/schemas/CreateOrg"
2038
+ }
2039
+ }
2040
+ }
2041
+ },
2042
+ "responses": {
2043
+ "200": {
2044
+ "description": "作成された org"
2045
+ },
2046
+ "400": {
2047
+ "description": "body が不正"
2048
+ },
2049
+ "401": {
2050
+ "description": "認証エラー"
2051
+ }
2052
+ },
2053
+ "tags": [
2054
+ "Orgs (admin)"
2055
+ ]
2056
+ },
2057
+ "get": {
2058
+ "summary": "全 org を一覧取得する。",
2059
+ "security": [
2060
+ {
2061
+ "adminToken": []
2062
+ }
2063
+ ],
2064
+ "responses": {
2065
+ "200": {
2066
+ "description": "org 一覧"
2067
+ },
2068
+ "401": {
2069
+ "description": "認証エラー"
2070
+ }
2071
+ },
2072
+ "tags": [
2073
+ "Orgs (admin)"
2074
+ ]
2075
+ }
2076
+ },
2077
+ "/admin/v1/orgs/{id}": {
2078
+ "get": {
2079
+ "summary": "単一の org を取得する。",
2080
+ "security": [
2081
+ {
2082
+ "adminToken": []
2083
+ }
2084
+ ],
2085
+ "parameters": [
2086
+ {
2087
+ "name": "id",
2088
+ "in": "path",
2089
+ "required": true,
2090
+ "schema": {
2091
+ "type": "string"
2092
+ },
2093
+ "description": "org id。"
2094
+ }
2095
+ ],
2096
+ "responses": {
2097
+ "200": {
2098
+ "description": "org"
2099
+ },
2100
+ "401": {
2101
+ "description": "認証エラー"
2102
+ },
2103
+ "404": {
2104
+ "description": "org が見つからない"
2105
+ }
2106
+ },
2107
+ "tags": [
2108
+ "Orgs (admin)"
2109
+ ]
2110
+ },
2111
+ "delete": {
2112
+ "summary": "org を削除する(member と workspace にカスケード)。",
2113
+ "security": [
2114
+ {
2115
+ "adminToken": []
2116
+ }
2117
+ ],
2118
+ "parameters": [
2119
+ {
2120
+ "name": "id",
2121
+ "in": "path",
2122
+ "required": true,
2123
+ "schema": {
2124
+ "type": "string"
2125
+ },
2126
+ "description": "org id。"
2127
+ }
2128
+ ],
2129
+ "responses": {
2130
+ "204": {
2131
+ "description": "削除完了"
2132
+ },
2133
+ "401": {
2134
+ "description": "認証エラー"
2135
+ },
2136
+ "404": {
2137
+ "description": "org が見つからない"
2138
+ }
2139
+ },
2140
+ "tags": [
2141
+ "Orgs (admin)"
2142
+ ]
2143
+ }
2144
+ },
2145
+ "/admin/v1/orgs/{id}/members": {
2146
+ "get": {
2147
+ "summary": "org の member 一覧。",
2148
+ "security": [
2149
+ {
2150
+ "adminToken": []
2151
+ }
2152
+ ],
2153
+ "parameters": [
2154
+ {
2155
+ "name": "id",
2156
+ "in": "path",
2157
+ "required": true,
2158
+ "schema": {
2159
+ "type": "string"
2160
+ },
2161
+ "description": "org id。"
2162
+ }
2163
+ ],
2164
+ "responses": {
2165
+ "200": {
2166
+ "description": "member 一覧"
2167
+ },
2168
+ "401": {
2169
+ "description": "認証エラー"
2170
+ },
2171
+ "404": {
2172
+ "description": "org が見つからない"
2173
+ }
2174
+ },
2175
+ "tags": [
2176
+ "Orgs (admin)"
2177
+ ]
2178
+ },
2179
+ "post": {
2180
+ "summary": "member を追加する(email または userId)。",
2181
+ "security": [
2182
+ {
2183
+ "adminToken": []
2184
+ }
2185
+ ],
2186
+ "parameters": [
2187
+ {
2188
+ "name": "id",
2189
+ "in": "path",
2190
+ "required": true,
2191
+ "schema": {
2192
+ "type": "string"
2193
+ },
2194
+ "description": "org id。"
2195
+ }
2196
+ ],
2197
+ "requestBody": {
2198
+ "required": true,
2199
+ "content": {
2200
+ "application/json": {
2201
+ "schema": {
2202
+ "$ref": "#/components/schemas/AddMember"
2203
+ }
2204
+ }
2205
+ }
2206
+ },
2207
+ "responses": {
2208
+ "200": {
2209
+ "description": "追加された membership"
2210
+ },
2211
+ "400": {
2212
+ "description": "`userId` も `email` も無い、または body が不正"
2213
+ },
2214
+ "401": {
2215
+ "description": "認証エラー"
2216
+ },
2217
+ "404": {
2218
+ "description": "org または email から user を解決できない"
2219
+ }
2220
+ },
2221
+ "tags": [
2222
+ "Orgs (admin)"
2223
+ ]
2224
+ }
2225
+ },
2226
+ "/admin/v1/orgs/{id}/members/{userId}": {
2227
+ "delete": {
2228
+ "summary": "member を削除する。最後の owner は削除拒否(`cannot_remove_last_owner`)。",
2229
+ "security": [
2230
+ {
2231
+ "adminToken": []
2232
+ }
2233
+ ],
2234
+ "parameters": [
2235
+ {
2236
+ "name": "id",
2237
+ "in": "path",
2238
+ "required": true,
2239
+ "schema": {
2240
+ "type": "string"
2241
+ },
2242
+ "description": "org id。"
2243
+ },
2244
+ {
2245
+ "name": "userId",
2246
+ "in": "path",
2247
+ "required": true,
2248
+ "schema": {
2249
+ "type": "string"
2250
+ },
2251
+ "description": "user id。"
2252
+ }
2253
+ ],
2254
+ "responses": {
2255
+ "204": {
2256
+ "description": "削除完了"
2257
+ },
2258
+ "400": {
2259
+ "description": "最後の owner は削除できない"
2260
+ },
2261
+ "401": {
2262
+ "description": "認証エラー"
2263
+ },
2264
+ "404": {
2265
+ "description": "org が見つからない"
2266
+ }
2267
+ },
2268
+ "tags": [
2269
+ "Orgs (admin)"
2270
+ ]
2271
+ }
2272
+ },
2273
+ "/admin/v1/orgs/{id}/workspaces": {
2274
+ "post": {
2275
+ "summary": "org の下に workspace を作成し、(issueKey=false でなければ)初期 API キーも発行する。",
2276
+ "security": [
2277
+ {
2278
+ "adminToken": []
2279
+ }
2280
+ ],
2281
+ "parameters": [
2282
+ {
2283
+ "name": "id",
2284
+ "in": "path",
2285
+ "required": true,
2286
+ "schema": {
2287
+ "type": "string"
2288
+ },
2289
+ "description": "org id。"
2290
+ }
2291
+ ],
2292
+ "requestBody": {
2293
+ "required": true,
2294
+ "content": {
2295
+ "application/json": {
2296
+ "schema": {
2297
+ "$ref": "#/components/schemas/CreateWorkspace"
2298
+ }
2299
+ }
2300
+ }
2301
+ },
2302
+ "responses": {
2303
+ "200": {
2304
+ "description": "workspace(issueKey=false でない限り key も含む)"
2305
+ },
2306
+ "400": {
2307
+ "description": "body または workspace id が不正"
2308
+ },
2309
+ "401": {
2310
+ "description": "認証エラー"
2311
+ },
2312
+ "404": {
2313
+ "description": "org が見つからない"
2314
+ }
2315
+ },
2316
+ "tags": [
2317
+ "Orgs (admin)"
2318
+ ]
2319
+ },
2320
+ "get": {
2321
+ "summary": "org の workspace 一覧。",
2322
+ "security": [
2323
+ {
2324
+ "adminToken": []
2325
+ }
2326
+ ],
2327
+ "parameters": [
2328
+ {
2329
+ "name": "id",
2330
+ "in": "path",
2331
+ "required": true,
2332
+ "schema": {
2333
+ "type": "string"
2334
+ },
2335
+ "description": "org id。"
2336
+ }
2337
+ ],
2338
+ "responses": {
2339
+ "200": {
2340
+ "description": "workspace 一覧"
2341
+ },
2342
+ "401": {
2343
+ "description": "認証エラー"
2344
+ },
2345
+ "404": {
2346
+ "description": "org が見つからない"
2347
+ }
2348
+ },
2349
+ "tags": [
2350
+ "Orgs (admin)"
2351
+ ]
2352
+ }
2353
+ },
2354
+ "/admin/v1/orgs/{id}/workspaces/{wsId}/keys": {
2355
+ "get": {
2356
+ "summary": "org 配下の workspace の API キー一覧(ハッシュのみ)。",
2357
+ "security": [
2358
+ {
2359
+ "adminToken": []
2360
+ }
2361
+ ],
2362
+ "parameters": [
2363
+ {
2364
+ "name": "id",
2365
+ "in": "path",
2366
+ "required": true,
2367
+ "schema": {
2368
+ "type": "string"
2369
+ },
2370
+ "description": "org id。"
2371
+ },
2372
+ {
2373
+ "name": "wsId",
2374
+ "in": "path",
2375
+ "required": true,
2376
+ "schema": {
2377
+ "type": "string"
2378
+ },
2379
+ "description": "workspace id。"
2380
+ }
2381
+ ],
2382
+ "responses": {
2383
+ "200": {
2384
+ "description": "キー一覧"
2385
+ },
2386
+ "401": {
2387
+ "description": "認証エラー"
2388
+ },
2389
+ "404": {
2390
+ "description": "workspace がこの org に属さない / org が無い"
2391
+ }
2392
+ },
2393
+ "tags": [
2394
+ "Orgs (admin)"
2395
+ ]
2396
+ },
2397
+ "post": {
2398
+ "summary": "org 配下の workspace に新しい API キーを発行する。`createWorkspaceUnderOrg` 後のキー rotation に使う。",
2399
+ "security": [
2400
+ {
2401
+ "adminToken": []
2402
+ }
2403
+ ],
2404
+ "parameters": [
2405
+ {
2406
+ "name": "id",
2407
+ "in": "path",
2408
+ "required": true,
2409
+ "schema": {
2410
+ "type": "string"
2411
+ },
2412
+ "description": "org id。"
2413
+ },
2414
+ {
2415
+ "name": "wsId",
2416
+ "in": "path",
2417
+ "required": true,
2418
+ "schema": {
2419
+ "type": "string"
2420
+ },
2421
+ "description": "workspace id。"
2422
+ }
2423
+ ],
2424
+ "requestBody": {
2425
+ "required": false,
2426
+ "content": {
2427
+ "application/json": {
2428
+ "schema": {
2429
+ "$ref": "#/components/schemas/IssueKey"
2430
+ }
2431
+ }
2432
+ }
2433
+ },
2434
+ "responses": {
2435
+ "200": {
2436
+ "description": "発行されたキー(raw は一度のみ返却)"
2437
+ },
2438
+ "400": {
2439
+ "description": "リクエストボディが不正"
2440
+ },
2441
+ "401": {
2442
+ "description": "認証エラー"
2443
+ },
2444
+ "404": {
2445
+ "description": "workspace がこの org に属さない / org が無い"
2446
+ }
2447
+ },
2448
+ "tags": [
2449
+ "Orgs (admin)"
2450
+ ]
2451
+ }
2452
+ },
2453
+ "/admin/v1/orgs/{id}/workspaces/{wsId}/keys/{keyId}": {
2454
+ "delete": {
2455
+ "summary": "org 配下の workspace の API キーを無効化する。",
2456
+ "security": [
2457
+ {
2458
+ "adminToken": []
2459
+ }
2460
+ ],
2461
+ "parameters": [
2462
+ {
2463
+ "name": "id",
2464
+ "in": "path",
2465
+ "required": true,
2466
+ "schema": {
2467
+ "type": "string"
2468
+ },
2469
+ "description": "org id。"
2470
+ },
2471
+ {
2472
+ "name": "wsId",
2473
+ "in": "path",
2474
+ "required": true,
2475
+ "schema": {
2476
+ "type": "string"
2477
+ },
2478
+ "description": "workspace id。"
2479
+ },
2480
+ {
2481
+ "name": "keyId",
2482
+ "in": "path",
2483
+ "required": true,
2484
+ "schema": {
2485
+ "type": "string"
2486
+ },
2487
+ "description": "key id。"
2488
+ }
2489
+ ],
2490
+ "responses": {
2491
+ "204": {
2492
+ "description": "無効化完了"
2493
+ },
2494
+ "401": {
2495
+ "description": "認証エラー"
2496
+ },
2497
+ "404": {
2498
+ "description": "workspace / key がこの org に属さない、または存在しない"
2499
+ }
2500
+ },
2501
+ "tags": [
2502
+ "Orgs (admin)"
2503
+ ]
2504
+ }
2505
+ },
1188
2506
  "/admin/v1/workspaces": {
1189
2507
  "post": {
1190
2508
  "summary": "ワークスペースを作成する(デフォルトで初期キーも発行する)。",